Commit f32965ea authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Make it compile without qt deprecated method

Summary: Compile without deprecated qt5.x method

Reviewers: apol

Reviewed By: apol

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D25729
parent b69636a6
......@@ -55,7 +55,6 @@ void DiscoverDeclarativePlugin::initializeEngine(QQmlEngine* engine, const char*
void DiscoverDeclarativePlugin::registerTypes(const char* /*uri*/)
{
qmlRegisterType<TransactionListener>("org.kde.discover", 2, 0, "TransactionListener");
qmlRegisterType<TransactionModel>();
qmlRegisterType<ResourcesUpdatesModel>("org.kde.discover", 2, 0, "ResourcesUpdatesModel");
qmlRegisterType<ResourcesProxyModel>("org.kde.discover", 2, 0, "ResourcesProxyModel");
......@@ -72,11 +71,21 @@ void DiscoverDeclarativePlugin::registerTypes(const char* /*uri*/)
qmlRegisterUncreatableType<Transaction>("org.kde.discover", 2, 0, "Transaction", QStringLiteral("should come from the backends"));
qmlRegisterUncreatableType<SourcesModel>("org.kde.discover", 2, 0, "SourcesModelClass", QStringLiteral("should come from the backends"));
qmlRegisterUncreatableType<SourcesModel>("org.kde.discover", 2, 0, "AbstractBackendUpdater", QStringLiteral("should come from the backends"));
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
qmlRegisterType<TransactionModel>();
qmlRegisterType<Rating>();
qmlRegisterType<AbstractResourcesBackend>();
qmlRegisterType<AbstractReviewsBackend>();
qmlRegisterType<Category>();
qmlRegisterType<ResourcesModel>();
#else
qmlRegisterAnonymousType<TransactionModel>("org.kde.discover", 1);
qmlRegisterAnonymousType<Rating>("org.kde.discover", 1);
qmlRegisterAnonymousType<AbstractResourcesBackend>("org.kde.discover", 1);
qmlRegisterAnonymousType<AbstractReviewsBackend>("org.kde.discover", 1);
qmlRegisterAnonymousType<Category>("org.kde.discover", 1);
qmlRegisterAnonymousType<ResourcesModel>("org.kde.discover", 1);
#endif
qmlProtectModule("org.kde.discover", 2);
qRegisterMetaType<QList<QAction*>>();
}
......@@ -123,6 +123,7 @@ DiscoverObject::DiscoverObject(CompactMode mode, const QVariantMap &initialPrope
connect(r, &DiscoverSettings::appsListPageSortingChanged, r, &DiscoverSettings::save);
return r;
});
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
qmlRegisterType<QQuickView>();
qmlRegisterType<QActionGroup>();
qmlRegisterType<QAction>();
......@@ -130,6 +131,16 @@ DiscoverObject::DiscoverObject(CompactMode mode, const QVariantMap &initialPrope
qmlRegisterType<KAboutData>();
qmlRegisterType<KAboutLicense>();
qmlRegisterType<KAboutPerson>();
#else
qmlRegisterAnonymousType<QQuickView>("org.kde.discover.app", 1);
qmlRegisterAnonymousType<QActionGroup>("org.kde.discover.app", 1);
qmlRegisterAnonymousType<QAction>("org.kde.discover.app", 1);
qmlRegisterAnonymousType<KAboutData>("org.kde.discover.app", 1);
qmlRegisterAnonymousType<KAboutLicense>("org.kde.discover.app", 1);
qmlRegisterAnonymousType<KAboutPerson>("org.kde.discover.app", 1);
#endif
qmlRegisterUncreatableType<DiscoverObject>("org.kde.discover.app", 1, 0, "DiscoverMainWindow", QStringLiteral("don't do that"));
setupActions();
......
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