mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-18 22:47:21 -06:00
BUGFIX: Improved "Set Location" and "Change save path" dialogs
This commit is contained in:
@@ -3,6 +3,7 @@
|
|||||||
- BUGFIX: Fix encoding problem in file renaming
|
- BUGFIX: Fix encoding problem in file renaming
|
||||||
- BUGFIX: Delete uneeded files on torrent "soft" deletion
|
- BUGFIX: Delete uneeded files on torrent "soft" deletion
|
||||||
- BUGFIX: Fix issues when marking a file as 'not downloaded' causes the torrent to complete
|
- BUGFIX: Fix issues when marking a file as 'not downloaded' causes the torrent to complete
|
||||||
|
- BUGFIX: Improved "Set Location" and "Change save path" dialogs
|
||||||
|
|
||||||
* Sun Oct 17 2010 - Christophe Dumez <chris@qbittorrent.org> - v2.4.6
|
* Sun Oct 17 2010 - Christophe Dumez <chris@qbittorrent.org> - v2.4.6
|
||||||
- BUGFIX: Fix "torrent seeding after creation" feature
|
- BUGFIX: Fix "torrent seeding after creation" feature
|
||||||
|
|||||||
@@ -776,12 +776,16 @@ void PropertiesWidget::renameSelectedFile() {
|
|||||||
if(h.has_metadata() && h.num_files() == 1) {
|
if(h.has_metadata() && h.num_files() == 1) {
|
||||||
new_path = QFileDialog::getSaveFileName(this, tr("Choose save path"), h.firstFileSavePath());
|
new_path = QFileDialog::getSaveFileName(this, tr("Choose save path"), h.firstFileSavePath());
|
||||||
} else {
|
} else {
|
||||||
const QDir saveDir(h.save_path());
|
const QDir saveDir(TorrentPersistentData::getSavePath(h.hash()));
|
||||||
if(saveDir.exists()){
|
QFileDialog dlg(this, tr("Choose save path"), saveDir.absolutePath());
|
||||||
new_path = QFileDialog::getExistingDirectory(this, tr("Choose save path"), h.save_path());
|
dlg.setConfirmOverwrite(false);
|
||||||
}else{
|
dlg.setFileMode(QFileDialog::Directory);
|
||||||
new_path = QFileDialog::getExistingDirectory(this, tr("Choose save path"), QDir::homePath());
|
dlg.setOption(QFileDialog::ShowDirsOnly, true);
|
||||||
}
|
dlg.setFilter(QDir::AllDirs);
|
||||||
|
dlg.setAcceptMode(QFileDialog::AcceptSave);
|
||||||
|
dlg.setNameFilterDetailsVisible(false);
|
||||||
|
if(dlg.exec())
|
||||||
|
new_path = dlg.selectedFiles().first();
|
||||||
}
|
}
|
||||||
if(!new_path.isEmpty()){
|
if(!new_path.isEmpty()){
|
||||||
// Check if savePath exists
|
// Check if savePath exists
|
||||||
@@ -793,15 +797,11 @@ void PropertiesWidget::renameSelectedFile() {
|
|||||||
save_path_dir = parts.join("/");
|
save_path_dir = parts.join("/");
|
||||||
}
|
}
|
||||||
QDir savePath(misc::expandPath(save_path_dir));
|
QDir savePath(misc::expandPath(save_path_dir));
|
||||||
if(!savePath.exists()){
|
|
||||||
if(!savePath.mkpath(savePath.absolutePath())){
|
|
||||||
QMessageBox::critical(0, tr("Save path creation error"), tr("Could not create the save path"));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Actually move storage
|
// Actually move storage
|
||||||
if(!BTSession->useTemporaryFolder() || h.is_seed())
|
if(!BTSession->useTemporaryFolder() || h.is_seed()) {
|
||||||
|
if(!savePath.exists()) savePath.mkpath(savePath.absolutePath());
|
||||||
h.move_storage(savePath.absolutePath());
|
h.move_storage(savePath.absolutePath());
|
||||||
|
}
|
||||||
// Update save_path in dialog
|
// Update save_path in dialog
|
||||||
QString display_path;
|
QString display_path;
|
||||||
if(h.has_metadata() && h.num_files() == 1) {
|
if(h.has_metadata() && h.num_files() == 1) {
|
||||||
|
|||||||
@@ -650,25 +650,26 @@ void TransferListWidget::setSelectedTorrentsLocation() {
|
|||||||
if(hashes.isEmpty()) return;
|
if(hashes.isEmpty()) return;
|
||||||
QString dir;
|
QString dir;
|
||||||
const QDir saveDir(TorrentPersistentData::getSavePath(hashes.first()));
|
const QDir saveDir(TorrentPersistentData::getSavePath(hashes.first()));
|
||||||
qDebug("Torrent save path is %s", qPrintable(saveDir.absolutePath()));
|
qDebug("Old save path is %s", qPrintable(saveDir.absolutePath()));
|
||||||
if(saveDir.exists()){
|
QFileDialog dlg(this, tr("Choose save path"), saveDir.absolutePath());
|
||||||
dir = QFileDialog::getExistingDirectory(this, tr("Choose save path"), saveDir.path());
|
dlg.setConfirmOverwrite(false);
|
||||||
}else{
|
dlg.setFileMode(QFileDialog::Directory);
|
||||||
dir = QFileDialog::getExistingDirectory(this, tr("Choose save path"), QDir::homePath());
|
dlg.setOption(QFileDialog::ShowDirsOnly, true);
|
||||||
}
|
dlg.setFilter(QDir::AllDirs);
|
||||||
|
dlg.setAcceptMode(QFileDialog::AcceptSave);
|
||||||
|
dlg.setNameFilterDetailsVisible(false);
|
||||||
|
if(dlg.exec())
|
||||||
|
dir = dlg.selectedFiles().first();
|
||||||
if(!dir.isNull()) {
|
if(!dir.isNull()) {
|
||||||
|
qDebug("New path is %s", qPrintable(dir));
|
||||||
// Check if savePath exists
|
// Check if savePath exists
|
||||||
QDir savePath(misc::expandPath(dir));
|
QDir savePath(misc::expandPath(dir));
|
||||||
if(!savePath.exists()){
|
qDebug("New path after clean up is %s", qPrintable(savePath.absolutePath()));
|
||||||
if(!savePath.mkpath(savePath.absolutePath())){
|
|
||||||
QMessageBox::critical(0, tr("Save path creation error"), tr("Could not create the save path"));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
foreach(const QString & hash, hashes) {
|
foreach(const QString & hash, hashes) {
|
||||||
// Actually move storage
|
// Actually move storage
|
||||||
QTorrentHandle h = BTSession->getTorrentHandle(hash);
|
QTorrentHandle h = BTSession->getTorrentHandle(hash);
|
||||||
if(!BTSession->useTemporaryFolder() || h.is_seed()) {
|
if(!BTSession->useTemporaryFolder() || h.is_seed()) {
|
||||||
|
if(!savePath.exists()) savePath.mkpath(savePath.absolutePath());
|
||||||
h.move_storage(savePath.absolutePath());
|
h.move_storage(savePath.absolutePath());
|
||||||
} else {
|
} else {
|
||||||
TorrentPersistentData::saveSavePath(h.hash(), savePath.absolutePath());
|
TorrentPersistentData::saveSavePath(h.hash(), savePath.absolutePath());
|
||||||
|
|||||||
Reference in New Issue
Block a user