1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 05:47:35 +00:00

shot: Prefer LibFileSystem over DeprecatedFile

This commit is contained in:
Ben Wiederhake 2023-05-20 10:14:22 +02:00 committed by Andreas Kling
parent 487ec64a78
commit 8afd09b423
2 changed files with 5 additions and 5 deletions

View file

@ -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)

View file

@ -11,8 +11,8 @@
#include <AK/URL.h>
#include <LibCore/ArgsParser.h>
#include <LibCore/DateTime.h>
#include <LibCore/DeprecatedFile.h>
#include <LibCore/Process.h>
#include <LibFileSystem/FileSystem.h>
#include <LibGUI/Application.h>
#include <LibGUI/Clipboard.h>
#include <LibGUI/ConnectionToWindowServer.h>
@ -174,12 +174,12 @@ ErrorOr<int> 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;
}