mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-20 07:27:22 -06:00
- Fix renaming of folders in a torrent (could rename children sometimes)
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
* Unreleased - Christophe Dumez <chris@qbittorrent.org> - v2.1.1
|
* Unreleased - Christophe Dumez <chris@qbittorrent.org> - v2.1.1
|
||||||
- BUGFIX: Fix compilation with Qt4.4
|
- BUGFIX: Fix compilation with Qt4.4
|
||||||
- BUGFIX: Save torrent metadata so that it does not have to be re-downloaded on restart (Magnet links)
|
- BUGFIX: Save torrent metadata so that it does not have to be re-downloaded on restart (Magnet links)
|
||||||
|
- BUGFIX: Fix folder renaming in a torrent (would rename children under certain conditions)
|
||||||
|
|
||||||
* Mon Jan 18 2010 - Christophe Dumez <chris@qbittorrent.org> - v2.1.0
|
* Mon Jan 18 2010 - Christophe Dumez <chris@qbittorrent.org> - v2.1.0
|
||||||
- FEATURE: Graphical User Interface can be disabled at compilation time (headless running)
|
- FEATURE: Graphical User Interface can be disabled at compilation time (headless running)
|
||||||
|
|||||||
@@ -409,7 +409,7 @@ QPushButton* PropertiesWidget::getButtonFromIndex(int index) {
|
|||||||
return url_seeds_button;
|
return url_seeds_button;
|
||||||
case FILES_TAB:
|
case FILES_TAB:
|
||||||
return files_button;
|
return files_button;
|
||||||
default:
|
default:
|
||||||
return main_infos_button;
|
return main_infos_button;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -613,9 +613,12 @@ void PropertiesWidget::renameSelectedFile() {
|
|||||||
// Replace path in all files
|
// Replace path in all files
|
||||||
for(int i=0; i<num_files; ++i) {
|
for(int i=0; i<num_files; ++i) {
|
||||||
QString current_name = misc::toQString(h.get_torrent_info().file_at(i).path.string());
|
QString current_name = misc::toQString(h.get_torrent_info().file_at(i).path.string());
|
||||||
QString new_name = current_name.replace(old_path, new_path);
|
if(current_name.startsWith(old_path)) {
|
||||||
qDebug("Rename %s to %s", current_name.toLocal8Bit().data(), new_name.toLocal8Bit().data());
|
QString new_name = current_name;
|
||||||
h.rename_file(i, new_name);
|
new_name.replace(0, old_path.length(), new_path);
|
||||||
|
qDebug("Rename %s to %s", current_name.toLocal8Bit().data(), new_name.toLocal8Bit().data());
|
||||||
|
h.rename_file(i, new_name);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// Rename folder in torrent files model too
|
// Rename folder in torrent files model too
|
||||||
PropListModel->setData(index, new_name_last);
|
PropListModel->setData(index, new_name_last);
|
||||||
|
|||||||
@@ -350,10 +350,13 @@ public slots:
|
|||||||
// Replace path in all files
|
// Replace path in all files
|
||||||
for(uint i=0; i<nbFiles; ++i) {
|
for(uint i=0; i<nbFiles; ++i) {
|
||||||
QString current_name = files_path.at(i);
|
QString current_name = files_path.at(i);
|
||||||
QString new_name = current_name.replace(old_path, new_path);
|
if(current_name.startsWith(old_path)) {
|
||||||
qDebug("Rename %s to %s", current_name.toLocal8Bit().data(), new_name.toLocal8Bit().data());
|
QString new_name = current_name;
|
||||||
// Rename in files_path
|
new_name.replace(0, old_path.length(), new_path);
|
||||||
files_path.replace(i, new_name);
|
qDebug("Rename %s to %s", current_name.toLocal8Bit().data(), new_name.toLocal8Bit().data());
|
||||||
|
// Rename in files_path
|
||||||
|
files_path.replace(i, new_name);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// Rename folder in torrent files model too
|
// Rename folder in torrent files model too
|
||||||
PropListModel->setData(index, new_name_last);
|
PropListModel->setData(index, new_name_last);
|
||||||
|
|||||||
Reference in New Issue
Block a user