diff options
author | Jan Dalheimer <jan@dalheimer.de> | 2014-02-16 12:06:14 +0100 |
---|---|---|
committer | Jan Dalheimer <jan@dalheimer.de> | 2014-02-16 12:06:14 +0100 |
commit | f5273ae2b1195bdbf433fbb0cf4ca47bd4c0e6b3 (patch) | |
tree | 4cd8d38411c8ebaa325a4c3074a401322f0e7145 | |
parent | c608841f770729a22e38cb4df8c3555062ac04dc (diff) | |
parent | 1dc34269bde4611d1a1c76f01df6dacd85f79c07 (diff) | |
download | MultiMC-f5273ae2b1195bdbf433fbb0cf4ca47bd4c0e6b3.tar MultiMC-f5273ae2b1195bdbf433fbb0cf4ca47bd4c0e6b3.tar.gz MultiMC-f5273ae2b1195bdbf433fbb0cf4ca47bd4c0e6b3.tar.lz MultiMC-f5273ae2b1195bdbf433fbb0cf4ca47bd4c0e6b3.tar.xz MultiMC-f5273ae2b1195bdbf433fbb0cf4ca47bd4c0e6b3.zip |
Merge remote-tracking branch 'origin/feature_profiling' into feature_profiling
-rw-r--r-- | gui/dialogs/SettingsDialog.cpp | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/gui/dialogs/SettingsDialog.cpp b/gui/dialogs/SettingsDialog.cpp index 9423d7eb..d20c0aa7 100644 --- a/gui/dialogs/SettingsDialog.cpp +++ b/gui/dialogs/SettingsDialog.cpp @@ -527,6 +527,10 @@ void SettingsDialog::on_jprofilerPathBtn_clicked() { ui->jprofilerPathEdit->setText(cooked_dir); } + else + { + // FIXME: see below... + } } void SettingsDialog::on_jprofilerCheckBtn_clicked() { @@ -546,12 +550,18 @@ void SettingsDialog::on_jvisualvmPathBtn_clicked() { QString raw_dir = QFileDialog::getOpenFileName(this, tr("JVisualVM Executable"), ui->jvisualvmPathEdit->text()); - QString cooked_dir = NormalizePath(raw_dir); + QString cooked_path = NormalizePath(raw_dir); + QFileInfo finfo(cooked_path); // do not allow current dir - it's dirty. Do not allow dirs that don't exist - if (!cooked_dir.isEmpty() && QDir(cooked_dir).exists()) + if (!cooked_path.isEmpty() && finfo.isExecutable() && finfo.isFile()) { - ui->jvisualvmPathEdit->setText(cooked_dir); + ui->jvisualvmPathEdit->setText(cooked_path); + } + else + { + // FIXME: report error here, or run the checker instead of that condition above. + // ideally unify all the sanity checks and put them into the relevant classes } } void SettingsDialog::on_jvisualvmCheckBtn_clicked() @@ -570,8 +580,8 @@ void SettingsDialog::on_jvisualvmCheckBtn_clicked() void SettingsDialog::on_mceditPathBtn_clicked() { - QString raw_dir = QFileDialog::getOpenFileName(this, tr("MCEdit Path"), - ui->jvisualvmPathEdit->text()); + QString raw_dir = QFileDialog::getExistingDirectory(this, tr("MCEdit Path"), + ui->mceditPathEdit->text()); QString cooked_dir = NormalizePath(raw_dir); // do not allow current dir - it's dirty. Do not allow dirs that don't exist @@ -579,6 +589,9 @@ void SettingsDialog::on_mceditPathBtn_clicked() { ui->mceditPathEdit->setText(cooked_dir); } + { + // FIXME: as above. + } } void SettingsDialog::on_mceditCheckBtn_clicked() { |