From b9e07aded2357dbfca3e83ce5e86881135e454d0 Mon Sep 17 00:00:00 2001 From: Dominik Riebeling Date: Sun, 22 Mar 2009 08:33:39 +0000 Subject: Don't connect updateImage slot during update but statically. Fixes the slot getting an additional coonection upon each image update. Remove an unneeded function. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20445 a1c6a512-1295-4272-9138-f99709370657 --- rbutil/rbutilqt/installthemes.cpp | 35 ++++++++++++++++++----------------- rbutil/rbutilqt/installthemes.h | 1 - 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/rbutil/rbutilqt/installthemes.cpp b/rbutil/rbutilqt/installthemes.cpp index fe225b81b4..6e15ae0b51 100644 --- a/rbutil/rbutilqt/installthemes.cpp +++ b/rbutil/rbutilqt/installthemes.cpp @@ -35,6 +35,9 @@ ThemesInstallWindow::ThemesInstallWindow(QWidget *parent) : QDialog(parent) connect(ui.buttonCancel, SIGNAL(clicked()), this, SLOT(close())); connect(ui.buttonOk, SIGNAL(clicked()), this, SLOT(accept())); + connect(ui.listThemes, SIGNAL(currentRowChanged(int)), + this, SLOT(updateDetails(int))); + connect(&igetter, SIGNAL(done(bool)), this, SLOT(updateImage(bool))); } ThemesInstallWindow::~ThemesInstallWindow() @@ -43,11 +46,6 @@ ThemesInstallWindow::~ThemesInstallWindow() recRmdir(infocachedir); } -QString ThemesInstallWindow::resolution() -{ - return settings->curResolution(); -} - void ThemesInstallWindow::downloadInfo() { @@ -60,13 +58,14 @@ void ThemesInstallWindow::downloadInfo() themesInfo.close(); QUrl url; - url = QUrl(settings->themeUrl() + "/rbutilqt.php?res=" + resolution()); + url = QUrl(settings->themeUrl() + "/rbutilqt.php?res=" + + settings->curResolution()); qDebug() << "downloadInfo()" << url; qDebug() << url.queryItems(); if(settings->cacheOffline()) getter->setCache(true); getter->setFile(&themesInfo); - + connect(getter, SIGNAL(done(bool)), this, SLOT(downloadDone(bool))); connect(logger, SIGNAL(aborted()), getter, SLOT(abort())); getter->getFile(url); @@ -129,7 +128,6 @@ void ThemesInstallWindow::downloadDone(bool error) iniDetails.endGroup(); } - connect(ui.listThemes, SIGNAL(currentRowChanged(int)), this, SLOT(updateDetails(int))); } @@ -164,9 +162,12 @@ void ThemesInstallWindow::updateDetails(int row) qDebug() << "img:" << img; QString text; - text = tr("Author: %1
").arg(iniDetails.value("author", tr("unknown")).toString()); - text += tr("Version: %1
").arg(iniDetails.value("version", tr("unknown")).toString()); - text += tr("Description: %1
").arg(iniDetails.value("about", tr("no description")).toString()); + text = tr("Author: %1
").arg(iniDetails.value("author", + tr("unknown")).toString()); + text += tr("Version: %1
").arg(iniDetails.value("version", + tr("unknown")).toString()); + text += tr("Description: %1
").arg(iniDetails.value("about", + tr("no description")).toString()); ui.themeDescription->setHtml(text); iniDetails.endGroup(); @@ -184,7 +185,7 @@ void ThemesInstallWindow::updateDetails(int row) } igetter.setCache(infocachedir); } - connect(&igetter, SIGNAL(done(bool)), this, SLOT(updateImage(bool))); + igetter.getFile(img); } @@ -234,8 +235,8 @@ void ThemesInstallWindow::show() logger = new ProgressLoggerGui(this); logger->show(); logger->addItem(tr("getting themes information ..."), LOGINFO); - - connect(logger, SIGNAL(aborted()), this, SLOT(close())); + + connect(logger, SIGNAL(aborted()), this, SLOT(close())); downloadInfo(); @@ -293,9 +294,9 @@ void ThemesInstallWindow::accept() installer->setMountPoint(mountPoint); if(!settings->cacheDisabled()) installer->setCache(true); - - connect(logger, SIGNAL(closed()), this, SLOT(close())); + + connect(logger, SIGNAL(closed()), this, SLOT(close())); installer->install(logger); - + } diff --git a/rbutil/rbutilqt/installthemes.h b/rbutil/rbutilqt/installthemes.h index 036647f224..c20c17f738 100644 --- a/rbutil/rbutilqt/installthemes.h +++ b/rbutil/rbutilqt/installthemes.h @@ -51,7 +51,6 @@ class ThemesInstallWindow : public QDialog HttpGet *getter; HttpGet igetter; QTemporaryFile themesInfo; - QString resolution(void); int currentItem; void resizeEvent(QResizeEvent*); QByteArray imgData; -- cgit v1.2.3