mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-05 07:41:01 +00:00
LibGUI+Shell+bt+ls: Use proper APIs for creating file URLs
This patch replaces ad-hoc generation of file URL strings with using URL::create_with_file_scheme().
This commit is contained in:
parent
5caaa52bee
commit
628c7f094f
Notes:
sideshowbarker
2024-07-18 17:03:38 +09:00
Author: https://github.com/MaxWipfli
Commit: 628c7f094f
Pull-request: https://github.com/SerenityOS/serenity/pull/7478
Reviewed-by: https://github.com/awesomekling
4 changed files with 12 additions and 9 deletions
|
@ -15,6 +15,7 @@
|
|||
#include <AK/ScopedValueRollback.h>
|
||||
#include <AK/StringBuilder.h>
|
||||
#include <AK/TemporaryChange.h>
|
||||
#include <AK/URL.h>
|
||||
#include <LibCore/ArgsParser.h>
|
||||
#include <LibCore/DirIterator.h>
|
||||
#include <LibCore/Event.h>
|
||||
|
@ -66,7 +67,8 @@ void Shell::print_path(const String& path)
|
|||
printf("%s", path.characters());
|
||||
return;
|
||||
}
|
||||
printf("\033]8;;file://%s%s\033\\%s\033]8;;\033\\", hostname, path.characters(), path.characters());
|
||||
auto url = URL::create_with_file_scheme(path, {}, hostname);
|
||||
out("\033]8;;{}\033\\{}\033]8;;\033\\", url.serialize(), path);
|
||||
}
|
||||
|
||||
String Shell::prompt() const
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue