forked from len0rd/rockbox
Remove Rockbox Utility Offline Mode.
Offline Mode was intended to allow performing an installation without network access. However, to get the required files cached the same installation has to be performed with network access, which is a rather strange prerequisite. A better way would be a way to direct Rockbox Utility to some local "repository" that holds the required files. Furthermore, Offline Mode hasn't been tested since long and is likely to be broken since the caching mechanism has been extended. For now remove this functionality. As far as I know it's been rarely used (if at all) anyway. Change-Id: Ib2af4892708e0440bd0a7940c131f04182ddb39a
This commit is contained in:
parent
d608fd604b
commit
1f1826e39c
8 changed files with 2 additions and 32 deletions
|
@ -24,7 +24,6 @@
|
|||
|
||||
QDir HttpGet::m_globalCache; //< global cach path value for new objects
|
||||
QUrl HttpGet::m_globalProxy; //< global proxy value for new objects
|
||||
bool HttpGet::m_globalDumbCache = false; //< globally set cache "dumb" mode
|
||||
QString HttpGet::m_globalUserAgent; //< globally set user agent for requests
|
||||
|
||||
HttpGet::HttpGet(QObject *parent)
|
||||
|
@ -32,7 +31,6 @@ HttpGet::HttpGet(QObject *parent)
|
|||
{
|
||||
outputToBuffer = true;
|
||||
m_cached = false;
|
||||
m_dumbCache = m_globalDumbCache;
|
||||
getRequest = -1;
|
||||
headRequest = -1;
|
||||
// if a request is cancelled before a reponse is available return some
|
||||
|
@ -213,7 +211,7 @@ bool HttpGet::getFile(const QUrl &url)
|
|||
m_header.setValue("User-Agent", m_globalUserAgent);
|
||||
m_header.setValue("Connection", "Keep-Alive");
|
||||
|
||||
if(m_dumbCache || !m_usecache) {
|
||||
if(!m_usecache) {
|
||||
getFileFinish();
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -45,14 +45,10 @@ class HttpGet : public QObject
|
|||
{ return m_cached; }
|
||||
QDateTime timestamp(void)
|
||||
{ return m_serverTimestamp; }
|
||||
void setDumbCache(bool b) //< disable checking of http header timestamp for caching
|
||||
{ m_dumbCache = b; }
|
||||
static void setGlobalCache(const QDir& d) //< set global cache path
|
||||
{ m_globalCache = d; }
|
||||
static void setGlobalProxy(const QUrl& p) //< set global proxy value
|
||||
{ m_globalProxy = p; }
|
||||
static void setGlobalDumbCache(bool b) //< set "dumb" (ignore server status) caching mode
|
||||
{ m_globalDumbCache = b; }
|
||||
static void setGlobalUserAgent(const QString& u) //< set global user agent string
|
||||
{ m_globalUserAgent = u; }
|
||||
|
||||
|
@ -92,12 +88,10 @@ class HttpGet : public QObject
|
|||
QString m_query; //< constructed query to pass http getter
|
||||
QString m_path; //< constructed path to pass http getter
|
||||
QString m_hash; //< caching hash
|
||||
bool m_dumbCache; //< true if caching should ignore the server header
|
||||
QHttpRequestHeader m_header;
|
||||
|
||||
static QDir m_globalCache; //< global cache path value
|
||||
static QUrl m_globalProxy; //< global proxy value
|
||||
static bool m_globalDumbCache; //< cache "dumb" mode global setting
|
||||
static QString m_globalUserAgent; //< global user agent string
|
||||
};
|
||||
|
||||
|
|
|
@ -69,7 +69,6 @@ const static struct {
|
|||
{ RbSettings::TtsVoice, ":tts:/voice", "" },
|
||||
{ RbSettings::EncoderPath, ":encoder:/encoderpath", "" },
|
||||
{ RbSettings::EncoderOptions, ":encoder:/encoderoptions", "" },
|
||||
{ RbSettings::CacheOffline, "offline", "false" },
|
||||
{ RbSettings::CacheDisabled, "cachedisable", "false" },
|
||||
{ RbSettings::TtsUseSapi4, "sapi/useSapi4", "false" },
|
||||
{ RbSettings::EncoderNarrowBand, ":encoder:/narrowband", "false" },
|
||||
|
|
|
@ -66,7 +66,6 @@ class RbSettings : public QObject
|
|||
WavtrimThreshold,
|
||||
EncoderComplexity,
|
||||
TtsSpeed,
|
||||
CacheOffline,
|
||||
CacheDisabled,
|
||||
TtsUseSapi4,
|
||||
EncoderNarrowBand,
|
||||
|
|
|
@ -202,7 +202,6 @@ void Config::accept()
|
|||
else // default to system temp path
|
||||
RbSettings::setValue(RbSettings::CachePath, QDir::tempPath());
|
||||
RbSettings::setValue(RbSettings::CacheDisabled, ui.cacheDisable->isChecked());
|
||||
RbSettings::setValue(RbSettings::CacheOffline, ui.cacheOfflineMode->isChecked());
|
||||
|
||||
// tts settings
|
||||
RbSettings::setValue(RbSettings::UseTtsCorrections, ui.ttsCorrections->isChecked());
|
||||
|
@ -287,7 +286,6 @@ void Config::setUserSettings()
|
|||
RbSettings::setValue(RbSettings::CachePath, QDir::tempPath());
|
||||
ui.cachePath->setText(QDir::toNativeSeparators(RbSettings::value(RbSettings::CachePath).toString()));
|
||||
ui.cacheDisable->setChecked(RbSettings::value(RbSettings::CacheDisabled).toBool());
|
||||
ui.cacheOfflineMode->setChecked(RbSettings::value(RbSettings::CacheOffline).toBool());
|
||||
updateCacheInfo(RbSettings::value(RbSettings::CachePath).toString());
|
||||
|
||||
// TTS tab
|
||||
|
|
|
@ -328,16 +328,6 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="cacheOfflineMode">
|
||||
<property name="toolTip">
|
||||
<string><p>This will try to use all information from the cache, even information about updates. Only use this option if you want to install without network connection. Note: you need to do the same install you want to perform later with network access first to download all required files to the cache.</p></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>O&ffline mode</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
|
|
|
@ -210,9 +210,6 @@ void RbUtilQt::downloadInfo()
|
|||
daily = new HttpGet(this);
|
||||
connect(daily, SIGNAL(done(bool)), this, SLOT(downloadDone(bool)));
|
||||
connect(qApp, SIGNAL(lastWindowClosed()), daily, SLOT(abort()));
|
||||
if(RbSettings::value(RbSettings::CacheOffline).toBool())
|
||||
daily->setCache(true);
|
||||
else
|
||||
daily->setCache(false);
|
||||
ui.statusbar->showMessage(tr("Downloading build information, please wait ..."));
|
||||
qDebug() << "[RbUtil] downloading build info";
|
||||
|
@ -311,7 +308,6 @@ void RbUtilQt::updateSettings()
|
|||
manual->updateManual();
|
||||
HttpGet::setGlobalProxy(proxy());
|
||||
HttpGet::setGlobalCache(RbSettings::value(RbSettings::CachePath).toString());
|
||||
HttpGet::setGlobalDumbCache(RbSettings::value(RbSettings::CacheOffline).toBool());
|
||||
|
||||
if(RbSettings::value(RbSettings::RbutilVersion) != PUREVERSION) {
|
||||
QApplication::processEvents();
|
||||
|
@ -645,8 +641,6 @@ void RbUtilQt::checkUpdate(void)
|
|||
update = new HttpGet(this);
|
||||
connect(update, SIGNAL(done(bool)), this, SLOT(downloadUpdateDone(bool)));
|
||||
connect(qApp, SIGNAL(lastWindowClosed()), update, SLOT(abort()));
|
||||
if(RbSettings::value(RbSettings::CacheOffline).toBool())
|
||||
update->setCache(true);
|
||||
|
||||
ui.statusbar->showMessage(tr("Checking for update ..."));
|
||||
update->getFile(QUrl(url));
|
||||
|
|
|
@ -76,8 +76,6 @@ void ThemesInstallWindow::downloadInfo()
|
|||
infoUrl.replace("%RBUTILVER%", VERSION);
|
||||
QUrl url = QUrl(infoUrl);
|
||||
qDebug() << "[Themes] Info URL:" << url << "Query:" << url.queryItems();
|
||||
if(RbSettings::value(RbSettings::CacheOffline).toBool())
|
||||
getter->setCache(true);
|
||||
getter->setFile(&themesInfo);
|
||||
|
||||
connect(getter, SIGNAL(done(bool)), this, SLOT(downloadDone(bool)));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue