From 8afd09b423e94be6a495546fd262184b55381b61 Mon Sep 17 00:00:00 2001 From: Ben Wiederhake Date: Sat, 20 May 2023 10:14:22 +0200 Subject: [PATCH] shot: Prefer LibFileSystem over DeprecatedFile --- Userland/Utilities/CMakeLists.txt | 2 +- Userland/Utilities/shot.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Userland/Utilities/CMakeLists.txt b/Userland/Utilities/CMakeLists.txt index 1cb5576243..a54608e13a 100644 --- a/Userland/Utilities/CMakeLists.txt +++ b/Userland/Utilities/CMakeLists.txt @@ -130,7 +130,7 @@ target_link_libraries(readlink PRIVATE LibFileSystem) target_link_libraries(run-tests PRIVATE LibCoredump LibDebug LibFileSystem LibRegex) target_link_libraries(rm PRIVATE LibFileSystem) target_link_libraries(sed PRIVATE LibRegex LibFileSystem) -target_link_libraries(shot PRIVATE LibGfx LibGUI LibIPC) +target_link_libraries(shot PRIVATE LibFileSystem LibGfx LibGUI LibIPC) target_link_libraries(sql PRIVATE LibFileSystem LibIPC LibLine LibSQL) target_link_libraries(su PRIVATE LibCrypt) target_link_libraries(syscall PRIVATE LibSystem) diff --git a/Userland/Utilities/shot.cpp b/Userland/Utilities/shot.cpp index 8b7caf975e..2d7a3b1836 100644 --- a/Userland/Utilities/shot.cpp +++ b/Userland/Utilities/shot.cpp @@ -11,8 +11,8 @@ #include #include #include -#include #include +#include #include #include #include @@ -174,12 +174,12 @@ ErrorOr serenity_main(Main::Arguments arguments) bool printed_hyperlink = false; if (isatty(STDOUT_FILENO)) { - auto full_path = Core::DeprecatedFile::real_path_for(output_path); - if (!full_path.is_null()) { + auto full_path_or_error = FileSystem::real_path(output_path); + if (!full_path_or_error.is_error()) { char hostname[HOST_NAME_MAX]; VERIFY(gethostname(hostname, sizeof(hostname)) == 0); - auto url = URL::create_with_file_scheme(full_path, {}, hostname); + auto url = URL::create_with_file_scheme(full_path_or_error.value().to_deprecated_string(), {}, hostname); out("\033]8;;{}\033\\", url.serialize()); printed_hyperlink = true; }