From 15c7099e8572d2c70a53279b8a0ed57281a9e4e0 Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Sat, 19 Dec 2009 20:39:38 +0000 Subject: [PATCH] - Fix "Browse" button in program preferences for "Temp path" --- src/options_imp.cpp | 19 ++++++++++++++----- src/options_imp.h | 1 + 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/src/options_imp.cpp b/src/options_imp.cpp index 87d06dd95..6826af6a6 100644 --- a/src/options_imp.cpp +++ b/src/options_imp.cpp @@ -1355,16 +1355,25 @@ void options_imp::on_browseFilterButton_clicked() { // Display dialog to choose save dir void options_imp::on_browseSaveDirButton_clicked(){ -#ifdef Q_WS_WIN - QString dir = QFileDialog::getExistingDirectory(this, tr("Choose a save directory"), QDir::rootPath()); -#else - QString dir = QFileDialog::getExistingDirectory(this, tr("Choose a save directory"), QDir::homePath()); -#endif + QString def_path = QDir::homePath(); + if(!textSavePath->text().isEmpty()) + def_path = textSavePath->text(); + QString dir = QFileDialog::getExistingDirectory(this, tr("Choose a save directory"), def_path); if(!dir.isNull()){ textSavePath->setText(dir); } } +void options_imp::on_browseTempDirButton_clicked(){ + QString def_path = QDir::homePath(); + if(!textTempPath->text().isEmpty()) + def_path = textTempPath->text(); + QString dir = QFileDialog::getExistingDirectory(this, tr("Choose a save directory"), def_path); + if(!dir.isNull()){ + textTempPath->setText(dir); + } +} + // Return Filter object to apply to BT session QString options_imp::getFilter() const{ return textFilterPath->text(); diff --git a/src/options_imp.h b/src/options_imp.h index 1ae1c828f..acda46721 100644 --- a/src/options_imp.h +++ b/src/options_imp.h @@ -162,6 +162,7 @@ protected slots: void on_browseScanDirButton_clicked(); void on_browseFilterButton_clicked(); void on_browseSaveDirButton_clicked(); + void on_browseTempDirButton_clicked(); void enableApplyButton(); void enableSystrayOptions(); void disableSystrayOptions();