Skip to content

Commit

Permalink
need size() to be compatible with QLatin1String
Browse files Browse the repository at this point in the history
  • Loading branch information
mnutt committed Jan 13, 2024
1 parent a9606c2 commit 1627146
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
4 changes: 2 additions & 2 deletions Source/WTF/wtf/text/WTFString.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
QT_BEGIN_NAMESPACE
class QString;
class QStringView;
class QLatin1StringView;
class QLatin1String;
class QByteArrayView;
QT_END_NAMESPACE
#endif
Expand Down Expand Up @@ -263,7 +263,7 @@ class String final {

#if PLATFORM(QT)
WTF_EXPORT_PRIVATE String(const QString&);
WTF_EXPORT_PRIVATE String(QLatin1StringView);
WTF_EXPORT_PRIVATE String(QLatin1String);
WTF_EXPORT_PRIVATE String(QStringView);
WTF_EXPORT_PRIVATE String(QByteArrayView);
WTF_EXPORT_PRIVATE operator QString() const;
Expand Down
9 changes: 2 additions & 7 deletions Source/WTF/wtf/text/qt/StringQt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,7 @@
#include <QString>
#include <QStringView>
#include <QByteArrayView>
#if QT_VERSION >= QT_VERSION_CHECK(6, 4, 0)
#include <QLatin1StringView>
#else
#include <QLatin1String>
using QLatin1StringView = QLatin1String;
#endif
#include <wtf/StdLibExtras.h>
#include <wtf/text/WTFString.h>

Expand All @@ -47,11 +42,11 @@ String::String(const QString& qstr)
m_impl = StringImpl::create(reinterpret_cast_ptr<const UChar*>(qstr.constData()), qstr.length());
}

String::String(QLatin1StringView view)
String::String(QLatin1String view)
{
if (view.isNull())
return;
m_impl = StringImpl::create(reinterpret_cast_ptr<const LChar*>(view.data()), view.length());
m_impl = StringImpl::create(reinterpret_cast_ptr<const LChar*>(view.data()), view.size());
}

String::String(QStringView view)
Expand Down

0 comments on commit 1627146

Please sign in to comment.