mirror of
https://github.com/qgis/QGIS.git
synced 2025-03-01 00:46:20 -05:00
browser: emit layoutAboutToBeChanged() before destroying home item (fixes #8221)
This commit is contained in:
parent
682a89c957
commit
36bf49de19
@ -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();
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user