aboutsummaryrefslogtreecommitdiffstats
path: root/utils/alsoft-config/mainwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'utils/alsoft-config/mainwindow.cpp')
-rw-r--r--utils/alsoft-config/mainwindow.cpp17
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())
{