forked from qt-creator/qt-creator
LSP: Fix compilation with Qt 6.2.4
Change-Id: I1f81d35529317107c63727a92d940a3991ddc59d Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -17,12 +17,12 @@ JsonObject &JsonObject::operator=(JsonObject &&other)
|
|||||||
|
|
||||||
QJsonObject::iterator JsonObject::insert(const std::string_view key, const JsonObject &object)
|
QJsonObject::iterator JsonObject::insert(const std::string_view key, const JsonObject &object)
|
||||||
{
|
{
|
||||||
return m_jsonObject.insert(QLatin1String(key), object.m_jsonObject);
|
return m_jsonObject.insert(QLatin1String(key.data()), object.m_jsonObject);
|
||||||
}
|
}
|
||||||
|
|
||||||
QJsonObject::iterator JsonObject::insert(const std::string_view key, const QJsonValue &value)
|
QJsonObject::iterator JsonObject::insert(const std::string_view key, const QJsonValue &value)
|
||||||
{
|
{
|
||||||
return m_jsonObject.insert(QLatin1String(key), value);
|
return m_jsonObject.insert(QLatin1String(key.data()), value);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace LanguageServerProtocol
|
} // namespace LanguageServerProtocol
|
||||||
|
@@ -52,11 +52,11 @@ protected:
|
|||||||
iterator insertVariant(const std::string_view key, const V &variant);
|
iterator insertVariant(const std::string_view key, const V &variant);
|
||||||
|
|
||||||
// QJSonObject redirections
|
// QJSonObject redirections
|
||||||
QJsonValue value(const std::string_view key) const { return m_jsonObject.value(QLatin1String(key)); }
|
QJsonValue value(const std::string_view key) const { return m_jsonObject.value(QLatin1String(key.data())); }
|
||||||
bool contains(const std::string_view key) const { return m_jsonObject.contains(QLatin1String(key)); }
|
bool contains(const std::string_view key) const { return m_jsonObject.contains(QLatin1String(key.data())); }
|
||||||
iterator find(const std::string_view key) { return m_jsonObject.find(QLatin1String(key)); }
|
iterator find(const std::string_view key) { return m_jsonObject.find(QLatin1String(key.data())); }
|
||||||
const_iterator find(const std::string_view key) const { return m_jsonObject.find(QLatin1String(key)); }
|
const_iterator find(const std::string_view key) const { return m_jsonObject.find(QLatin1String(key.data())); }
|
||||||
void remove(const std::string_view key) { m_jsonObject.remove(QLatin1String(key)); }
|
void remove(const std::string_view key) { m_jsonObject.remove(QLatin1String(key.data())); }
|
||||||
QStringList keys() const { return m_jsonObject.keys(); }
|
QStringList keys() const { return m_jsonObject.keys(); }
|
||||||
|
|
||||||
// convenience value access
|
// convenience value access
|
||||||
@@ -129,7 +129,7 @@ QList<T> JsonObject::array(const std::string_view key) const
|
|||||||
if (const std::optional<QList<T>> &array = optionalArray<T>(key))
|
if (const std::optional<QList<T>> &array = optionalArray<T>(key))
|
||||||
return *array;
|
return *array;
|
||||||
qCDebug(conversionLog) << QString("Expected array under %1 in:")
|
qCDebug(conversionLog) << QString("Expected array under %1 in:")
|
||||||
.arg(QLatin1String(key)) << *this;
|
.arg(QLatin1String(key.data())) << *this;
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user