Skip to content
Permalink
Browse files

Load projects from storage at start

The check for qgs/qgs was preventing db-stored
project to be opened at start when option
to re-open last project is on
  • Loading branch information
elpaso committed Mar 6, 2019
1 parent 4113505 commit 0e98d1e82eb3d20a072346bb53a356fb700a798f
@@ -5643,16 +5643,20 @@ void QgisApp::fileOpenAfterLaunch()
return;
}

if ( !projPath.endsWith( QLatin1String( ".qgs" ), Qt::CaseInsensitive ) &&
!projPath.endsWith( QLatin1String( ".qgz" ), Qt::CaseInsensitive ) )
// Is this a storage based project?
const bool projectIsFromStorage { QgsApplication::instance()->projectStorageRegistry()->projectStorageFromUri( projPath ) };

if ( !( projectIsFromStorage ||
projPath.endsWith( QLatin1String( ".qgs" ), Qt::CaseInsensitive ) ||
projPath.endsWith( QLatin1String( ".qgz" ), Qt::CaseInsensitive ) ) )
{
visibleMessageBar()->pushMessage( autoOpenMsgTitle,
tr( "Not valid project file: %1" ).arg( projPath ),
Qgis::Warning );
return;
}

if ( QFile::exists( projPath ) )
if ( projectIsFromStorage || QFile::exists( projPath ) )
{
// set flag to check on next app launch if the following project opened OK
settings.setValue( QStringLiteral( "qgis/projOpenedOKAtLaunch" ), QVariant( false ) );

0 comments on commit 0e98d1e

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