Skip to content
Permalink
Browse files

[FIX] Fix loading projects with . in name

At least on Windows 2.18.qgs is a valid name for a file.
  • Loading branch information
NathanW2 committed Feb 19, 2018
1 parent 2c53630 commit 71a7de689056eeef85eca8854f61283f1f7e12ad
Showing with 5 additions and 5 deletions.
  1. +4 −4 src/app/qgisapp.cpp
  2. +1 −1 src/core/qgsdataitem.cpp
@@ -5947,20 +5947,20 @@ void QgisApp::openFile( const QString &fileName )
{
// check to see if we are opening a project file
QFileInfo fi( fileName );
if ( fi.completeSuffix() == QLatin1String( "qgs" ) || fi.completeSuffix() == QLatin1String( "qgz" ) )
if ( fi.suffix() == QLatin1String( "qgs" ) || fi.suffix() == QLatin1String( "qgz" ) )
{
QgsDebugMsg( "Opening project " + fileName );
openProject( fileName );
}
else if ( fi.completeSuffix() == QLatin1String( "qlr" ) )
else if ( fi.suffix() == QLatin1String( "qlr" ) )
{
openLayerDefinition( fileName );
}
else if ( fi.completeSuffix() == QLatin1String( "qpt" ) )
else if ( fi.suffix() == QLatin1String( "qpt" ) )
{
openTemplate( fileName );
}
else if ( fi.completeSuffix() == QLatin1String( "py" ) )
else if ( fi.suffix() == QLatin1String( "py" ) )
{
runScript( fileName );
}
@@ -798,7 +798,7 @@ QVector<QgsDataItem *> QgsDirectoryItem::createChildren()

if ( fileInfo.suffix() == QLatin1String( "qgs" ) || fileInfo.suffix() == QLatin1String( "qgz" ) )
{
QgsDataItem *item = new QgsProjectItem( this, fileInfo.baseName(), path );
QgsDataItem *item = new QgsProjectItem( this, fileInfo.completeBaseName(), path );
children.append( item );
continue;
}

0 comments on commit 71a7de6

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