1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 03:17:35 +00:00

FileManager: Add launch handler actions to desktop context menu

Extracted a method from the code in the File Manager application which
added actions for activating launch handlers found for the selected
file from the context menu. Applied this method to desktop files
and shortcuts.

Note: made some launch handler related methods in the DirectoryView
static or const which allows passing const DirectoryView& to certain
methods.
This commit is contained in:
Zac 2021-03-03 21:00:32 +10:00 committed by Andreas Kling
parent 9fd9ce1f9e
commit 6d68ae45b4
3 changed files with 70 additions and 42 deletions

View file

@ -444,7 +444,7 @@ void DirectoryView::set_should_show_dotfiles(bool show_dotfiles)
m_model->set_should_show_dotfiles(show_dotfiles);
}
void DirectoryView::launch(const URL&, const LauncherHandler& launcher_handler)
void DirectoryView::launch(const URL&, const LauncherHandler& launcher_handler) const
{
pid_t child;
if (launcher_handler.details().launcher_type == Desktop::Launcher::LauncherType::Application) {