Skip to content

Commit

Permalink
also accept uppercase .qgs as project extension (fixes #15871)
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Apr 29, 2017
1 parent da39cd9 commit 98c89cc
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/app/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -734,7 +734,7 @@ int main( int argc, char *argv[] )
for ( int i = 0; i < args.size(); i++ )
{
QString arg = QDir::toNativeSeparators( QFileInfo( args[i] ).absoluteFilePath() );
if ( arg.contains( QLatin1String( ".qgs" ) ) )
if ( arg.endsWith( QLatin1String( ".qgs", Qt::CaseInsensitive ) ) )
{
sProjectFileName = arg;
break;
Expand Down Expand Up @@ -1113,7 +1113,7 @@ int main( int argc, char *argv[] )
QgsDebugMsg( QString( "Trying to load file : %1" ).arg( ( *myIterator ) ) );
QString myLayerName = *myIterator;
// don't load anything with a .qgs extension - these are project files
if ( !myLayerName.contains( QLatin1String( ".qgs" ) ) )
if ( !myLayerName.endsWith( QLatin1String( ".qgs", Qt::CaseInsensitive ) ) )
{
qgis->openLayer( myLayerName );
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgisapp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4962,7 +4962,7 @@ void QgisApp::fileOpenAfterLaunch()
return;
}

if ( !projPath.endsWith( QLatin1String( "qgs" ), Qt::CaseInsensitive ) )
if ( !projPath.endsWith( QLatin1String( ".qgs" ), Qt::CaseInsensitive ) )
{
messageBar()->pushMessage( autoOpenMsgTitle,
tr( "Not valid project file: %1" ).arg( projPath ),
Expand Down
4 changes: 2 additions & 2 deletions tests/bench/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ int main( int argc, char *argv[] )
for ( int i = 0; i < argc; i++ )
{
QString arg = QDir::toNativeSeparators( QFileInfo( QFile::decodeName( argv[i] ) ).absoluteFilePath() );
if ( arg.contains( QLatin1String( ".qgs" ) ) )
if ( arg.endsWith( QLatin1String( ".qgs" ), Qt::CaseInsensitive ) )
{
myProjectFileName = arg;
break;
Expand Down Expand Up @@ -526,7 +526,7 @@ int main( int argc, char *argv[] )
QgsDebugMsg( QString( "Trying to load file : %1" ).arg( ( *myIterator ) ) );
QString myLayerName = *myIterator;
// don't load anything with a .qgs extension - these are project files
if ( !myLayerName.contains( QLatin1String( ".qgs" ) ) )
if ( !myLayerName.endsWith( QLatin1String( ".qgs", Qt::CaseInsensitive ) ) )
{
fprintf( stderr, "Data files not yet supported\n" );
return 1;
Expand Down

0 comments on commit 98c89cc

Please sign in to comment.