From bb9900e699ba27d2f5fa8cf9b35d6de58c462bc3 Mon Sep 17 00:00:00 2001 From: f4exb Date: Tue, 29 Mar 2016 11:04:08 +0200 Subject: [PATCH] Automatically add .prex suffix to saved preset file if not specified in the file dialog --- sdrbase/mainwindow.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sdrbase/mainwindow.cpp b/sdrbase/mainwindow.cpp index 659d292f4..481c61cd2 100644 --- a/sdrbase/mainwindow.cpp +++ b/sdrbase/mainwindow.cpp @@ -20,6 +20,7 @@ #include #include #include +#include #include #include @@ -547,6 +548,12 @@ void MainWindow::on_presetExport_clicked() if (fileName != "") { + QFileInfo fileInfo(fileName); + + if (fileInfo.suffix() != "prex") { + fileName += ".prex"; + } + QFile exportFile(fileName); if (exportFile.open(QIODevice::WriteOnly | QIODevice::Text))