From da796c80c3867576ed0cd412766ca5f5ab69eee5 Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Tue, 5 Jan 2010 18:11:52 +0000 Subject: [PATCH] - Forgot to move the torrent data when its label is deleted --- src/bittorrent.cpp | 5 +++-- src/transferlistwidget.cpp | 3 +++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/bittorrent.cpp b/src/bittorrent.cpp index 8bd1ac287..5b7cef414 100644 --- a/src/bittorrent.cpp +++ b/src/bittorrent.cpp @@ -1426,10 +1426,11 @@ void Bittorrent::addConsoleMessage(QString msg, QString) { old_dir = QDir(path_items.join(QDir::separator())); } QString new_save_path; - if(new_label.isEmpty()) + if(new_label.isEmpty()) { new_save_path = old_dir.absolutePath(); - else + } else { new_save_path = old_dir.absoluteFilePath(new_label); + } TorrentPersistentData::saveSavePath(h.hash(), new_save_path); if(move_storage) { // Move storage diff --git a/src/transferlistwidget.cpp b/src/transferlistwidget.cpp index d2bdb761f..016168edc 100644 --- a/src/transferlistwidget.cpp +++ b/src/transferlistwidget.cpp @@ -919,9 +919,12 @@ void TransferListWidget::removeLabelFromRows(QString label) { for(int i=0; irowCount(); ++i) { if(listModel->data(listModel->index(i, TR_LABEL)) == label) { QString hash = getHashFromRow(i); + QString old_label = proxyModel->data(listModel->index(i, TR_LABEL)).toString(); listModel->setData(listModel->index(i, TR_LABEL), "", Qt::DisplayRole); TorrentPersistentData::saveLabel(hash, ""); emit torrentChangedLabel(label, ""); + // Update save path if necessary + BTSession->changeLabelInTorrentSavePath(BTSession->getTorrentHandle(hash), old_label, label); } } }