Skip to content
Permalink
Browse files

Replace toLower() with compare( ..., Qt::CaseInsensitive )

  • Loading branch information
pblottiere committed Jul 13, 2017
1 parent 23d83dd commit 26d38459c532c830d99d6cbae27e354356b371bd
Showing with 5 additions and 5 deletions.
  1. +4 −4 src/app/qgisapp.cpp
  2. +1 −1 src/core/qgsarchive.cpp
@@ -5451,14 +5451,14 @@ bool QgisApp::fileSave()
// make sure we have the .qgs extension in the file name
if ( filter == zipExt )
{
if ( "qgz" != fullPath.suffix().toLower() )
if ( fullPath.suffix().compare( QLatin1String( "qgz" ), Qt::CaseInsensitive ) != 0 )
fullPath.setFile( fullPath.filePath() + ".qgz" );

QgsProject::instance()->setZipFileName( fullPath.filePath() );
}
else
{
if ( "qgs" != fullPath.suffix().toLower() )
if ( fullPath.suffix().compare( QLatin1String( "qgs" ), Qt::CaseInsensitive ) != 0 )
fullPath.setFile( fullPath.filePath() + ".qgs" );

QgsProject::instance()->setFileName( fullPath.filePath() );
@@ -5557,14 +5557,14 @@ void QgisApp::fileSaveAs()
bool writeOk = false;
if ( filter == zipExt )
{
if ( "qgz" != fullPath.suffix().toLower() )
if ( fullPath.suffix().compare( QLatin1String( "qgz" ), Qt::CaseInsensitive ) != 0 )
fullPath.setFile( fullPath.filePath() + ".qgz" );

writeOk = QgsProject::instance()->zip( fullPath.filePath() );
}
else // .qgs
{
if ( "qgs" != fullPath.suffix().toLower() )
if ( fullPath.suffix().compare( QLatin1String( "qgs" ), Qt::CaseInsensitive ) != 0 )
fullPath.setFile( fullPath.filePath() + ".qgs" );

QgsProject::instance()->setFileName( fullPath.filePath() );
@@ -135,7 +135,7 @@ QString QgsArchive::projectFile() const
Q_FOREACH ( const QString &file, mFiles )
{
QFileInfo fileInfo( file );
if ( "qgs" == fileInfo.suffix().toLower() )
if ( fileInfo.suffix().compare( QLatin1String( "qgs" ), Qt::CaseInsensitive ) == 0 )
return file;
}

0 comments on commit 26d3845

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