mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-28 05:35:52 +03:00
AK: Add optional fragment parameter to create_with_file_protocol()
Now that we use fragment for specifying starting selection in FileManager we would benefit from providing it as argument instead of setting it each time separately.
This commit is contained in:
parent
1496b02203
commit
50de653cc9
Notes:
sideshowbarker
2024-07-18 21:39:33 +09:00
Author: https://github.com/speles Commit: https://github.com/SerenityOS/serenity/commit/50de653cc99 Pull-request: https://github.com/SerenityOS/serenity/pull/5595 Issue: https://github.com/SerenityOS/serenity/issues/5586
@ -444,11 +444,12 @@ u16 URL::default_port_for_protocol(const String& protocol)
|
||||
return 0;
|
||||
}
|
||||
|
||||
URL URL::create_with_file_protocol(const String& path)
|
||||
URL URL::create_with_file_protocol(const String& path, const String& fragment)
|
||||
{
|
||||
URL url;
|
||||
url.set_protocol("file");
|
||||
url.set_path(path);
|
||||
url.set_fragment(fragment);
|
||||
return url;
|
||||
}
|
||||
|
||||
|
2
AK/URL.h
2
AK/URL.h
@ -77,7 +77,7 @@ public:
|
||||
const String& data_payload() const { return m_data_payload; }
|
||||
|
||||
static URL create_with_url_or_path(const String& url_or_path);
|
||||
static URL create_with_file_protocol(const String& path);
|
||||
static URL create_with_file_protocol(const String& path, const String& fragment = {});
|
||||
static URL create_with_data(const StringView& mime_type, const StringView& payload, bool is_base64 = false);
|
||||
static bool protocol_requires_port(const String& protocol);
|
||||
static u16 default_port_for_protocol(const String& protocol);
|
||||
|
Loading…
Reference in New Issue
Block a user