Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
also handle qgz like qgs on the command line (fixes #19333; followup d…
  • Loading branch information
jef-n committed Jul 4, 2018
1 parent 6d751dc commit 74d5844
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/app/main.cpp
Expand Up @@ -746,11 +746,12 @@ int main( int argc, char *argv[] )
/////////////////////////////////////////////////////////////////////
if ( sProjectFileName.isEmpty() )
{
// check for a .qgs
// check for a .qgs/z
for ( int i = 0; i < args.size(); i++ )
{
QString arg = QDir::toNativeSeparators( QFileInfo( args[i] ).absoluteFilePath() );
if ( arg.endsWith( QLatin1String( ".qgs" ), Qt::CaseInsensitive ) )
if ( arg.endsWith( QLatin1String( ".qgs" ), Qt::CaseInsensitive ) ||
arg.endsWith( QLatin1String( ".qgz" ), Qt::CaseInsensitive ) )
{
sProjectFileName = arg;
break;
Expand Down Expand Up @@ -1288,8 +1289,9 @@ int main( int argc, char *argv[] )
{
QgsDebugMsg( QString( "Trying to load file : %1" ).arg( layerName ) );
// don't load anything with a .qgs extension - these are project files
if ( !layerName.endsWith( QLatin1String( ".qgs" ), Qt::CaseInsensitive )
&& !QgsZipUtils::isZipFile( layerName ) )
if ( !layerName.endsWith( QLatin1String( ".qgs" ), Qt::CaseInsensitive ) &&
!layerName.endsWith( QLatin1String( ".qgz" ), Qt::CaseInsensitive ) &&
!QgsZipUtils::isZipFile( layerName ) )
{
qgis->openLayer( layerName );
}
Expand Down

0 comments on commit 74d5844

Please sign in to comment.