From e18cf5dcb838a00eeaad461dc39eb839a2e2eb9c Mon Sep 17 00:00:00 2001 From: Andrea Giudiceandrea Date: Mon, 9 Sep 2024 01:06:55 +0200 Subject: [PATCH] Update qgsinbuiltdataitemproviders.cpp --- src/app/browser/qgsinbuiltdataitemproviders.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/app/browser/qgsinbuiltdataitemproviders.cpp b/src/app/browser/qgsinbuiltdataitemproviders.cpp index 09e09f635541..568a33a9c1b6 100644 --- a/src/app/browser/qgsinbuiltdataitemproviders.cpp +++ b/src/app/browser/qgsinbuiltdataitemproviders.cpp @@ -83,9 +83,12 @@ QString QgsAppDirectoryItemGuiProvider::name() void QgsAppDirectoryItemGuiProvider::populateContextMenu( QgsDataItem *item, QMenu *menu, const QList &, 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; @@ -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, [ = ] { @@ -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 );