Skip to content
Permalink
Browse files

[FEATURE] Add Open Directory option to disabled welcome page projects

This allows users to open the closest existing path to the original
project location in their file manager, to hopefully help them
re-locate missing/moved/renamed projects.
  • Loading branch information
nyalldawson committed Aug 3, 2018
1 parent 22c4284 commit efd5cc546549b70c5c361d411f5c33a32a1b1105
Showing with 10 additions and 0 deletions.
  1. +10 −0 src/app/qgswelcomepage.cpp
@@ -166,6 +166,16 @@ void QgsWelcomePage::showContextMenuForProjects( QPoint point )
mModel->recheckProject( index );
} );
menu->addAction( rescanAction );

// add an entry to open the closest existing path to the original project file location
// to help users re-find moved/renamed projects!
const QString closestPath = QgsFileUtils::findClosestExistingPath( path );
QAction *openFolderAction = new QAction( tr( "Open “%1”…" ).arg( QDir::toNativeSeparators( closestPath ) ), menu );
connect( openFolderAction, &QAction::triggered, this, [closestPath]
{
QDesktopServices::openUrl( QUrl::fromLocalFile( closestPath ) );
} );
menu->addAction( openFolderAction );
}
QAction *removeProjectAction = new QAction( tr( "Remove from List" ), menu );
connect( removeProjectAction, &QAction::triggered, this, [this, index]

0 comments on commit efd5cc5

Please sign in to comment.
You can’t perform that action at this time.