Skip to content

Commit

Permalink
Replace toLower() with compare( ..., Qt::CaseInsensitive )
Browse files Browse the repository at this point in the history
  • Loading branch information
pblottiere committed Jul 31, 2017
1 parent 23d83dd commit 26d3845
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/app/qgisapp.cpp
Expand Up @@ -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() );
Expand Down Expand Up @@ -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() );
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsarchive.cpp
Expand Up @@ -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;
}

Expand Down

0 comments on commit 26d3845

Please sign in to comment.