mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-04 07:36:50 +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:
committed by
Andreas Kling
parent
5caaa52bee
commit
628c7f094f
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user