mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-11 17:00:37 +00:00
open: Prefer LibFileSystem over DeprecatedFile
This commit is contained in:
parent
34eb797013
commit
6e08f860f8
Notes:
sideshowbarker
2024-07-18 04:38:32 +09:00
Author: https://github.com/BenWiederhake Commit: https://github.com/SerenityOS/serenity/commit/6e08f860f8 Pull-request: https://github.com/SerenityOS/serenity/pull/18934
2 changed files with 4 additions and 4 deletions
|
@ -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)
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue