Skip to content

Commit

Permalink
[browser] Add a dedicated "refresh" item to the context menu for
Browse files Browse the repository at this point in the history
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 2b3d299
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/app/browser/qgsinbuiltdataitemproviders.cpp
Expand Up @@ -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 );
Expand Down

0 comments on commit 2b3d299

Please sign in to comment.