diff options
author | Ben Wiederhake <BenWiederhake.GitHub@gmx.de> | 2023-05-20 01:40:19 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2023-05-21 07:50:52 +0200 |
commit | 6e08f860f8e684a49e1b9e8359f9fbc19f8022d4 (patch) | |
tree | d464541870560085d6c6570868a89814aed6f08a | |
parent | 34eb7970138fed0ed0fc0c7ecb5a21db05e55295 (diff) | |
download | serenity-6e08f860f8e684a49e1b9e8359f9fbc19f8022d4.zip |
open: Prefer LibFileSystem over DeprecatedFile
-rw-r--r-- | Userland/Utilities/CMakeLists.txt | 2 | ||||
-rw-r--r-- | Userland/Utilities/open.cpp | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/Userland/Utilities/CMakeLists.txt b/Userland/Utilities/CMakeLists.txt index b87da69550..1cb5576243 100644 --- a/Userland/Utilities/CMakeLists.txt +++ b/Userland/Utilities/CMakeLists.txt @@ -118,7 +118,7 @@ target_link_libraries(md PRIVATE LibMarkdown) target_link_libraries(mv PRIVATE LibFileSystem) target_link_libraries(network-settings PRIVATE LibCore LibMain) target_link_libraries(notify PRIVATE LibGfx LibGUI) -target_link_libraries(open PRIVATE LibDesktop) +target_link_libraries(open PRIVATE LibDesktop LibFileSystem) target_link_libraries(passwd PRIVATE LibCrypt) target_link_libraries(paste PRIVATE LibGUI) target_link_libraries(pledge PRIVATE LibFileSystem) diff --git a/Userland/Utilities/open.cpp b/Userland/Utilities/open.cpp index ef2ba4f614..11cedb6c71 100644 --- a/Userland/Utilities/open.cpp +++ b/Userland/Utilities/open.cpp @@ -8,9 +8,9 @@ #include <AK/URL.h> #include <AK/Vector.h> #include <LibCore/ArgsParser.h> -#include <LibCore/DeprecatedFile.h> #include <LibCore/EventLoop.h> #include <LibDesktop/Launcher.h> +#include <LibFileSystem/FileSystem.h> #include <LibMain/Main.h> ErrorOr<int> serenity_main(Main::Arguments arguments) @@ -25,8 +25,8 @@ ErrorOr<int> serenity_main(Main::Arguments arguments) bool all_ok = true; for (auto& url_or_path : urls_or_paths) { - auto path = Core::DeprecatedFile::real_path_for(url_or_path); - auto url = URL::create_with_url_or_path(path.is_null() ? url_or_path : path.view()); + auto path = FileSystem::real_path(url_or_path); + auto url = URL::create_with_url_or_path(path.is_error() ? url_or_path : path.value()); if (!Desktop::Launcher::open(url)) { warnln("Failed to open '{}'", url); |