Skip to content

Commit 44e2a99

Browse files
committed
Really fix welcome screen vs project loading
This partially reverts commit bea14e3.
1 parent aeeca48 commit 44e2a99

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/app/qgisapp.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -588,13 +588,13 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, QWidget * parent,
588588
mCentralContainer->insertWidget( 0, mMapCanvas );
589589
mCentralContainer->insertWidget( 1, mWelcomePage );
590590

591-
qobject_cast<QGridLayout *>( centralWidget->layout() )->addWidget( mCentralContainer, 0, 0, 2, 1 );
591+
centralLayout->addWidget( mCentralContainer, 0, 0, 2, 1 );
592592

593593
connect( mMapCanvas, SIGNAL( layersChanged() ), this, SLOT( showMapCanvas() ) );
594-
connect( this, SIGNAL( newProject() ), this, SLOT( showMapCanvas() ) );
595594

596595
mCentralContainer->setCurrentIndex( 1 );
597596

597+
598598
// a bar to warn the user with non-blocking messages
599599
mInfoBar = new QgsMessageBar( centralWidget );
600600
mInfoBar->setSizePolicy( QSizePolicy::Minimum, QSizePolicy::Fixed );
@@ -3932,12 +3932,15 @@ void QgisApp::fileOpenAfterLaunch()
39323932
// what type of project to auto-open
39333933
int projOpen = settings.value( "/qgis/projOpenAtLaunch", 0 ).toInt();
39343934

3935-
// get path of project file to open, or was attempted
3936-
QString projPath = QString();
39373935
if ( projOpen == 0 ) // welcome page
39383936
{
3937+
connect( this, SIGNAL( newProject() ), this, SLOT( showMapCanvas() ) );
39393938
return;
39403939
}
3940+
3941+
// get path of project file to open, or was attempted
3942+
QString projPath;
3943+
39413944
if ( projOpen == 1 && mRecentProjects.size() > 0 ) // most recent project
39423945
{
39433946
projPath = mRecentProjects.at( 0 ).path;

0 commit comments

Comments
 (0)