summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDominik Riebeling <Dominik.Riebeling@gmail.com>2013-01-13 19:45:29 +0100
committerDominik Riebeling <Dominik.Riebeling@gmail.com>2013-01-13 19:45:29 +0100
commit1f1826e39c2e9c8b548017153b34ab8d68bb8d03 (patch)
treedd44d964f0c0e2c1f0b890d1a1bc5388ffdd44a2
parentd608fd604b4a3c0f0f9ba9dc3bcce7aae6c557f7 (diff)
downloadrockbox-1f1826e39c2e9c8b548017153b34ab8d68bb8d03.tar.gz
rockbox-1f1826e39c2e9c8b548017153b34ab8d68bb8d03.zip
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
-rw-r--r--rbutil/rbutilqt/base/httpget.cpp4
-rw-r--r--rbutil/rbutilqt/base/httpget.h6
-rw-r--r--rbutil/rbutilqt/base/rbsettings.cpp1
-rw-r--r--rbutil/rbutilqt/base/rbsettings.h1
-rw-r--r--rbutil/rbutilqt/configure.cpp2
-rw-r--r--rbutil/rbutilqt/configurefrm.ui10
-rw-r--r--rbutil/rbutilqt/rbutilqt.cpp8
-rw-r--r--rbutil/rbutilqt/themesinstallwindow.cpp2
8 files changed, 2 insertions, 32 deletions
diff --git a/rbutil/rbutilqt/base/httpget.cpp b/rbutil/rbutilqt/base/httpget.cpp
index 05005ee6d3..66a7076391 100644
--- a/rbutil/rbutilqt/base/httpget.cpp
+++ b/rbutil/rbutilqt/base/httpget.cpp
@@ -24,7 +24,6 @@
24 24
25QDir HttpGet::m_globalCache; //< global cach path value for new objects 25QDir HttpGet::m_globalCache; //< global cach path value for new objects
26QUrl HttpGet::m_globalProxy; //< global proxy value for new objects 26QUrl HttpGet::m_globalProxy; //< global proxy value for new objects
27bool HttpGet::m_globalDumbCache = false; //< globally set cache "dumb" mode
28QString HttpGet::m_globalUserAgent; //< globally set user agent for requests 27QString HttpGet::m_globalUserAgent; //< globally set user agent for requests
29 28
30HttpGet::HttpGet(QObject *parent) 29HttpGet::HttpGet(QObject *parent)
@@ -32,7 +31,6 @@ HttpGet::HttpGet(QObject *parent)
32{ 31{
33 outputToBuffer = true; 32 outputToBuffer = true;
34 m_cached = false; 33 m_cached = false;
35 m_dumbCache = m_globalDumbCache;
36 getRequest = -1; 34 getRequest = -1;
37 headRequest = -1; 35 headRequest = -1;
38 // if a request is cancelled before a reponse is available return some 36 // if a request is cancelled before a reponse is available return some
@@ -213,7 +211,7 @@ bool HttpGet::getFile(const QUrl &url)
213 m_header.setValue("User-Agent", m_globalUserAgent); 211 m_header.setValue("User-Agent", m_globalUserAgent);
214 m_header.setValue("Connection", "Keep-Alive"); 212 m_header.setValue("Connection", "Keep-Alive");
215 213
216 if(m_dumbCache || !m_usecache) { 214 if(!m_usecache) {
217 getFileFinish(); 215 getFileFinish();
218 } 216 }
219 else { 217 else {
diff --git a/rbutil/rbutilqt/base/httpget.h b/rbutil/rbutilqt/base/httpget.h
index e8a936de08..73d3fbbaf5 100644
--- a/rbutil/rbutilqt/base/httpget.h
+++ b/rbutil/rbutilqt/base/httpget.h
@@ -45,14 +45,10 @@ class HttpGet : public QObject
45 { return m_cached; } 45 { return m_cached; }
46 QDateTime timestamp(void) 46 QDateTime timestamp(void)
47 { return m_serverTimestamp; } 47 { return m_serverTimestamp; }
48 void setDumbCache(bool b) //< disable checking of http header timestamp for caching
49 { m_dumbCache = b; }
50 static void setGlobalCache(const QDir& d) //< set global cache path 48 static void setGlobalCache(const QDir& d) //< set global cache path
51 { m_globalCache = d; } 49 { m_globalCache = d; }
52 static void setGlobalProxy(const QUrl& p) //< set global proxy value 50 static void setGlobalProxy(const QUrl& p) //< set global proxy value
53 { m_globalProxy = p; } 51 { m_globalProxy = p; }
54 static void setGlobalDumbCache(bool b) //< set "dumb" (ignore server status) caching mode
55 { m_globalDumbCache = b; }
56 static void setGlobalUserAgent(const QString& u) //< set global user agent string 52 static void setGlobalUserAgent(const QString& u) //< set global user agent string
57 { m_globalUserAgent = u; } 53 { m_globalUserAgent = u; }
58 54
@@ -92,12 +88,10 @@ class HttpGet : public QObject
92 QString m_query; //< constructed query to pass http getter 88 QString m_query; //< constructed query to pass http getter
93 QString m_path; //< constructed path to pass http getter 89 QString m_path; //< constructed path to pass http getter
94 QString m_hash; //< caching hash 90 QString m_hash; //< caching hash
95 bool m_dumbCache; //< true if caching should ignore the server header
96 QHttpRequestHeader m_header; 91 QHttpRequestHeader m_header;
97 92
98 static QDir m_globalCache; //< global cache path value 93 static QDir m_globalCache; //< global cache path value
99 static QUrl m_globalProxy; //< global proxy value 94 static QUrl m_globalProxy; //< global proxy value
100 static bool m_globalDumbCache; //< cache "dumb" mode global setting
101 static QString m_globalUserAgent; //< global user agent string 95 static QString m_globalUserAgent; //< global user agent string
102}; 96};
103 97
diff --git a/rbutil/rbutilqt/base/rbsettings.cpp b/rbutil/rbutilqt/base/rbsettings.cpp
index a42b33c1bd..4d3901fce3 100644
--- a/rbutil/rbutilqt/base/rbsettings.cpp
+++ b/rbutil/rbutilqt/base/rbsettings.cpp
@@ -69,7 +69,6 @@ const static struct {
69 { RbSettings::TtsVoice, ":tts:/voice", "" }, 69 { RbSettings::TtsVoice, ":tts:/voice", "" },
70 { RbSettings::EncoderPath, ":encoder:/encoderpath", "" }, 70 { RbSettings::EncoderPath, ":encoder:/encoderpath", "" },
71 { RbSettings::EncoderOptions, ":encoder:/encoderoptions", "" }, 71 { RbSettings::EncoderOptions, ":encoder:/encoderoptions", "" },
72 { RbSettings::CacheOffline, "offline", "false" },
73 { RbSettings::CacheDisabled, "cachedisable", "false" }, 72 { RbSettings::CacheDisabled, "cachedisable", "false" },
74 { RbSettings::TtsUseSapi4, "sapi/useSapi4", "false" }, 73 { RbSettings::TtsUseSapi4, "sapi/useSapi4", "false" },
75 { RbSettings::EncoderNarrowBand, ":encoder:/narrowband", "false" }, 74 { RbSettings::EncoderNarrowBand, ":encoder:/narrowband", "false" },
diff --git a/rbutil/rbutilqt/base/rbsettings.h b/rbutil/rbutilqt/base/rbsettings.h
index 7aada6e78c..7255def5f0 100644
--- a/rbutil/rbutilqt/base/rbsettings.h
+++ b/rbutil/rbutilqt/base/rbsettings.h
@@ -66,7 +66,6 @@ class RbSettings : public QObject
66 WavtrimThreshold, 66 WavtrimThreshold,
67 EncoderComplexity, 67 EncoderComplexity,
68 TtsSpeed, 68 TtsSpeed,
69 CacheOffline,
70 CacheDisabled, 69 CacheDisabled,
71 TtsUseSapi4, 70 TtsUseSapi4,
72 EncoderNarrowBand, 71 EncoderNarrowBand,
diff --git a/rbutil/rbutilqt/configure.cpp b/rbutil/rbutilqt/configure.cpp
index eef1fcf4e1..ef58d28607 100644
--- a/rbutil/rbutilqt/configure.cpp
+++ b/rbutil/rbutilqt/configure.cpp
@@ -202,7 +202,6 @@ void Config::accept()
202 else // default to system temp path 202 else // default to system temp path
203 RbSettings::setValue(RbSettings::CachePath, QDir::tempPath()); 203 RbSettings::setValue(RbSettings::CachePath, QDir::tempPath());
204 RbSettings::setValue(RbSettings::CacheDisabled, ui.cacheDisable->isChecked()); 204 RbSettings::setValue(RbSettings::CacheDisabled, ui.cacheDisable->isChecked());
205 RbSettings::setValue(RbSettings::CacheOffline, ui.cacheOfflineMode->isChecked());
206 205
207 // tts settings 206 // tts settings
208 RbSettings::setValue(RbSettings::UseTtsCorrections, ui.ttsCorrections->isChecked()); 207 RbSettings::setValue(RbSettings::UseTtsCorrections, ui.ttsCorrections->isChecked());
@@ -287,7 +286,6 @@ void Config::setUserSettings()
287 RbSettings::setValue(RbSettings::CachePath, QDir::tempPath()); 286 RbSettings::setValue(RbSettings::CachePath, QDir::tempPath());
288 ui.cachePath->setText(QDir::toNativeSeparators(RbSettings::value(RbSettings::CachePath).toString())); 287 ui.cachePath->setText(QDir::toNativeSeparators(RbSettings::value(RbSettings::CachePath).toString()));
289 ui.cacheDisable->setChecked(RbSettings::value(RbSettings::CacheDisabled).toBool()); 288 ui.cacheDisable->setChecked(RbSettings::value(RbSettings::CacheDisabled).toBool());
290 ui.cacheOfflineMode->setChecked(RbSettings::value(RbSettings::CacheOffline).toBool());
291 updateCacheInfo(RbSettings::value(RbSettings::CachePath).toString()); 289 updateCacheInfo(RbSettings::value(RbSettings::CachePath).toString());
292 290
293 // TTS tab 291 // TTS tab
diff --git a/rbutil/rbutilqt/configurefrm.ui b/rbutil/rbutilqt/configurefrm.ui
index 3c0afdc15b..491c896907 100644
--- a/rbutil/rbutilqt/configurefrm.ui
+++ b/rbutil/rbutilqt/configurefrm.ui
@@ -328,16 +328,6 @@
328 </property> 328 </property>
329 </widget> 329 </widget>
330 </item> 330 </item>
331 <item>
332 <widget class="QCheckBox" name="cacheOfflineMode">
333 <property name="toolTip">
334 <string>&lt;p&gt;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.&lt;/p&gt;</string>
335 </property>
336 <property name="text">
337 <string>O&amp;ffline mode</string>
338 </property>
339 </widget>
340 </item>
341 </layout> 331 </layout>
342 </item> 332 </item>
343 <item row="4" column="1"> 333 <item row="4" column="1">
diff --git a/rbutil/rbutilqt/rbutilqt.cpp b/rbutil/rbutilqt/rbutilqt.cpp
index 0b94ba4c10..05af8c5ac7 100644
--- a/rbutil/rbutilqt/rbutilqt.cpp
+++ b/rbutil/rbutilqt/rbutilqt.cpp
@@ -210,10 +210,7 @@ void RbUtilQt::downloadInfo()
210 daily = new HttpGet(this); 210 daily = new HttpGet(this);
211 connect(daily, SIGNAL(done(bool)), this, SLOT(downloadDone(bool))); 211 connect(daily, SIGNAL(done(bool)), this, SLOT(downloadDone(bool)));
212 connect(qApp, SIGNAL(lastWindowClosed()), daily, SLOT(abort())); 212 connect(qApp, SIGNAL(lastWindowClosed()), daily, SLOT(abort()));
213 if(RbSettings::value(RbSettings::CacheOffline).toBool()) 213 daily->setCache(false);
214 daily->setCache(true);
215 else
216 daily->setCache(false);
217 ui.statusbar->showMessage(tr("Downloading build information, please wait ...")); 214 ui.statusbar->showMessage(tr("Downloading build information, please wait ..."));
218 qDebug() << "[RbUtil] downloading build info"; 215 qDebug() << "[RbUtil] downloading build info";
219 daily->setFile(&buildInfo); 216 daily->setFile(&buildInfo);
@@ -311,7 +308,6 @@ void RbUtilQt::updateSettings()
311 manual->updateManual(); 308 manual->updateManual();
312 HttpGet::setGlobalProxy(proxy()); 309 HttpGet::setGlobalProxy(proxy());
313 HttpGet::setGlobalCache(RbSettings::value(RbSettings::CachePath).toString()); 310 HttpGet::setGlobalCache(RbSettings::value(RbSettings::CachePath).toString());
314 HttpGet::setGlobalDumbCache(RbSettings::value(RbSettings::CacheOffline).toBool());
315 311
316 if(RbSettings::value(RbSettings::RbutilVersion) != PUREVERSION) { 312 if(RbSettings::value(RbSettings::RbutilVersion) != PUREVERSION) {
317 QApplication::processEvents(); 313 QApplication::processEvents();
@@ -645,8 +641,6 @@ void RbUtilQt::checkUpdate(void)
645 update = new HttpGet(this); 641 update = new HttpGet(this);
646 connect(update, SIGNAL(done(bool)), this, SLOT(downloadUpdateDone(bool))); 642 connect(update, SIGNAL(done(bool)), this, SLOT(downloadUpdateDone(bool)));
647 connect(qApp, SIGNAL(lastWindowClosed()), update, SLOT(abort())); 643 connect(qApp, SIGNAL(lastWindowClosed()), update, SLOT(abort()));
648 if(RbSettings::value(RbSettings::CacheOffline).toBool())
649 update->setCache(true);
650 644
651 ui.statusbar->showMessage(tr("Checking for update ...")); 645 ui.statusbar->showMessage(tr("Checking for update ..."));
652 update->getFile(QUrl(url)); 646 update->getFile(QUrl(url));
diff --git a/rbutil/rbutilqt/themesinstallwindow.cpp b/rbutil/rbutilqt/themesinstallwindow.cpp
index 17a4050140..e254865b25 100644
--- a/rbutil/rbutilqt/themesinstallwindow.cpp
+++ b/rbutil/rbutilqt/themesinstallwindow.cpp
@@ -76,8 +76,6 @@ void ThemesInstallWindow::downloadInfo()
76 infoUrl.replace("%RBUTILVER%", VERSION); 76 infoUrl.replace("%RBUTILVER%", VERSION);
77 QUrl url = QUrl(infoUrl); 77 QUrl url = QUrl(infoUrl);
78 qDebug() << "[Themes] Info URL:" << url << "Query:" << url.queryItems(); 78 qDebug() << "[Themes] Info URL:" << url << "Query:" << url.queryItems();
79 if(RbSettings::value(RbSettings::CacheOffline).toBool())
80 getter->setCache(true);
81 getter->setFile(&themesInfo); 79 getter->setFile(&themesInfo);
82 80
83 connect(getter, SIGNAL(done(bool)), this, SLOT(downloadDone(bool))); 81 connect(getter, SIGNAL(done(bool)), this, SLOT(downloadDone(bool)));