summaryrefslogtreecommitdiff
path: root/Applications/FileManager
diff options
context:
space:
mode:
authorNicholas Hollett <niax@niax.co.uk>2020-04-26 20:30:01 +0100
committerAndreas Kling <kling@serenityos.org>2020-05-09 15:13:32 +0200
commitb7810a31c3b50240a083a3e59ad8a38d2d12dddb (patch)
treeddc9f8dc73876c4323fd4297ec4ea8f0d14b1a39 /Applications/FileManager
parent2708cc0f72c545b9c079b74c9d546ef55e6325ea (diff)
downloadserenity-b7810a31c3b50240a083a3e59ad8a38d2d12dddb.zip
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.
Diffstat (limited to 'Applications/FileManager')
-rw-r--r--Applications/FileManager/DirectoryView.cpp4
-rw-r--r--Applications/FileManager/Makefile2
-rw-r--r--Applications/FileManager/main.cpp10
3 files changed, 8 insertions, 8 deletions
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 <AK/NumberFormat.h>
#include <AK/StringBuilder.h>
#include <AK/URL.h>
-#include <LibCore/DesktopServices.h>
+#include <LibDesktop/Launcher.h>
#include <LibGUI/SortingProxyModel.h>
#include <stdio.h>
#include <unistd.h>
@@ -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 <AK/StringBuilder.h>
#include <AK/URL.h>
#include <LibCore/ConfigFile.h>
-#include <LibCore/DesktopServices.h>
#include <LibCore/MimeData.h>
#include <LibCore/StandardPaths.h>
+#include <LibDesktop/Launcher.h>
#include <LibGUI/AboutDialog.h>
#include <LibGUI/Action.h>
#include <LibGUI/ActionGroup.h>
@@ -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<Core::ConfigFile> 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<Core::ConfigFile> 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);