Merge pull request #254 from sledgehammer999/fix_default_path

Fix behaviour of the torrent addition dialog. The 'set as default path' ...
This commit is contained in:
Christophe Dumez 2012-12-01 07:51:20 -08:00
commit 177e6738e4
3 changed files with 19 additions and 8 deletions

View file

@ -1773,9 +1773,17 @@ void QBtSession::addTorrentsFromScanFolder(QStringList &pathList) {
}
}
void QBtSession::setDefaultTempPath(QString temppath) {
if (defaultTempPath == temppath)
void QBtSession::setDefaultSavePath(const QString &savepath) {
if (savepath.isEmpty())
return;
defaultSavePath = QDir::fromNativeSeparators(savepath);
}
void QBtSession::setDefaultTempPath(const QString &temppath) {
if (QDir(defaultTempPath) == QDir(temppath))
return;
if (temppath.isEmpty()) {
// Disabling temp dir
// Moving all torrents to their destination folder
@ -1799,13 +1807,13 @@ void QBtSession::setDefaultTempPath(QString temppath) {
QTorrentHandle h = QTorrentHandle(*torrentIT);
if (!h.is_valid()) continue;
if (!h.is_seed()) {
QString torrent_tmp_path = temppath.replace("\\", "/");
qDebug("Moving torrent to its temp save path: %s", qPrintable(torrent_tmp_path));
QString torrent_tmp_path = QDir::fromNativeSeparators(temppath);
qDebug("Moving torrent to its temp save path: %s", qPrintable(fsutils::toDisplayPath(torrent_tmp_path)));
h.move_storage(torrent_tmp_path);
}
}
}
defaultTempPath = temppath;
defaultTempPath = QDir::fromNativeSeparators(temppath);
}
void QBtSession::appendqBextensionToTorrent(const QTorrentHandle &h, bool append) {