Skip to content
Permalink
Browse files

use QgsFileUtils::ensureFileNameHasExtension instead

  • Loading branch information
luipir committed Feb 1, 2019
1 parent 700f5b3 commit b4faa0dc0db5646e9858c93b0f9513dd5ee9d8b5
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/app/qgsrasterlayerproperties.cpp
@@ -56,6 +56,7 @@
#include "qgshillshaderendererwidget.h"
#include "qgssettings.h"
#include "qgsmaplayerlegend.h"
#include "qgsfileutils.h"

#include <QDesktopServices>
#include <QTableWidgetItem>
@@ -1873,8 +1874,7 @@ void QgsRasterLayerProperties::saveStyleAs_clicked()
type = StyleType::SLD;
else
// ensure the user never omits the extension from the file name
if ( !outputFileName.endsWith( QLatin1String( ".qml" ), Qt::CaseInsensitive ) )
outputFileName += QLatin1String( ".qml" );
outputFileName = QgsFileUtils::ensureFileNameHasExtension( outputFileName, QStringList() << QStringLiteral( "qml" ) );

apply(); // make sure the style to save is uptodate

0 comments on commit b4faa0d

Please sign in to comment.
You can’t perform that action at this time.