Skip to content
Permalink
Browse files
[browser] Add a dedicated "refresh" item to the context menu for
directories which only refreshes the selected directory

If large/remote directories are expanded then it is not efficient
to force the user to use the toolbar "refresh" button which refreshes
EVERY expanded node in the browser
  • Loading branch information
nyalldawson committed May 26, 2021
1 parent 35c557a commit 2b3d299b075bfcf039878d67e5991cd849eeac09
Showing with 6 additions and 0 deletions.
  1. +6 −0 src/app/browser/qgsinbuiltdataitemproviders.cpp
@@ -74,6 +74,12 @@ void QgsAppDirectoryItemGuiProvider::populateContextMenu( QgsDataItem *item, QMe

QgsSettings settings;

QAction *actionRefresh = new QAction( tr( "Refresh" ), this );
connect( actionRefresh, &QAction::triggered, this, [ = ] { directoryItem->refresh(); } );
menu->addAction( actionRefresh );

menu->addSeparator();

QMenu *newMenu = new QMenu( tr( "New" ), menu );

QAction *createFolder = new QAction( QgsApplication::getThemeIcon( QStringLiteral( "mActionNewFolder.svg" ) ), tr( "Directory…" ), menu );

0 comments on commit 2b3d299

Please sign in to comment.