From: Jari Jarvi Date: Tue, 6 Jul 2010 10:42:50 +0000 (+0300) Subject: Rating is now updated immediately after pressing rating buttons X-Git-Url: http://vcs.maemo.org/git/?p=irwi;a=commitdiff_plain;h=cde3264e4d1cd75052429a33d93aeb1796f21cd2 Rating is now updated immediately after pressing rating buttons --- diff --git a/src/remote.cpp b/src/remote.cpp index f94dbf0..967a99c 100644 --- a/src/remote.cpp +++ b/src/remote.cpp @@ -110,6 +110,9 @@ void Remote::sendRating(Rating::Rating r) if (!m_name.isEmpty()) { if (!m_ratingNAM) { m_ratingNAM = new QNetworkAccessManager(this); + connect(m_ratingNAM, SIGNAL(finished(QNetworkReply *)), + this, SIGNAL(ratingSent())); + connect(this, SIGNAL(ratingSent()), this, SLOT(updateInfo())); } QSettings settings(this); m_ratingNAM->get(QNetworkRequest(QUrl( diff --git a/src/remote.h b/src/remote.h index 3f21cee..b59a495 100644 --- a/src/remote.h +++ b/src/remote.h @@ -41,6 +41,7 @@ private slots: signals: void infoUpdated(); void saveFinished(); + void ratingSent(); private: QString m_name; diff --git a/src/settingsdlg.cpp b/src/settingsdlg.cpp index 6100100..753edcf 100644 --- a/src/settingsdlg.cpp +++ b/src/settingsdlg.cpp @@ -71,9 +71,9 @@ SettingsDlg::SettingsDlg(QWidget *parent) } else { // Create remote by name and update it's info if online m_remote = Remote(selectedRemote); - m_remoteNameLabel->setText(selectedRemote); connect(&m_remote, SIGNAL(infoUpdated()), - this, SLOT(updateRemoteInfo())); + this, SLOT(updateRemoteInfo())); + m_remoteNameLabel->setText(selectedRemote); m_netConfMan = new QTM_PREPEND_NAMESPACE( QNetworkConfigurationManager)(this); connect(m_netConfMan, SIGNAL(updateCompleted()), @@ -155,21 +155,20 @@ void SettingsDlg::updateRemoteInfo() void SettingsDlg::rateUpClicked() { - m_remote.sendRating(Rating::Up); processRatingSent(); + m_remote.sendRating(Rating::Up); } void SettingsDlg::rateDownClicked() { - m_remote.sendRating(Rating::Down); processRatingSent(); + m_remote.sendRating(Rating::Down); } void SettingsDlg::processRatingSent() { setBusy(); enableRateBtns(false); - m_remote.updateInfo(); } void SettingsDlg::enableRateBtns(bool enable)