Commit bd18edf7 authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧
Browse files

Port away from deprecated functions from Qt 5.14

parent dd263acd
......@@ -125,7 +125,12 @@ int main(int argc, char **argv)
auto iconModel = new CuttleFish::IconModel(engine.rootContext());
engine.rootContext()->setContextProperty("iconModel", iconModel);
engine.rootContext()->setContextProperty("pickerMode", parser.isSet("picker"));
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
qmlRegisterType<CuttleFish::IconModel>();
#else
qmlRegisterAnonymousType<CuttleFish::IconModel>("org.kde.plasma.sdk", 1);
#endif
return app.exec();
}
......@@ -62,8 +62,13 @@ int main(int argc, char **argv)
obj.engine()->rootContext()->setContextProperty("commandlineArguments", parser.positionalArguments());
obj.loadPackage(packagePath);
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
qmlRegisterType<LnfLogic>();
qmlRegisterType<LnfListModel>();
#else
qmlRegisterAnonymousType<LnfLogic>("org.kde.plasma.sdk", 1);
qmlRegisterAnonymousType<LnfListModel>("org.kde.plasma.sdk", 1);
#endif
LnfLogic *lnfLogic = new LnfLogic(&obj);
obj.engine()->rootContext()->setContextProperty("lnfLogic", QVariant::fromValue(lnfLogic));
......
......@@ -65,8 +65,13 @@ int main(int argc, char **argv)
QObject::connect(obj->engine(), &QQmlEngine::quit, &app, &QApplication::quit);
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
qmlRegisterType<ThemeListModel>();
qmlRegisterType<ColorEditor>();
#else
qmlRegisterAnonymousType<ThemeListModel>("org.kde.plasma.sdk", 1);
qmlRegisterAnonymousType<ColorEditor>("org.kde.plasma.sdk", 1);
#endif
ThemeModel *themeModel = new ThemeModel(obj->package());
if (parser.isSet(themeOption)) {
themeModel->setTheme(parser.value(themeOption));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment