Skip to content

Commit 53a25c7

Browse files
committed
also handle qgz like qgs on the command line (fixes #19333; followup d66d1ee)
(cherry picked from commit 4480a915d55789c5ad05c2b50569ae3d96ecdac7)
1 parent 71bcf1c commit 53a25c7

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/app/main.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -746,11 +746,12 @@ int main( int argc, char *argv[] )
746746
/////////////////////////////////////////////////////////////////////
747747
if ( sProjectFileName.isEmpty() )
748748
{
749-
// check for a .qgs
749+
// check for a .qgs/z
750750
for ( int i = 0; i < args.size(); i++ )
751751
{
752752
QString arg = QDir::toNativeSeparators( QFileInfo( args[i] ).absoluteFilePath() );
753-
if ( arg.endsWith( QLatin1String( ".qgs" ), Qt::CaseInsensitive ) )
753+
if ( arg.endsWith( QLatin1String( ".qgs" ), Qt::CaseInsensitive ) ||
754+
arg.endsWith( QLatin1String( ".qgz" ), Qt::CaseInsensitive ) )
754755
{
755756
sProjectFileName = arg;
756757
break;
@@ -1288,8 +1289,9 @@ int main( int argc, char *argv[] )
12881289
{
12891290
QgsDebugMsg( QString( "Trying to load file : %1" ).arg( layerName ) );
12901291
// don't load anything with a .qgs extension - these are project files
1291-
if ( !layerName.endsWith( QLatin1String( ".qgs" ), Qt::CaseInsensitive )
1292-
&& !QgsZipUtils::isZipFile( layerName ) )
1292+
if ( !layerName.endsWith( QLatin1String( ".qgs" ), Qt::CaseInsensitive ) &&
1293+
!layerName.endsWith( QLatin1String( ".qgz" ), Qt::CaseInsensitive ) &&
1294+
!QgsZipUtils::isZipFile( layerName ) )
12931295
{
12941296
qgis->openLayer( layerName );
12951297
}

0 commit comments

Comments
 (0)