mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 12:07:45 +00:00
shot: Prefer LibFileSystem over DeprecatedFile
This commit is contained in:
parent
487ec64a78
commit
8afd09b423
2 changed files with 5 additions and 5 deletions
|
@ -130,7 +130,7 @@ target_link_libraries(readlink PRIVATE LibFileSystem)
|
||||||
target_link_libraries(run-tests PRIVATE LibCoredump LibDebug LibFileSystem LibRegex)
|
target_link_libraries(run-tests PRIVATE LibCoredump LibDebug LibFileSystem LibRegex)
|
||||||
target_link_libraries(rm PRIVATE LibFileSystem)
|
target_link_libraries(rm PRIVATE LibFileSystem)
|
||||||
target_link_libraries(sed PRIVATE LibRegex 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(sql PRIVATE LibFileSystem LibIPC LibLine LibSQL)
|
||||||
target_link_libraries(su PRIVATE LibCrypt)
|
target_link_libraries(su PRIVATE LibCrypt)
|
||||||
target_link_libraries(syscall PRIVATE LibSystem)
|
target_link_libraries(syscall PRIVATE LibSystem)
|
||||||
|
|
|
@ -11,8 +11,8 @@
|
||||||
#include <AK/URL.h>
|
#include <AK/URL.h>
|
||||||
#include <LibCore/ArgsParser.h>
|
#include <LibCore/ArgsParser.h>
|
||||||
#include <LibCore/DateTime.h>
|
#include <LibCore/DateTime.h>
|
||||||
#include <LibCore/DeprecatedFile.h>
|
|
||||||
#include <LibCore/Process.h>
|
#include <LibCore/Process.h>
|
||||||
|
#include <LibFileSystem/FileSystem.h>
|
||||||
#include <LibGUI/Application.h>
|
#include <LibGUI/Application.h>
|
||||||
#include <LibGUI/Clipboard.h>
|
#include <LibGUI/Clipboard.h>
|
||||||
#include <LibGUI/ConnectionToWindowServer.h>
|
#include <LibGUI/ConnectionToWindowServer.h>
|
||||||
|
@ -174,12 +174,12 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
||||||
|
|
||||||
bool printed_hyperlink = false;
|
bool printed_hyperlink = false;
|
||||||
if (isatty(STDOUT_FILENO)) {
|
if (isatty(STDOUT_FILENO)) {
|
||||||
auto full_path = Core::DeprecatedFile::real_path_for(output_path);
|
auto full_path_or_error = FileSystem::real_path(output_path);
|
||||||
if (!full_path.is_null()) {
|
if (!full_path_or_error.is_error()) {
|
||||||
char hostname[HOST_NAME_MAX];
|
char hostname[HOST_NAME_MAX];
|
||||||
VERIFY(gethostname(hostname, sizeof(hostname)) == 0);
|
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());
|
out("\033]8;;{}\033\\", url.serialize());
|
||||||
printed_hyperlink = true;
|
printed_hyperlink = true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue