File indexing completed on 2025-01-26 05:07:37
0001 /* 0002 SPDX-FileCopyrightText: 2014 Martin Klapetek <mklapetek@kde.org> 0003 0004 SPDX-License-Identifier: LGPL-2.1-or-later 0005 */ 0006 0007 #include "digitalclockplugin.h" 0008 #include "applicationintegration.h" 0009 #include "clipboardmenu.h" 0010 #include "timezonemodel.h" 0011 #include "timezonesi18n.h" 0012 0013 #include <QQmlEngine> 0014 0015 static QObject *timezonesi18n_singletontype_provider(QQmlEngine *engine, QJSEngine *scriptEngine) 0016 { 0017 Q_UNUSED(engine) 0018 Q_UNUSED(scriptEngine) 0019 0020 return new TimezonesI18n(); 0021 } 0022 0023 static QObject *clipboardMenu_singletontype_provider(QQmlEngine *engine, QJSEngine *scriptEngine) 0024 { 0025 Q_UNUSED(engine); 0026 Q_UNUSED(scriptEngine); 0027 0028 return new ClipboardMenu(); 0029 } 0030 0031 void DigitalClockPlugin::registerTypes(const char *uri) 0032 { 0033 Q_ASSERT(uri == QLatin1String("org.kde.plasma.private.digitalclock")); 0034 0035 qmlRegisterType<TimeZoneModel>(uri, 1, 0, "TimeZoneModel"); 0036 qmlRegisterType<TimeZoneFilterProxy>(uri, 1, 0, "TimeZoneFilterProxy"); 0037 qmlRegisterSingletonType<TimezonesI18n>(uri, 1, 0, "TimezonesI18n", timezonesi18n_singletontype_provider); 0038 0039 qmlRegisterSingletonType<ClipboardMenu>(uri, 1, 0, "ClipboardMenu", clipboardMenu_singletontype_provider); 0040 0041 qmlRegisterSingletonType<ApplicationIntegration>(uri, 1, 0, "ApplicationIntegration", [](QQmlEngine *engine, QJSEngine *scriptEngine) { 0042 Q_UNUSED(engine); 0043 Q_UNUSED(scriptEngine); 0044 return new ApplicationIntegration(); 0045 }); 0046 }