Skip to content

Commit 98c89cc

Browse files
committedApr 29, 2017
also accept uppercase .qgs as project extension (fixes #15871)
1 parent da39cd9 commit 98c89cc

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed
 

‎src/app/main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -734,7 +734,7 @@ int main( int argc, char *argv[] )
734734
for ( int i = 0; i < args.size(); i++ )
735735
{
736736
QString arg = QDir::toNativeSeparators( QFileInfo( args[i] ).absoluteFilePath() );
737-
if ( arg.contains( QLatin1String( ".qgs" ) ) )
737+
if ( arg.endsWith( QLatin1String( ".qgs", Qt::CaseInsensitive ) ) )
738738
{
739739
sProjectFileName = arg;
740740
break;
@@ -1113,7 +1113,7 @@ int main( int argc, char *argv[] )
11131113
QgsDebugMsg( QString( "Trying to load file : %1" ).arg( ( *myIterator ) ) );
11141114
QString myLayerName = *myIterator;
11151115
// don't load anything with a .qgs extension - these are project files
1116-
if ( !myLayerName.contains( QLatin1String( ".qgs" ) ) )
1116+
if ( !myLayerName.endsWith( QLatin1String( ".qgs", Qt::CaseInsensitive ) ) )
11171117
{
11181118
qgis->openLayer( myLayerName );
11191119
}

‎src/app/qgisapp.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4962,7 +4962,7 @@ void QgisApp::fileOpenAfterLaunch()
49624962
return;
49634963
}
49644964

4965-
if ( !projPath.endsWith( QLatin1String( "qgs" ), Qt::CaseInsensitive ) )
4965+
if ( !projPath.endsWith( QLatin1String( ".qgs" ), Qt::CaseInsensitive ) )
49664966
{
49674967
messageBar()->pushMessage( autoOpenMsgTitle,
49684968
tr( "Not valid project file: %1" ).arg( projPath ),

‎tests/bench/main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ int main( int argc, char *argv[] )
475475
for ( int i = 0; i < argc; i++ )
476476
{
477477
QString arg = QDir::toNativeSeparators( QFileInfo( QFile::decodeName( argv[i] ) ).absoluteFilePath() );
478-
if ( arg.contains( QLatin1String( ".qgs" ) ) )
478+
if ( arg.endsWith( QLatin1String( ".qgs" ), Qt::CaseInsensitive ) )
479479
{
480480
myProjectFileName = arg;
481481
break;
@@ -526,7 +526,7 @@ int main( int argc, char *argv[] )
526526
QgsDebugMsg( QString( "Trying to load file : %1" ).arg( ( *myIterator ) ) );
527527
QString myLayerName = *myIterator;
528528
// don't load anything with a .qgs extension - these are project files
529-
if ( !myLayerName.contains( QLatin1String( ".qgs" ) ) )
529+
if ( !myLayerName.endsWith( QLatin1String( ".qgs", Qt::CaseInsensitive ) ) )
530530
{
531531
fprintf( stderr, "Data files not yet supported\n" );
532532
return 1;

0 commit comments

Comments
 (0)
Please sign in to comment.