mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-11 13:36:13 +03:00
Ladybird: Add a utility to create a QString from an AK::String
This commit is contained in:
parent
fc15968418
commit
b4d3fea002
Notes:
sideshowbarker
2024-07-17 03:18:29 +09:00
Author: https://github.com/trflynn89 Commit: https://github.com/SerenityOS/serenity/commit/b4d3fea002 Pull-request: https://github.com/SerenityOS/serenity/pull/17841 Reviewed-by: https://github.com/gmta Reviewed-by: https://github.com/linusg ✅
@ -29,6 +29,12 @@ QString qstring_from_ak_deprecated_string(AK::DeprecatedString const& ak_depreca
|
||||
return QString::fromUtf8(ak_deprecated_string.characters(), ak_deprecated_string.length());
|
||||
}
|
||||
|
||||
QString qstring_from_ak_string(String const& ak_string)
|
||||
{
|
||||
auto view = ak_string.bytes_as_string_view();
|
||||
return QString::fromUtf8(view.characters_without_null_termination(), view.length());
|
||||
}
|
||||
|
||||
void platform_init()
|
||||
{
|
||||
#ifdef AK_OS_ANDROID
|
||||
|
@ -13,6 +13,7 @@
|
||||
AK::DeprecatedString ak_deprecated_string_from_qstring(QString const&);
|
||||
ErrorOr<String> ak_string_from_qstring(QString const&);
|
||||
QString qstring_from_ak_deprecated_string(AK::DeprecatedString const&);
|
||||
QString qstring_from_ak_string(String const&);
|
||||
void platform_init();
|
||||
|
||||
extern DeprecatedString s_serenity_resource_root;
|
||||
|
Loading…
Reference in New Issue
Block a user