Commit b2773580 authored by Volker Krause's avatar Volker Krause
Browse files

Port to qmlRegisterAnonymousType()

See kwin!2155.
parent 8240372b
Pipeline #159170 passed with stage
in 4 minutes and 9 seconds
......@@ -172,7 +172,7 @@ FolderModel::FolderModel(QObject *parent)
connect(DragTracker::self(), &DragTracker::dragInProgressChanged, this, &FolderModel::draggingChanged);
connect(DragTracker::self(), &DragTracker::dragInProgressChanged, this, &FolderModel::dragInProgressAnywhereChanged);
// needed to pass the job around with qml
qmlRegisterType<KIO::DropJob>();
qmlRegisterAnonymousType<KIO::DropJob>("org.kde.private.desktopcontainment.folder", 0);
DirLister *dirLister = new DirLister(this);
dirLister->setDelayedMimeTypes(true);
dirLister->setAutoErrorHandlingEnabled(false);
......
......@@ -142,11 +142,11 @@ KAccessConfig::KAccessConfig(QObject *parent, const KPluginMetaData &metaData, c
, m_data(new AccessibilityData(this))
, m_desktopShortcutInfo(QX11Info::isPlatformX11() ? mouseKeysShortcut(QX11Info::display()) : QString())
{
qmlRegisterType<MouseSettings>();
qmlRegisterType<BellSettings>();
qmlRegisterType<KeyboardSettings>();
qmlRegisterType<KeyboardFiltersSettings>();
qmlRegisterType<ScreenReaderSettings>();
qmlRegisterAnonymousType<MouseSettings>("org.kde.plasma.access.kcm", 0);
qmlRegisterAnonymousType<BellSettings>("org.kde.plasma.access.kcm", 0);
qmlRegisterAnonymousType<KeyboardSettings>("org.kde.plasma.access.kcm", 0);
qmlRegisterAnonymousType<KeyboardFiltersSettings>("org.kde.plasma.access.kcm", 0);
qmlRegisterAnonymousType<ScreenReaderSettings>("org.kde.plasma.access.kcm", 0);
int tryOrcaRun = QProcess::execute(QStringLiteral("orca"), {QStringLiteral("--version")});
m_screenReaderInstalled = tryOrcaRun != -2;
......
......@@ -49,8 +49,8 @@ ServerConfigModule::ServerConfigModule(QObject *parent, const QVariantList &args
, m_data(new BalooData(this))
, m_filteredFolderModel(new FilteredFolderModel(m_data->settings(), this))
{
qmlRegisterType<FilteredFolderModel>();
qmlRegisterType<BalooSettings>();
qmlRegisterAnonymousType<FilteredFolderModel>("org.kde.plasma.baloo.kcm", 0);
qmlRegisterAnonymousType<BalooSettings>("org.kde.plasma.baloo.kcm", 0);
KAboutData *about = new KAboutData(QStringLiteral("kcm_baloofile"),
i18n("File Search"),
......
......@@ -41,9 +41,8 @@ KDEDConfig::KDEDConfig(QObject *parent, const QVariantList &args)
, m_kdedWatcher(new QDBusServiceWatcher(s_kdedServiceName, QDBusConnection::sessionBus(), QDBusServiceWatcher::WatchForOwnerChange, this))
{
qmlRegisterUncreatableType<KDEDConfig>("org.kde.private.kcms.style", 1, 0, "KCM", QStringLiteral("Cannot create instances of KCM"));
// FIXME Qt 5.14 qmlRegisterAnonymousType
qmlRegisterType<ModulesModel>();
qmlRegisterType<FilterProxyModel>();
qmlRegisterAnonymousType<ModulesModel>("org.kde.plasma.kded.kcm", 0);
qmlRegisterAnonymousType<FilterProxyModel>("org.kde.plasma.kded.kcm", 0);
KAboutData *about = new KAboutData(QStringLiteral("kcm5_kded"),
i18n("Background Services"),
......
......@@ -33,8 +33,8 @@ KCMSplashScreen::KCMSplashScreen(QObject *parent, const QVariantList &args)
, m_data(new SplashScreenData(this))
, m_model(new QStandardItemModel(this))
{
qmlRegisterType<SplashScreenSettings>();
qmlRegisterType<QStandardItemModel>();
qmlRegisterAnonymousType<SplashScreenSettings>("org.kde.plasma.splash.kcm", 0);
qmlRegisterAnonymousType<QStandardItemModel>("org.kde.plasma.splash.kcm", 0);
KAboutData *about = new KAboutData(QStringLiteral("kcm_splashscreen"), i18n("Splash Screen"), QStringLiteral("0.1"), QString(), KAboutLicense::LGPL);
about->addAuthor(i18n("Marco Martin"), QString(), QStringLiteral("mart@kde.org"));
......
......@@ -160,12 +160,12 @@ KCMLandingPage::KCMLandingPage(QObject *parent, const QVariantList &args)
: KQuickAddons::ManagedConfigModule(parent, args)
, m_data(new LandingPageData(this))
{
qmlRegisterType<LandingPageGlobalsSettings>();
qmlRegisterAnonymousType<LandingPageGlobalsSettings>("org.kde.plasma.landingpage.kcm", 0);
#if HAVE_KUSERFEEDBACK
qmlRegisterType<FeedbackSettings>();
qmlRegisterAnonymousType<FeedbackSettings>("org.kde.plasma.landingpage.kcm", 0);
#endif
qmlRegisterType<MostUsedModel>();
qmlRegisterType<LookAndFeelGroup>();
qmlRegisterAnonymousType<MostUsedModel>("org.kde.plasma.landingpage.kcm", 0);
qmlRegisterAnonymousType<LookAndFeelGroup>("org.kde.plasma.landingpage.kcm", 0);
KAboutData *about = new KAboutData(QStringLiteral("kcm_landingpage"),
i18n("Quick Settings"),
......
......@@ -32,7 +32,7 @@ KRunnerSettings::KRunnerSettings(QObject *parent, const KPluginMetaData &metaDat
, m_historyKeys(m_historyConfigGroup.keyList())
, m_doesShowPluginButton(args.isEmpty() || args.constFirst() != QLatin1String("openedFromPluginSettings"))
{
qmlRegisterType<KRunnerSettingsBase>();
qmlRegisterAnonymousType<KRunnerSettingsBase>("org.kde.plasma.runners.kcm", 0);
setButtons(Apply | Default);
......
......@@ -24,8 +24,8 @@ KCMWorkspaceOptions::KCMWorkspaceOptions(QObject *parent, const QVariantList &ar
: KQuickAddons::ManagedConfigModule(parent, args)
, m_data(new WorkspaceOptionsData(this))
{
qmlRegisterType<WorkspaceOptionsGlobalsSettings>();
qmlRegisterType<WorkspaceOptionsPlasmaSettings>();
qmlRegisterAnonymousType<WorkspaceOptionsGlobalsSettings>("org.kde.plasma.workspaceoptions.kcm", 0);
qmlRegisterAnonymousType<WorkspaceOptionsPlasmaSettings>("org.kde.plasma.workspaceoptions.kcm", 0);
KAboutData *about = new KAboutData(QStringLiteral("kcm_workspace"),
i18n("General Behavior"),
......
Supports Markdown
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