mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 17:38:12 +00:00
open: Prefer LibFileSystem over DeprecatedFile
This commit is contained in:
parent
34eb797013
commit
6e08f860f8
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…
Add table
Add a link
Reference in a new issue