Fix new groups not created in some circumstances

This commit is contained in:
Nyall Dawson 2019-09-05 17:22:41 +10:00
parent acdb63121f
commit f760514243

View File

@ -645,7 +645,6 @@ QgsBookmarkManagerItem::QgsBookmarkManagerItem( QgsDataItem *parent, const QStri
addChildItem( new QgsBookmarkGroupItem( this, newDetails.group(), mManager ), true );
}
}
} );
connect( mManager, &QgsBookmarkManager::bookmarkChanged, this, [ = ]( const QString & id )
{
@ -676,6 +675,11 @@ QgsBookmarkManagerItem::QgsBookmarkManagerItem( QgsDataItem *parent, const QStri
{
newGroup->addBookmark( newDetails );
}
else
{
// need to create a new group for this (will automatically add the new bookmark)
addChildItem( new QgsBookmarkGroupItem( this, newDetails.group(), mManager ), true );
}
}
break;
}
@ -702,6 +706,11 @@ QgsBookmarkManagerItem::QgsBookmarkManagerItem( QgsDataItem *parent, const QStri
{
newGroup->addBookmark( newDetails );
}
else
{
// need to create a new group for this (will automatically add the new bookmark)
addChildItem( new QgsBookmarkGroupItem( this, newDetails.group(), mManager ), true );
}
}
else
{