Skip to content

Commit

Permalink
Fix crash when cliking within embedded layer dialog, before a project
Browse files Browse the repository at this point in the history
is selected

Fixes #19369
  • Loading branch information
nyalldawson committed Jul 10, 2018
1 parent a9c017d commit af98ff8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/app/qgsprojectlayergroupdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ QgsProjectLayerGroupDialog::QgsProjectLayerGroupDialog( QWidget *parent, const Q
{
setupUi( this );

QgsEmbeddedLayerTreeModel *model = new QgsEmbeddedLayerTreeModel( mRootGroup, this );
mTreeView->setModel( model );

QgsSettings settings;

mProjectFileWidget->setStorageMode( QgsFileWidget::GetFile );
Expand Down Expand Up @@ -185,9 +188,6 @@ void QgsProjectLayerGroupDialog::changeProjectFile()
if ( !mShowEmbeddedContent )
removeEmbeddedNodes( mRootGroup );

QgsEmbeddedLayerTreeModel *model = new QgsEmbeddedLayerTreeModel( mRootGroup, this );
mTreeView->setModel( model );

connect( mTreeView->selectionModel(), &QItemSelectionModel::selectionChanged, this, &QgsProjectLayerGroupDialog::onTreeViewSelectionChanged );

mProjectPath = mProjectFileWidget->filePath();
Expand Down

0 comments on commit af98ff8

Please sign in to comment.