From 55732cd61b5d6c85a5e90aee584f12cbca70e116 Mon Sep 17 00:00:00 2001 From: lvaatamoinen Date: Wed, 16 Dec 2009 15:02:44 +0000 Subject: [PATCH] - Fixes: Restoring download rate setting on startup. Rate setting spinbox initial values. git-svn-id: file:///svnroot/qtrapids/trunk@55 42ac0dd5-4c8c-4c71-bb3e-ecdfe252ffda --- src/engine/QBittorrentSession.cpp | 2 +- src/engine/QBittorrentSession.h | 2 +- src/gui/MainWindow.cpp | 2 +- src/gui/PreferencesDialog.cpp | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/engine/QBittorrentSession.cpp b/src/engine/QBittorrentSession.cpp index d7e2349..0f0e67e 100644 --- a/src/engine/QBittorrentSession.cpp +++ b/src/engine/QBittorrentSession.cpp @@ -70,7 +70,7 @@ void QBittorrentSession::setUploadRateLimit(int rate) } -void QBittorrentSession::setDownloadrateLimit(int rate) +void QBittorrentSession::setDownloadRateLimit(int rate) { btSession_.set_download_rate_limit(rate); } diff --git a/src/engine/QBittorrentSession.h b/src/engine/QBittorrentSession.h index badae43..3a86d81 100644 --- a/src/engine/QBittorrentSession.h +++ b/src/engine/QBittorrentSession.h @@ -61,7 +61,7 @@ public: void removeTorrent(qtrapids::QTorrentHandle const& handle); void setUploadRateLimit(int rate); - void setDownloadrateLimit(int rate); + void setDownloadRateLimit(int rate); int getUploadRateLimt() const; int getDownloadRateLimit() const; diff --git a/src/gui/MainWindow.cpp b/src/gui/MainWindow.cpp index 6ab93c6..f154df0 100644 --- a/src/gui/MainWindow.cpp +++ b/src/gui/MainWindow.cpp @@ -272,7 +272,7 @@ void MainWindow::LoadPlugins() void MainWindow::RestoreSettings() { btSession_.setUploadRateLimit(settings_.value("network/uploadRate").toInt()); - btSession_.setUploadRateLimit(settings_.value("network/downloadRate").toInt()); + btSession_.setDownloadRateLimit(settings_.value("network/downloadRate").toInt()); } diff --git a/src/gui/PreferencesDialog.cpp b/src/gui/PreferencesDialog.cpp index 099755d..b401c44 100644 --- a/src/gui/PreferencesDialog.cpp +++ b/src/gui/PreferencesDialog.cpp @@ -166,7 +166,7 @@ void PreferencesDialog::WriteSettings() // If session pointer was given, apply settings immediately. if (btSession_) { btSession_->setUploadRateLimit(ulRate); - btSession_->setDownloadrateLimit(dlRate); + btSession_->setDownloadRateLimit(dlRate); } } @@ -174,8 +174,8 @@ void PreferencesDialog::WriteSettings() void PreferencesDialog::ReadSettings() { dirLineEdit_->insert(settings_.value("download/directory").toString()); - uploadRateSpinBox_->setValue(settings_.value("network/uploadRate").toInt()); - downloadRateSpinBox_->setValue(settings_.value("network/downloadRate").toInt()); + uploadRateSpinBox_->setValue(settings_.value("network/uploadRate").toInt()/1000); + downloadRateSpinBox_->setValue(settings_.value("network/downloadRate").toInt()/1000); // NOTE: We might need to call QSettigns::sync() here to instantly write settings. // settings are written also by QSettings() destructor and by event loop at regular interval. -- 1.7.9.5