Skip to content

Commit

Permalink
Really fix welcome screen vs project loading
Browse files Browse the repository at this point in the history
This partially reverts commit bea14e3.
  • Loading branch information
m-kuhn committed Aug 29, 2015
1 parent aeeca48 commit 44e2a99
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/app/qgisapp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -588,13 +588,13 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, QWidget * parent,
mCentralContainer->insertWidget( 0, mMapCanvas );
mCentralContainer->insertWidget( 1, mWelcomePage );

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

connect( mMapCanvas, SIGNAL( layersChanged() ), this, SLOT( showMapCanvas() ) );
connect( this, SIGNAL( newProject() ), this, SLOT( showMapCanvas() ) );

mCentralContainer->setCurrentIndex( 1 );


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

// get path of project file to open, or was attempted
QString projPath = QString();
if ( projOpen == 0 ) // welcome page
{
connect( this, SIGNAL( newProject() ), this, SLOT( showMapCanvas() ) );
return;
}

// get path of project file to open, or was attempted
QString projPath;

if ( projOpen == 1 && mRecentProjects.size() > 0 ) // most recent project
{
projPath = mRecentProjects.at( 0 ).path;
Expand Down

0 comments on commit 44e2a99

Please sign in to comment.