1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 14:38:11 +00:00

AK: Port URL scheme from DeprecatedString to String

This commit is contained in:
Shannon Booth 2023-08-12 16:52:41 +12:00 committed by Andrew Kaster
parent 21fe86d235
commit c25485700a
16 changed files with 30 additions and 30 deletions

View file

@ -50,7 +50,7 @@ void LocationEdit::highlight_location()
QList<QInputMethodEvent::Attribute> attributes;
if (url.is_valid() && !hasFocus()) {
if (url.scheme() == "http" || url.scheme() == "https" || url.scheme() == "gemini") {
int host_start = (url.scheme().length() + 3) - cursorPosition();
int host_start = (url.scheme().bytes_as_string_view().length() + 3) - cursorPosition();
auto host_length = url.serialized_host().release_value_but_fixme_should_propagate_errors().bytes().size();
// FIXME: Maybe add a generator to use https://publicsuffix.org/list/public_suffix_list.dat
@ -79,7 +79,7 @@ void LocationEdit::highlight_location()
attributes.append({
QInputMethodEvent::TextFormat,
-cursorPosition(),
static_cast<int>(url.scheme().length() + 3),
static_cast<int>(url.scheme().bytes_as_string_view().length() + 3),
schemeFormat,
});
}