We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0e9af79 commit a6391d7Copy full SHA for a6391d7
src/app/qgsrasterlayerproperties.cpp
@@ -56,6 +56,7 @@
56
#include "qgshillshaderendererwidget.h"
57
#include "qgssettings.h"
58
#include "qgsmaplayerlegend.h"
59
+#include "qgsfileutils.h"
60
61
#include <QDesktopServices>
62
#include <QTableWidgetItem>
@@ -1873,8 +1874,7 @@ void QgsRasterLayerProperties::saveStyleAs_clicked()
1873
1874
type = StyleType::SLD;
1875
else
1876
// ensure the user never omits the extension from the file name
- if ( !outputFileName.endsWith( QLatin1String( ".qml" ), Qt::CaseInsensitive ) )
1877
- outputFileName += QLatin1String( ".qml" );
+ outputFileName = QgsFileUtils::ensureFileNameHasExtension( outputFileName, QStringList() << QStringLiteral( "qml" ) );
1878
1879
apply(); // make sure the style to save is uptodate
1880
0 commit comments