From 8b5d388e7743295fb99e93386df9007aaa595fd4 Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Tue, 22 Dec 2009 19:17:27 +0000 Subject: [PATCH] - Use the save path set in program preferences as a default in torrent addition dialog --- src/torrentadditiondlg.h | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/torrentadditiondlg.h b/src/torrentadditiondlg.h index 8d3dfa044..e70985cca 100644 --- a/src/torrentadditiondlg.h +++ b/src/torrentadditiondlg.h @@ -50,6 +50,7 @@ #include "ui_torrentadditiondlg.h" #include "torrentpersistentdata.h" #include "torrentfilesmodel.h" +#include "preferences.h" using namespace libtorrent; @@ -84,13 +85,8 @@ public: // Remember columns width readSettings(); //torrentContentList->header()->setResizeMode(0, QHeaderView::Stretch); - QString home = QDir::homePath(); - if(home[home.length()-1] != QDir::separator()){ - home += QDir::separator(); - } - QSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent")); - savePathTxt->setText(settings.value(QString::fromUtf8("LastDirTorrentAdd"), home+QString::fromUtf8("qBT_dir")).toString()); - if(settings.value("Preferences/Downloads/StartInPause", false).toBool()) { + savePathTxt->setText(Preferences::getSavePath()); + if(Preferences::addTorrentsInPause()) { addInPause->setChecked(true); addInPause->setEnabled(false); } @@ -278,9 +274,6 @@ public slots: TorrentTempData::setSavePath(hash, savePath.path()); qDebug("Torrent label is: %s", comboLabel->currentText().trimmed().toLocal8Bit().data()); TorrentTempData::setLabel(hash, comboLabel->currentText().trimmed()); - // Save last dir to remember it - QSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent")); - settings.setValue(QString::fromUtf8("LastDirTorrentAdd"), savePathTxt->text()); // Create .incremental file if necessary TorrentTempData::setSequential(hash, checkIncrementalDL->isChecked()); #ifdef LIBTORRENT_0_15