diff --git a/src/QmlControls/ParameterEditorController.cc b/src/QmlControls/ParameterEditorController.cc index 2f980a227f11353752ad9b97b9afff3deb6cbd85..f3fb52439170f66f69f0b3f78f85a11d4e178e89 100644 --- a/src/QmlControls/ParameterEditorController.cc +++ b/src/QmlControls/ParameterEditorController.cc @@ -98,10 +98,15 @@ void ParameterEditorController::clearRCToParam(void) void ParameterEditorController::saveToFile(const QString& filename) { if (!filename.isEmpty()) { - QFile file(filename); + QString parameterFilename = filename; + if (!QFileInfo(filename).fileName().contains(".")) { + parameterFilename += QString(".%1").arg(AppSettings::parameterFileExtension); + } + + QFile file(parameterFilename); if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) { - qgcApp()->showMessage(tr("Unable to create file: %1").arg(filename)); + qgcApp()->showMessage(tr("Unable to create file: %1").arg(parameterFilename)); return; }