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()
|
void QgsBrowserModel::updateProjectHome()
|
||||||
{
|
{
|
||||||
int idx = mRootItems.indexOf( mProjectHome );
|
|
||||||
QString home = QgsProject::instance()->homePath();
|
QString home = QgsProject::instance()->homePath();
|
||||||
|
if ( mProjectHome && mProjectHome->path() == home )
|
||||||
delete mProjectHome;
|
return;
|
||||||
|
|
||||||
emit layoutAboutToBeChanged();
|
emit layoutAboutToBeChanged();
|
||||||
|
|
||||||
|
int idx = mRootItems.indexOf( mProjectHome );
|
||||||
|
delete mProjectHome;
|
||||||
mProjectHome = home.isNull() ? 0 : new QgsDirectoryItem( NULL, tr( "Project home" ), home );
|
mProjectHome = home.isNull() ? 0 : new QgsDirectoryItem( NULL, tr( "Project home" ), home );
|
||||||
if ( mProjectHome )
|
if ( mProjectHome )
|
||||||
{
|
{
|
||||||
@ -64,6 +66,7 @@ void QgsBrowserModel::updateProjectHome()
|
|||||||
{
|
{
|
||||||
mRootItems.remove( idx );
|
mRootItems.remove( idx );
|
||||||
}
|
}
|
||||||
|
|
||||||
emit layoutChanged();
|
emit layoutChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user