Skip to content
Permalink
Browse files

also accept uppercase .qgs as project extension (fixes #15871)

  • Loading branch information
jef-n committed Apr 29, 2017
1 parent da39cd9 commit 98c89ccabebbe82d1fded6d1f09a0246abafff19
Showing with 5 additions and 5 deletions.
  1. +2 −2 src/app/main.cpp
  2. +1 −1 src/app/qgisapp.cpp
  3. +2 −2 tests/bench/main.cpp
@@ -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;
@@ -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 );
}
@@ -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 ),
@@ -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;
@@ -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;

0 comments on commit 98c89cc

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