diff options
author | Chris Robinson <[email protected]> | 2016-04-23 17:31:34 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2016-04-23 17:31:34 -0700 |
commit | c796f99d3614f023800a5db5d1b031866c7e5b4c (patch) | |
tree | 3233c210b1204d0ba270c51e1206e5eae04b2f72 /utils | |
parent | c2dec5008b02a3d85669036a4096430ce91275f9 (diff) |
Open the file selector to an existing path for presets
Diffstat (limited to 'utils')
-rw-r--r-- | utils/alsoft-config/mainwindow.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/utils/alsoft-config/mainwindow.cpp b/utils/alsoft-config/mainwindow.cpp index 4d286367..8f703f7f 100644 --- a/utils/alsoft-config/mainwindow.cpp +++ b/utils/alsoft-config/mainwindow.cpp @@ -1,6 +1,7 @@ #include "config.h" +#include <iostream> #include <cmath> #include <QFileDialog> @@ -1091,8 +1092,22 @@ void MainWindow::select71DecoderFile() { selectDecoderFile(ui->decoder71LineEdit, "Select 7.1 Surround Decoder");} void MainWindow::selectDecoderFile(QLineEdit *line, const char *caption) { + QString dir = line->text(); + if(dir.isEmpty() || QDir::isRelativePath(dir)) + { + QStringList paths = getAllDataPaths("/openal/presets"); + while(!paths.isEmpty()) + { + if(QDir(paths.last()).exists()) + { + dir = paths.last(); + break; + } + paths.removeLast(); + } + } QString fname = QFileDialog::getOpenFileName(this, tr(caption), - line->text(), tr("AmbDec Files (*.ambdec);;All Files (*.*)") + dir, tr("AmbDec Files (*.ambdec);;All Files (*.*)") ); if(!fname.isEmpty()) { |