From b7810a31c3b50240a083a3e59ad8a38d2d12dddb Mon Sep 17 00:00:00 2001 From: Nicholas Hollett Date: Sun, 26 Apr 2020 20:30:01 +0100 Subject: LibDesktop: Switch to LaunchServer for DesktopServices::open Moves DirectoryServices out of LibCore (because we need to link with LibIPC), renames it Desktop::Launcher (because Desktop::DesktopServices doesn't scan right) and ports it to use the LaunchServer which is now responsible for starting programs for a file. --- Applications/FileManager/DirectoryView.cpp | 4 ++-- Applications/FileManager/Makefile | 2 +- Applications/FileManager/main.cpp | 10 +++++----- 3 files changed, 8 insertions(+), 8 deletions(-) (limited to 'Applications/FileManager') diff --git a/Applications/FileManager/DirectoryView.cpp b/Applications/FileManager/DirectoryView.cpp index cb7d2536b0..2efa86825f 100644 --- a/Applications/FileManager/DirectoryView.cpp +++ b/Applications/FileManager/DirectoryView.cpp @@ -29,7 +29,7 @@ #include #include #include -#include +#include #include #include #include @@ -53,7 +53,7 @@ void DirectoryView::handle_activation(const GUI::ModelIndex& index) return; } - Core::DesktopServices::open(URL::create_with_file_protocol(path)); + Desktop::Launcher::open(URL::create_with_file_protocol(path)); } DirectoryView::DirectoryView() diff --git a/Applications/FileManager/Makefile b/Applications/FileManager/Makefile index 0b4fd8793d..1a7e4bc7a9 100644 --- a/Applications/FileManager/Makefile +++ b/Applications/FileManager/Makefile @@ -6,6 +6,6 @@ OBJS = \ PROGRAM = FileManager -LIB_DEPS = GUI Gfx IPC Thread Pthread Core +LIB_DEPS = GUI Gfx Desktop IPC Thread Pthread Core include ../../Makefile.common diff --git a/Applications/FileManager/main.cpp b/Applications/FileManager/main.cpp index 93b1df906c..3c9359fbde 100644 --- a/Applications/FileManager/main.cpp +++ b/Applications/FileManager/main.cpp @@ -31,9 +31,9 @@ #include #include #include -#include #include #include +#include #include #include #include @@ -86,7 +86,7 @@ int main(int argc, char** argv) GUI::Application app(argc, argv); - if (pledge("stdio thread shared_buffer accept cpath rpath wpath fattr proc exec", nullptr) < 0) { + if (pledge("stdio thread shared_buffer accept cpath rpath wpath fattr proc exec unix", nullptr) < 0) { perror("pledge"); return 1; } @@ -158,7 +158,7 @@ int run_in_desktop_mode(RefPtr config, String initial_location return; auto& node = model->node(index); auto path = node.full_path(model); - Core::DesktopServices::open(URL::create_with_file_protocol(path)); + Desktop::Launcher::open(URL::create_with_file_protocol(path)); }; auto desktop_view_context_menu = GUI::Menu::construct("Directory View"); @@ -205,11 +205,11 @@ int run_in_desktop_mode(RefPtr config, String initial_location }); auto file_manager_action = GUI::Action::create("Show in FileManager...", {}, Gfx::Bitmap::load_from_file("/res/icons/16x16/filetype-folder.png"), [&](const GUI::Action&) { - Core::DesktopServices::open(URL::create_with_file_protocol(model->root_path())); + Desktop::Launcher::open(URL::create_with_file_protocol(model->root_path())); }); auto display_properties_action = GUI::Action::create("Display settings...", {}, Gfx::Bitmap::load_from_file("/res/icons/16x16/app-display-settings.png"), [&](const GUI::Action&) { - Core::DesktopServices::open(URL::create_with_file_protocol("/bin/DisplaySettings")); + Desktop::Launcher::open(URL::create_with_file_protocol("/bin/DisplaySettings")); }); desktop_view_context_menu->add_action(mkdir_action); -- cgit v1.2.3