mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 10:27:34 +00:00
Ladybird: Add a utility to create a QString from an AK::String
This commit is contained in:
parent
fc15968418
commit
b4d3fea002
2 changed files with 7 additions and 0 deletions
|
@ -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());
|
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()
|
void platform_init()
|
||||||
{
|
{
|
||||||
#ifdef AK_OS_ANDROID
|
#ifdef AK_OS_ANDROID
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
AK::DeprecatedString ak_deprecated_string_from_qstring(QString const&);
|
AK::DeprecatedString ak_deprecated_string_from_qstring(QString const&);
|
||||||
ErrorOr<String> ak_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_deprecated_string(AK::DeprecatedString const&);
|
||||||
|
QString qstring_from_ak_string(String const&);
|
||||||
void platform_init();
|
void platform_init();
|
||||||
|
|
||||||
extern DeprecatedString s_serenity_resource_root;
|
extern DeprecatedString s_serenity_resource_root;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue