Port away from deprecated qmlRegisterType overload

wilder-5.24
Alexander Lohnau 4 years ago
parent 25f4cce3bf
commit b40d9267f9
  1. 2
      applets/kicker/plugin/kickerplugin.cpp
  2. 2
      components/shellprivate/shellprivateplugin.cpp
  3. 9
      kcms/colors/colors.cpp
  4. 2
      kcms/desktoptheme/kcm.cpp
  5. 9
      kcms/icons/main.cpp
  6. 6
      kcms/lookandfeel/kcm.cpp
  7. 7
      kcms/style/kcmstyle.cpp

@ -29,7 +29,7 @@ void KickerPlugin::registerTypes(const char *uri)
{
Q_ASSERT(QLatin1String(uri) == QLatin1String("org.kde.plasma.private.kicker"));
qmlRegisterType<AbstractModel>();
qmlRegisterAnonymousType<AbstractModel>("", 1);
qmlRegisterType<AppsModel>(uri, 0, 1, "AppsModel");
qmlRegisterType<ComputerModel>(uri, 0, 1, "ComputerModel");

@ -16,6 +16,6 @@ void PlasmaShellPrivatePlugin::registerTypes(const char *uri)
{
Q_ASSERT(uri == QLatin1String("org.kde.plasma.private.shell"));
qmlRegisterType<Plasma::Containment>();
qmlRegisterAnonymousType<Plasma::Containment>("", 1);
qmlRegisterType<WidgetExplorer>(uri, 2, 0, "WidgetExplorer");
}

@ -57,10 +57,11 @@ KCMColors::KCMColors(QObject *parent, const KPluginMetaData &data, const QVarian
, m_data(new ColorsData(this))
, m_config(KSharedConfig::openConfig(QStringLiteral("kdeglobals")))
{
qmlRegisterUncreatableType<KCMColors>("org.kde.private.kcms.colors", 1, 0, "KCM", QStringLiteral("Cannot create instances of KCM"));
qmlRegisterType<ColorsModel>();
qmlRegisterType<FilterProxyModel>();
qmlRegisterType<ColorsSettings>();
auto uri = "org.kde.private.kcms.colors";
qmlRegisterUncreatableType<KCMColors>(uri, 1, 0, "KCM", QStringLiteral("Cannot create instances of KCM"));
qmlRegisterAnonymousType<ColorsModel>(uri, 1);
qmlRegisterAnonymousType<FilterProxyModel>(uri, 1);
qmlRegisterAnonymousType<ColorsSettings>(uri, 1);
KAboutData *about = new KAboutData(QStringLiteral("kcm_colors"), i18n("Colors"), QStringLiteral("2.0"), QString(), KAboutLicense::GPL);

@ -44,7 +44,7 @@ KCMDesktopTheme::KCMDesktopTheme(QObject *parent, const KPluginMetaData &data, c
, m_filteredModel(new FilterProxyModel(this))
, m_haveThemeExplorerInstalled(false)
{
qmlRegisterType<DesktopThemeSettings>();
qmlRegisterAnonymousType<DesktopThemeSettings>("org.kde.private.kcms.desktoptheme", 1);
qmlRegisterUncreatableType<ThemesModel>("org.kde.private.kcms.desktoptheme", 1, 0, "ThemesModel", "Cannot create ThemesModel");
qmlRegisterUncreatableType<FilterProxyModel>("org.kde.private.kcms.desktoptheme", 1, 0, "FilterProxyModel", "Cannot create FilterProxyModel");

@ -59,12 +59,13 @@ IconModule::IconModule(QObject *parent, const KPluginMetaData &data, const QVari
, m_model(new IconsModel(m_data->settings(), this))
, m_iconSizeCategoryModel(new IconSizeCategoryModel(this))
{
qmlRegisterType<IconsSettings>();
qmlRegisterType<IconsModel>();
qmlRegisterType<IconSizeCategoryModel>();
auto uri = "org.kde.private.kcms.icons";
qmlRegisterAnonymousType<IconsSettings>(uri, 1);
qmlRegisterAnonymousType<IconsModel>(uri, 1);
qmlRegisterAnonymousType<IconSizeCategoryModel>(uri, 1);
// to be able to access its enums
qmlRegisterUncreatableType<KIconLoader>("org.kde.private.kcms.icons", 1, 0, "KIconLoader", QString());
qmlRegisterUncreatableType<KIconLoader>(uri, 1, 0, "KIconLoader", QString());
KAboutData *about = new KAboutData(QStringLiteral("kcm5_icons"),
i18n("Icons"),

@ -57,9 +57,9 @@ KCMLookandFeel::KCMLookandFeel(QObject *parent, const KPluginMetaData &data, con
: KQuickAddons::ManagedConfigModule(parent, data, args)
, m_lnf(new LookAndFeelManager(this))
{
qmlRegisterType<LookAndFeelSettings>();
qmlRegisterType<QStandardItemModel>();
qmlRegisterType<KCMLookandFeel>();
qmlRegisterAnonymousType<LookAndFeelSettings>("", 1);
qmlRegisterAnonymousType<QStandardItemModel>("", 1);
qmlRegisterAnonymousType<KCMLookandFeel>("", 1);
KAboutData *about = new KAboutData(QStringLiteral("kcm_lookandfeel"), i18n("Global Theme"), QStringLiteral("0.1"), QString(), KAboutLicense::LGPL);
about->addAuthor(i18n("Marco Martin"), QString(), QStringLiteral("mart@kde.org"));

@ -70,9 +70,10 @@ KCMStyle::KCMStyle(QObject *parent, const KPluginMetaData &data, const QVariantL
, m_data(new StyleData(this))
, m_model(new StylesModel(this))
{
qmlRegisterUncreatableType<KCMStyle>("org.kde.private.kcms.style", 1, 0, "KCM", QStringLiteral("Cannot create instances of KCM"));
qmlRegisterType<StyleSettings>();
qmlRegisterType<StylesModel>();
auto uri = "org.kde.private.kcms.style";
qmlRegisterUncreatableType<KCMStyle>(uri, 1, 0, "KCM", QStringLiteral("Cannot create instances of KCM"));
qmlRegisterAnonymousType<StyleSettings>(uri, 1);
qmlRegisterAnonymousType<StylesModel>(uri, 1);
qmlRegisterType<PreviewItem>("org.kde.private.kcms.style", 1, 0, "PreviewItem");
KAboutData *about = new KAboutData(QStringLiteral("kcm_style"),

Loading…
Cancel
Save