Skip to content
Permalink
Browse files

browser: emit layoutAboutToBeChanged() before destroying home item (f…

…ixes #8221)
  • Loading branch information
jef-n committed Jul 9, 2013
1 parent 682a89c commit 36bf49de19e91896d72e0a692a06c1377f53e898
Showing with 6 additions and 3 deletions.
  1. +6 −3 src/core/qgsbrowsermodel.cpp
@@ -45,12 +45,14 @@ QgsBrowserModel::~QgsBrowserModel()

void QgsBrowserModel::updateProjectHome()
{
int idx = mRootItems.indexOf( mProjectHome );
QString home = QgsProject::instance()->homePath();

delete mProjectHome;
if ( mProjectHome && mProjectHome->path() == home )
return;

emit layoutAboutToBeChanged();

int idx = mRootItems.indexOf( mProjectHome );
delete mProjectHome;
mProjectHome = home.isNull() ? 0 : new QgsDirectoryItem( NULL, tr( "Project home" ), home );
if ( mProjectHome )
{
@@ -64,6 +66,7 @@ void QgsBrowserModel::updateProjectHome()
{
mRootItems.remove( idx );
}

emit layoutChanged();
}

0 comments on commit 36bf49d

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