Skip to content
Permalink
Browse files

also handle qgz like qgs on the command line (fixes #19333; followup d…

…66d1ee)

(cherry picked from commit 4480a915d55789c5ad05c2b50569ae3d96ecdac7)
  • Loading branch information
jef-n committed Jul 4, 2018
1 parent 71bcf1c commit 53a25c763fdf3692bedde0877b8254a44162ada3
Showing with 6 additions and 4 deletions.
  1. +6 −4 src/app/main.cpp
@@ -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;
@@ -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 );
}

0 comments on commit 53a25c7

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