Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
use QgsFileUtils::ensureFileNameHasExtension instead
  • Loading branch information
luipir committed Feb 1, 2019
1 parent 0e9af79 commit a6391d7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/app/qgsrasterlayerproperties.cpp
Expand Up @@ -56,6 +56,7 @@
#include "qgshillshaderendererwidget.h"
#include "qgssettings.h"
#include "qgsmaplayerlegend.h"
#include "qgsfileutils.h"

#include <QDesktopServices>
#include <QTableWidgetItem>
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit a6391d7

Please sign in to comment.