mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-25 17:10:23 +00:00
Ladybird: Add ak_string_from_qstring
function
This will be used later when doing the conversion from the QString in QSettings for the homepage URL.
This commit is contained in:
parent
4be6ee85e0
commit
65cf562a71
Notes:
sideshowbarker
2024-07-17 05:58:46 +09:00
Author: https://github.com/martinfalisse Commit: https://github.com/SerenityOS/serenity/commit/65cf562a71 Pull-request: https://github.com/SerenityOS/serenity/pull/16947 Reviewed-by: https://github.com/linusg
2 changed files with 7 additions and 0 deletions
|
@ -19,6 +19,11 @@ AK::DeprecatedString ak_deprecated_string_from_qstring(QString const& qstring)
|
|||
return AK::DeprecatedString(qstring.toUtf8().data());
|
||||
}
|
||||
|
||||
ErrorOr<String> ak_string_from_qstring(QString const& qstring)
|
||||
{
|
||||
return String::from_utf8(StringView(qstring.toUtf8().data(), qstring.size()));
|
||||
}
|
||||
|
||||
QString qstring_from_ak_deprecated_string(AK::DeprecatedString const& ak_deprecated_string)
|
||||
{
|
||||
return QString::fromUtf8(ak_deprecated_string.characters(), ak_deprecated_string.length());
|
||||
|
|
|
@ -7,9 +7,11 @@
|
|||
#pragma once
|
||||
|
||||
#include <AK/DeprecatedString.h>
|
||||
#include <AK/String.h>
|
||||
#include <QString>
|
||||
|
||||
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&);
|
||||
void platform_init();
|
||||
|
||||
|
|
Loading…
Reference in a new issue