From a42d4afeb73558facfecdbee391a00f10c70078d Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Thu, 27 Jan 2011 17:33:19 +0000 Subject: [PATCH] Use native file dialogs --- Changelog | 1 + src/properties/propertieswidget.cpp | 11 ++--------- src/transferlistwidget.cpp | 11 ++--------- 3 files changed, 5 insertions(+), 18 deletions(-) diff --git a/Changelog b/Changelog index 127eb2f5a..f06d2b531 100644 --- a/Changelog +++ b/Changelog @@ -1,6 +1,7 @@ * Unreleased - Christophe Dumez - v2.6.5 - BUGFIX: Make sure the progress is not 100% unless the file is complete - BUGFIX: Fix memory leak in HTTP torrent downloader + - BUGFIX: Use native file dialogs (by Vladimir Golovnev) - BUGFIX: Performance improvement on ARM * Sun Jan 23 2011 - Christophe Dumez - v2.6.4 diff --git a/src/properties/propertieswidget.cpp b/src/properties/propertieswidget.cpp index e1552c7a2..eac3f2f02 100644 --- a/src/properties/propertieswidget.cpp +++ b/src/properties/propertieswidget.cpp @@ -702,15 +702,8 @@ void PropertiesWidget::on_changeSavePathButton_clicked() { new_path = QFileDialog::getSaveFileName(this, tr("Choose save path"), h.firstFileSavePath()); } else { const QDir saveDir(TorrentPersistentData::getSavePath(h.hash())); - QFileDialog dlg(this, tr("Choose save path"), saveDir.absolutePath()); - dlg.setConfirmOverwrite(false); - dlg.setFileMode(QFileDialog::Directory); - dlg.setOption(QFileDialog::ShowDirsOnly, true); - dlg.setFilter(QDir::AllDirs); - dlg.setAcceptMode(QFileDialog::AcceptSave); - dlg.setNameFilterDetailsVisible(false); - if(dlg.exec()) - new_path = dlg.selectedFiles().first(); + new_path = QFileDialog::getExistingDirectory(this, tr("Choose save path"), saveDir.absolutePath(), + QFileDialog::DontConfirmOverwrite|QFileDialog::ShowDirsOnly|QFileDialog::HideNameFilterDetails); } if(!new_path.isEmpty()){ // Check if savePath exists diff --git a/src/transferlistwidget.cpp b/src/transferlistwidget.cpp index 7f632816f..91993c506 100644 --- a/src/transferlistwidget.cpp +++ b/src/transferlistwidget.cpp @@ -218,15 +218,8 @@ void TransferListWidget::setSelectedTorrentsLocation() { QString dir; const QDir saveDir(TorrentPersistentData::getSavePath(hashes.first())); qDebug("Old save path is %s", qPrintable(saveDir.absolutePath())); - QFileDialog dlg(this, tr("Choose save path"), saveDir.absolutePath()); - dlg.setConfirmOverwrite(false); - dlg.setFileMode(QFileDialog::Directory); - dlg.setOption(QFileDialog::ShowDirsOnly, true); - dlg.setFilter(QDir::AllDirs); - dlg.setAcceptMode(QFileDialog::AcceptSave); - dlg.setNameFilterDetailsVisible(false); - if(dlg.exec()) - dir = dlg.selectedFiles().first(); + dir = QFileDialog::getExistingDirectory(this, tr("Choose save path"), saveDir.absolutePath(), + QFileDialog::DontConfirmOverwrite|QFileDialog::ShowDirsOnly|QFileDialog::HideNameFilterDetails); if(!dir.isNull()) { qDebug("New path is %s", qPrintable(dir)); // Check if savePath exists