Ignore archive files given as layername in command line

This commit is contained in:
Blottiere Paul 2017-10-03 08:48:38 +01:00
parent 67cff3ddd7
commit 1fb9f2ae01

View File

@ -98,6 +98,7 @@ typedef SInt32 SRefCon;
#include "qgsvectorlayer.h"
#include "qgis_app.h"
#include "qgscrashhandler.h"
#include "qgsziputils.h"
#include "qgsuserprofilemanager.h"
#include "qgsuserprofile.h"
@ -1169,7 +1170,8 @@ 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 ) )
if ( !layerName.endsWith( QLatin1String( ".qgs" ), Qt::CaseInsensitive )
&& !QgsZipUtils::isZipFile( layerName ) )
{
qgis->openLayer( layerName );
}