mirror of
https://github.com/f4exb/sdrangel.git
synced 2025-05-24 03:02:29 -04:00
Automatically add .prex suffix to saved preset file if not specified in the file dialog
This commit is contained in:
parent
a81c7e6e5b
commit
bb9900e699
@ -20,6 +20,7 @@
|
|||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
#include <QComboBox>
|
#include <QComboBox>
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
|
#include <QFileInfo>
|
||||||
#include <QFileDialog>
|
#include <QFileDialog>
|
||||||
#include <QTextStream>
|
#include <QTextStream>
|
||||||
|
|
||||||
@ -547,6 +548,12 @@ void MainWindow::on_presetExport_clicked()
|
|||||||
|
|
||||||
if (fileName != "")
|
if (fileName != "")
|
||||||
{
|
{
|
||||||
|
QFileInfo fileInfo(fileName);
|
||||||
|
|
||||||
|
if (fileInfo.suffix() != "prex") {
|
||||||
|
fileName += ".prex";
|
||||||
|
}
|
||||||
|
|
||||||
QFile exportFile(fileName);
|
QFile exportFile(fileName);
|
||||||
|
|
||||||
if (exportFile.open(QIODevice::WriteOnly | QIODevice::Text))
|
if (exportFile.open(QIODevice::WriteOnly | QIODevice::Text))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user