summaryrefslogtreecommitdiffstats
path: root/rbutil/rbutilqt
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 /rbutil/rbutilqt
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
Diffstat (limited to 'rbutil/rbutilqt')
-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)
absolutePath = qApp->applicationDirPath();
+ QString c = RbSettings::value(RbSettings::CachePath).toString();
+ HttpGet::setGlobalCache(c.isEmpty() ? QDir::tempPath() : c);
HttpGet::setGlobalUserAgent("rbutil/"VERSION);
HttpGet::setGlobalProxy(proxy());
// init startup & autodetection
@@ -113,12 +115,9 @@ RbUtilQt::RbUtilQt(QWidget *parent) : QMainWindow(parent)
#endif
#if !defined(Q_OS_WIN32) && !defined(Q_OS_MACX)
- /* eject funtionality is only implemented on W32 right now. */
+ /* eject funtionality is not available on Linux right now. */
ui.buttonEject->setEnabled(false);
#endif
- QString c = RbSettings::value(RbSettings::CachePath).toString();
- if(c.isEmpty()) c = QDir::tempPath();
- HttpGet::setGlobalCache(c);
updateDevice();
downloadInfo();
@@ -314,8 +313,9 @@ void RbUtilQt::updateSettings()
qDebug() << "[RbUtil] updating current settings";
updateDevice();
manual->updateManual();
+ QString c = RbSettings::value(RbSettings::CachePath).toString();
+ HttpGet::setGlobalCache(c.isEmpty() ? QDir::tempPath() : c);
HttpGet::setGlobalProxy(proxy());
- HttpGet::setGlobalCache(RbSettings::value(RbSettings::CachePath).toString());
if(RbSettings::value(RbSettings::RbutilVersion) != PUREVERSION) {
QApplication::processEvents();