summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDominik Riebeling <Dominik.Riebeling@gmail.com>2013-01-27 10:32:02 +0100
committerDominik Riebeling <Dominik.Riebeling@gmail.com>2013-01-27 20:11:17 +0100
commitabd87ccf156b803ea1b9941865ca60600b742724 (patch)
tree2a1582c01dc33aaa8f4645d2c795fbe344ee3a40
parent6a6e7ea26a236b2dd113c9937064c90fd2cf601a (diff)
downloadrockbox-abd87ccf156b803ea1b9941865ca60600b742724.tar.gz
rockbox-abd87ccf156b803ea1b9941865ca60600b742724.tar.bz2
rockbox-abd87ccf156b803ea1b9941865ca60600b742724.zip
Themes Window: don't set cache folder on each request.
The Themes Window reuses the download object for getting preview images. Since the object is reused it isn't necessary to set the cache path on each network request. Change-Id: Ibc531e09ad19ede3cab7326d9230bd5188710d98
-rw-r--r--rbutil/rbutilqt/themesinstallwindow.cpp31
1 files changed, 15 insertions, 16 deletions
diff --git a/rbutil/rbutilqt/themesinstallwindow.cpp b/rbutil/rbutilqt/themesinstallwindow.cpp
index e254865b25..9f60dfd212 100644
--- a/rbutil/rbutilqt/themesinstallwindow.cpp
+++ b/rbutil/rbutilqt/themesinstallwindow.cpp
@@ -47,12 +47,25 @@ ThemesInstallWindow::ThemesInstallWindow(QWidget *parent) : QDialog(parent)
connect(ui.listThemes, SIGNAL(itemSelectionChanged()), this, SLOT(updateSize()));
connect(&igetter, SIGNAL(done(bool)), this, SLOT(updateImage(bool)));
+ if(!RbSettings::value(RbSettings::CacheDisabled).toBool())
+ igetter.setCache(true);
+ else
+ {
+ if(infocachedir.isEmpty())
+ {
+ infocachedir = QDir::tempPath() + "rbutil-themeinfo";
+ QDir d = QDir::temp();
+ d.mkdir("rbutil-themeinfo");
+ }
+ igetter.setCache(infocachedir);
+ }
+
logger = NULL;
}
ThemesInstallWindow::~ThemesInstallWindow()
{
- if(infocachedir!="")
+ if(!infocachedir.isEmpty())
Utils::recursiveRmdir(infocachedir);
}
@@ -75,7 +88,7 @@ void ThemesInstallWindow::downloadInfo()
infoUrl.replace("%RELEASE%", installInfo.release());
infoUrl.replace("%RBUTILVER%", VERSION);
QUrl url = QUrl(infoUrl);
- qDebug() << "[Themes] Info URL:" << url << "Query:" << url.queryItems();
+ qDebug() << "[Themes] Info URL:" << url;
getter->setFile(&themesInfo);
connect(getter, SIGNAL(done(bool)), this, SLOT(downloadDone(bool)));
@@ -219,21 +232,7 @@ void ThemesInstallWindow::updateDetails(QListWidgetItem* cur, QListWidgetItem* p
text.replace("\n", "<br/>");
ui.themeDescription->setHtml(text);
iniDetails.endGroup();
-
igetter.abort();
- if(!RbSettings::value(RbSettings::CacheDisabled).toBool())
- igetter.setCache(true);
- else
- {
- if(infocachedir=="")
- {
- infocachedir = QDir::tempPath() + "rbutil-themeinfo";
- QDir d = QDir::temp();
- d.mkdir("rbutil-themeinfo");
- }
- igetter.setCache(infocachedir);
- }
-
igetter.getFile(img);
}