Create the OSM QtLocation plugin only once

Just loading that plugin already triggers an HTTP request, so lets only
do that when really needed and even more importantly, not for every single
location delegate again.
This commit is contained in:
Volker Krause
2023-06-08 18:14:07 +02:00
parent 105be518c7
commit 7c75a2fd06
4 changed files with 24 additions and 11 deletions

View File

@@ -283,6 +283,7 @@ int main(int argc, char *argv[])
qmlRegisterSingletonType("org.kde.neochat", 1, 0, "About", [](QQmlEngine *engine, QJSEngine *) -> QJSValue {
return engine->toScriptValue(KAboutData::applicationData());
});
qmlRegisterSingletonType(QUrl("qrc:/OsmLocationPlugin.qml"), "org.kde.neochat", 1, 0, "OsmLocationPlugin");
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
qRegisterMetaTypeStreamOperators<Emoji>();