Skip to content

Commit

Permalink
Update qgsinbuiltdataitemproviders.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
agiudiceandrea authored Sep 8, 2024
1 parent c3a5ab8 commit e18cf5d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/app/browser/qgsinbuiltdataitemproviders.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,12 @@ QString QgsAppDirectoryItemGuiProvider::name()
void QgsAppDirectoryItemGuiProvider::populateContextMenu( QgsDataItem *item, QMenu *menu, const QList<QgsDataItem *> &, QgsDataItemGuiContext context )
{
bool inFavDirs = item->parent() && item->parent()->type() == Qgis::BrowserItemType::Favorites;
if ( inFavDirs )
QgsDebugError( QStringLiteral( "inFavDirs true" ) );

if ( item->type() == Qgis::BrowserItemType::Directory )
{
QgsDebugError( QStringLiteral( "Qgis::BrowserItemType::Directory" ) );
QgsDirectoryItem *directoryItem = qobject_cast< QgsDirectoryItem * >( item );

QgsSettings settings;
Expand Down Expand Up @@ -265,8 +268,10 @@ void QgsAppDirectoryItemGuiProvider::populateContextMenu( QgsDataItem *item, QMe
}
else if ( inFavDirs )
{
QgsDebugError( QStringLiteral( "inFavDirs" ) );
if ( QgsFavoriteItem *favoriteItem = qobject_cast< QgsFavoriteItem * >( item ) )
{
QgsDebugError( QStringLiteral( "QgsFavoriteItem" ) );
QAction *actionRename = new QAction( tr( "Rename Favorite…" ), menu );
connect( actionRename, &QAction::triggered, this, [ = ]
{
Expand Down Expand Up @@ -426,6 +431,7 @@ void QgsAppDirectoryItemGuiProvider::populateContextMenu( QgsDataItem *item, QMe
}
else if ( inFavDirs )
{

if ( QgsFavoriteItem *favoriteItem = qobject_cast< QgsFavoriteItem * >( item ) )
{
QAction *actionRename = new QAction( tr( "Rename Favorite…" ), menu );
Expand Down

0 comments on commit e18cf5d

Please sign in to comment.