summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDominik Riebeling <Dominik.Riebeling@gmail.com>2013-06-09 16:41:45 +0200
committerDominik Riebeling <Dominik.Riebeling@gmail.com>2013-06-09 16:55:15 +0200
commit280a0eb27ee0f9661c44e9230f7f59b2551b18af (patch)
tree4ac1361201626fc811dbccdf6b3eddf5cef68914
parent9edc63b0d4cfddc0659bd7c5eed38f067b8853df (diff)
downloadrockbox-280a0eb27ee0f9661c44e9230f7f59b2551b18af.tar.gz
rockbox-280a0eb27ee0f9661c44e9230f7f59b2551b18af.zip
Fix temporary files stored in current folder on first start.
If Rockbox Utility has no configuration file on the machine updateSettings() will overwrite the global cache folder settings with an empty string before the value is set properly by the user confirming the configuration dialog. QDir() getting an empty string will result in the current working directory getting used, and thus the temporary files ending up there. On Windows most users are unlikely to have noticed this since running the executable from within the distribution zip file will make Windows execute it in the systems temporary path. Change-Id: I7724a82af403955786798c7380198086837e128f
-rw-r--r--rbutil/rbutilqt/rbutilqt.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/rbutil/rbutilqt/rbutilqt.cpp b/rbutil/rbutilqt/rbutilqt.cpp
index 6ff80c3cc2..6703b08791 100644
--- a/rbutil/rbutilqt/rbutilqt.cpp
+++ b/rbutil/rbutilqt/rbutilqt.cpp
@@ -72,6 +72,8 @@ RbUtilQt::RbUtilQt(QWidget *parent) : QMainWindow(parent)
72 72
73 absolutePath = qApp->applicationDirPath(); 73 absolutePath = qApp->applicationDirPath();
74 74
75 QString c = RbSettings::value(RbSettings::CachePath).toString();
76 HttpGet::setGlobalCache(c.isEmpty() ? QDir::tempPath() : c);
75 HttpGet::setGlobalUserAgent("rbutil/"VERSION); 77 HttpGet::setGlobalUserAgent("rbutil/"VERSION);
76 HttpGet::setGlobalProxy(proxy()); 78 HttpGet::setGlobalProxy(proxy());
77 // init startup & autodetection 79 // init startup & autodetection
@@ -113,12 +115,9 @@ RbUtilQt::RbUtilQt(QWidget *parent) : QMainWindow(parent)
113#endif 115#endif
114 116
115#if !defined(Q_OS_WIN32) && !defined(Q_OS_MACX) 117#if !defined(Q_OS_WIN32) && !defined(Q_OS_MACX)
116 /* eject funtionality is only implemented on W32 right now. */ 118 /* eject funtionality is not available on Linux right now. */
117 ui.buttonEject->setEnabled(false); 119 ui.buttonEject->setEnabled(false);
118#endif 120#endif
119 QString c = RbSettings::value(RbSettings::CachePath).toString();
120 if(c.isEmpty()) c = QDir::tempPath();
121 HttpGet::setGlobalCache(c);
122 updateDevice(); 121 updateDevice();
123 downloadInfo(); 122 downloadInfo();
124 123
@@ -314,8 +313,9 @@ void RbUtilQt::updateSettings()
314 qDebug() << "[RbUtil] updating current settings"; 313 qDebug() << "[RbUtil] updating current settings";
315 updateDevice(); 314 updateDevice();
316 manual->updateManual(); 315 manual->updateManual();
316 QString c = RbSettings::value(RbSettings::CachePath).toString();
317 HttpGet::setGlobalCache(c.isEmpty() ? QDir::tempPath() : c);
317 HttpGet::setGlobalProxy(proxy()); 318 HttpGet::setGlobalProxy(proxy());
318 HttpGet::setGlobalCache(RbSettings::value(RbSettings::CachePath).toString());
319 319
320 if(RbSettings::value(RbSettings::RbutilVersion) != PUREVERSION) { 320 if(RbSettings::value(RbSettings::RbutilVersion) != PUREVERSION) {
321 QApplication::processEvents(); 321 QApplication::processEvents();