File indexing completed on 2024-04-28 16:43:18

0001 /*
0002     SPDX-FileCopyrightText: 2014 David Rosca <nowrep@gmail.com>
0003 
0004     SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0005 */
0006 
0007 #include "bluetoothplugin.h"
0008 #include "devicesproxymodel.h"
0009 #include "launchapp.h"
0010 #include "notify.h"
0011 
0012 #include <QQmlEngine>
0013 
0014 static QObject *notify_singleton(QQmlEngine *engine, QJSEngine *scriptEngine)
0015 {
0016     Q_UNUSED(engine)
0017     Q_UNUSED(scriptEngine)
0018 
0019     return new Notify;
0020 }
0021 
0022 static QObject *launchapp_singleton(QQmlEngine *engine, QJSEngine *scriptEngine)
0023 {
0024     Q_UNUSED(engine)
0025     Q_UNUSED(scriptEngine)
0026 
0027     return new LaunchApp;
0028 }
0029 
0030 void BluetoothPlugin::registerTypes(const char *uri)
0031 {
0032     Q_ASSERT(uri == QLatin1String("org.kde.plasma.private.bluetooth"));
0033 
0034     qmlRegisterSingletonType<Notify>(uri, 1, 0, "Notify", notify_singleton);
0035     qmlRegisterSingletonType<LaunchApp>(uri, 1, 0, "LaunchApp", launchapp_singleton);
0036     qmlRegisterType<DevicesProxyModel>(uri, 1, 0, "DevicesProxyModel");
0037 }