summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--facetracknoir/new_file_dialog.h2
-rw-r--r--facetracknoir/ui.cpp5
2 files changed, 3 insertions, 4 deletions
diff --git a/facetracknoir/new_file_dialog.h b/facetracknoir/new_file_dialog.h
index dc821592..d72b8741 100644
--- a/facetracknoir/new_file_dialog.h
+++ b/facetracknoir/new_file_dialog.h
@@ -34,6 +34,8 @@ private slots:
QString text = ui.lineEdit->text();
text = text.replace('/', "");
text = text.replace('\\', "");
+ if (text != "" && !text.endsWith(".ini"))
+ text += ".ini";
if (text == "" || QFile(options::group::ini_directory() + "/" + text).exists())
{
QMessageBox::warning(this,
diff --git a/facetracknoir/ui.cpp b/facetracknoir/ui.cpp
index a204f36d..e22fee7a 100644
--- a/facetracknoir/ui.cpp
+++ b/facetracknoir/ui.cpp
@@ -109,10 +109,7 @@ bool MainWindow::get_new_config_name_from_dialog(QString& ret)
{
new_file_dialog dlg;
dlg.exec();
- bool b = dlg.is_ok(ret);
- if (b && !ret.endsWith(".ini"))
- ret += ".ini";
- return b;
+ return dlg.is_ok(ret);
}
MainWindow::~MainWindow()