diff options
author | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2009-03-22 08:33:39 +0000 |
---|---|---|
committer | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2009-03-22 08:33:39 +0000 |
commit | b9e07aded2357dbfca3e83ce5e86881135e454d0 (patch) | |
tree | d69b95a58c67d566a4e30e69a14c3c12d7dc3107 /rbutil/rbutilqt | |
parent | e48cece75cc0ab3b0ebe970cb5603f8452931bd2 (diff) | |
download | rockbox-b9e07aded2357dbfca3e83ce5e86881135e454d0.tar.gz rockbox-b9e07aded2357dbfca3e83ce5e86881135e454d0.zip |
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
Diffstat (limited to 'rbutil/rbutilqt')
-rw-r--r-- | rbutil/rbutilqt/installthemes.cpp | 35 | ||||
-rw-r--r-- | 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) | |||
35 | 35 | ||
36 | connect(ui.buttonCancel, SIGNAL(clicked()), this, SLOT(close())); | 36 | connect(ui.buttonCancel, SIGNAL(clicked()), this, SLOT(close())); |
37 | connect(ui.buttonOk, SIGNAL(clicked()), this, SLOT(accept())); | 37 | connect(ui.buttonOk, SIGNAL(clicked()), this, SLOT(accept())); |
38 | connect(ui.listThemes, SIGNAL(currentRowChanged(int)), | ||
39 | this, SLOT(updateDetails(int))); | ||
40 | connect(&igetter, SIGNAL(done(bool)), this, SLOT(updateImage(bool))); | ||
38 | } | 41 | } |
39 | 42 | ||
40 | ThemesInstallWindow::~ThemesInstallWindow() | 43 | ThemesInstallWindow::~ThemesInstallWindow() |
@@ -43,11 +46,6 @@ ThemesInstallWindow::~ThemesInstallWindow() | |||
43 | recRmdir(infocachedir); | 46 | recRmdir(infocachedir); |
44 | } | 47 | } |
45 | 48 | ||
46 | QString ThemesInstallWindow::resolution() | ||
47 | { | ||
48 | return settings->curResolution(); | ||
49 | } | ||
50 | |||
51 | 49 | ||
52 | void ThemesInstallWindow::downloadInfo() | 50 | void ThemesInstallWindow::downloadInfo() |
53 | { | 51 | { |
@@ -60,13 +58,14 @@ void ThemesInstallWindow::downloadInfo() | |||
60 | themesInfo.close(); | 58 | themesInfo.close(); |
61 | 59 | ||
62 | QUrl url; | 60 | QUrl url; |
63 | url = QUrl(settings->themeUrl() + "/rbutilqt.php?res=" + resolution()); | 61 | url = QUrl(settings->themeUrl() + "/rbutilqt.php?res=" |
62 | + settings->curResolution()); | ||
64 | qDebug() << "downloadInfo()" << url; | 63 | qDebug() << "downloadInfo()" << url; |
65 | qDebug() << url.queryItems(); | 64 | qDebug() << url.queryItems(); |
66 | if(settings->cacheOffline()) | 65 | if(settings->cacheOffline()) |
67 | getter->setCache(true); | 66 | getter->setCache(true); |
68 | getter->setFile(&themesInfo); | 67 | getter->setFile(&themesInfo); |
69 | 68 | ||
70 | connect(getter, SIGNAL(done(bool)), this, SLOT(downloadDone(bool))); | 69 | connect(getter, SIGNAL(done(bool)), this, SLOT(downloadDone(bool))); |
71 | connect(logger, SIGNAL(aborted()), getter, SLOT(abort())); | 70 | connect(logger, SIGNAL(aborted()), getter, SLOT(abort())); |
72 | getter->getFile(url); | 71 | getter->getFile(url); |
@@ -129,7 +128,6 @@ void ThemesInstallWindow::downloadDone(bool error) | |||
129 | 128 | ||
130 | iniDetails.endGroup(); | 129 | iniDetails.endGroup(); |
131 | } | 130 | } |
132 | connect(ui.listThemes, SIGNAL(currentRowChanged(int)), this, SLOT(updateDetails(int))); | ||
133 | } | 131 | } |
134 | 132 | ||
135 | 133 | ||
@@ -164,9 +162,12 @@ void ThemesInstallWindow::updateDetails(int row) | |||
164 | qDebug() << "img:" << img; | 162 | qDebug() << "img:" << img; |
165 | 163 | ||
166 | QString text; | 164 | QString text; |
167 | text = tr("<b>Author:</b> %1<hr/>").arg(iniDetails.value("author", tr("unknown")).toString()); | 165 | text = tr("<b>Author:</b> %1<hr/>").arg(iniDetails.value("author", |
168 | text += tr("<b>Version:</b> %1<hr/>").arg(iniDetails.value("version", tr("unknown")).toString()); | 166 | tr("unknown")).toString()); |
169 | text += tr("<b>Description:</b> %1<hr/>").arg(iniDetails.value("about", tr("no description")).toString()); | 167 | text += tr("<b>Version:</b> %1<hr/>").arg(iniDetails.value("version", |
168 | tr("unknown")).toString()); | ||
169 | text += tr("<b>Description:</b> %1<hr/>").arg(iniDetails.value("about", | ||
170 | tr("no description")).toString()); | ||
170 | 171 | ||
171 | ui.themeDescription->setHtml(text); | 172 | ui.themeDescription->setHtml(text); |
172 | iniDetails.endGroup(); | 173 | iniDetails.endGroup(); |
@@ -184,7 +185,7 @@ void ThemesInstallWindow::updateDetails(int row) | |||
184 | } | 185 | } |
185 | igetter.setCache(infocachedir); | 186 | igetter.setCache(infocachedir); |
186 | } | 187 | } |
187 | connect(&igetter, SIGNAL(done(bool)), this, SLOT(updateImage(bool))); | 188 | |
188 | igetter.getFile(img); | 189 | igetter.getFile(img); |
189 | } | 190 | } |
190 | 191 | ||
@@ -234,8 +235,8 @@ void ThemesInstallWindow::show() | |||
234 | logger = new ProgressLoggerGui(this); | 235 | logger = new ProgressLoggerGui(this); |
235 | logger->show(); | 236 | logger->show(); |
236 | logger->addItem(tr("getting themes information ..."), LOGINFO); | 237 | logger->addItem(tr("getting themes information ..."), LOGINFO); |
237 | 238 | ||
238 | connect(logger, SIGNAL(aborted()), this, SLOT(close())); | 239 | connect(logger, SIGNAL(aborted()), this, SLOT(close())); |
239 | 240 | ||
240 | downloadInfo(); | 241 | downloadInfo(); |
241 | 242 | ||
@@ -293,9 +294,9 @@ void ThemesInstallWindow::accept() | |||
293 | installer->setMountPoint(mountPoint); | 294 | installer->setMountPoint(mountPoint); |
294 | if(!settings->cacheDisabled()) | 295 | if(!settings->cacheDisabled()) |
295 | installer->setCache(true); | 296 | installer->setCache(true); |
296 | 297 | ||
297 | connect(logger, SIGNAL(closed()), this, SLOT(close())); | 298 | connect(logger, SIGNAL(closed()), this, SLOT(close())); |
298 | installer->install(logger); | 299 | installer->install(logger); |
299 | 300 | ||
300 | } | 301 | } |
301 | 302 | ||
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 | |||
51 | HttpGet *getter; | 51 | HttpGet *getter; |
52 | HttpGet igetter; | 52 | HttpGet igetter; |
53 | QTemporaryFile themesInfo; | 53 | QTemporaryFile themesInfo; |
54 | QString resolution(void); | ||
55 | int currentItem; | 54 | int currentItem; |
56 | void resizeEvent(QResizeEvent*); | 55 | void resizeEvent(QResizeEvent*); |
57 | QByteArray imgData; | 56 | QByteArray imgData; |