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

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.
This commit is contained in:
Nicholas Hollett 2020-04-26 20:30:01 +01:00 committed by Andreas Kling
parent 2708cc0f72
commit b7810a31c3
10 changed files with 109 additions and 111 deletions

View file

@ -27,10 +27,13 @@
#include <AK/URL.h>
#include <AK/Vector.h>
#include <LibCore/ArgsParser.h>
#include <LibCore/DesktopServices.h>
#include <LibDesktop/Launcher.h>
#include <LibGUI/Application.h>
int main(int argc, char* argv[])
{
GUI::Application app(argc, argv);
Vector<const char*> urls_or_paths;
Core::ArgsParser parser;
parser.add_positional_argument(urls_or_paths, "URL or file path to open", "url-or-path");
@ -40,7 +43,7 @@ int main(int argc, char* argv[])
for (auto& url_or_path : urls_or_paths) {
URL url = URL::create_with_url_or_path(url_or_path);
bool ok = Core::DesktopServices::open(url);
bool ok = Desktop::Launcher::open(url);
all_ok = all_ok && ok;
}