2022-11-11 16:21:12 +00:00
|
|
|
// SPDX-FileCopyrightText: 2021 Devin Lin <devin@kde.org>
|
|
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
|
|
|
|
|
|
#include "mobileshellstateplugin.h"
|
2023-03-25 03:35:26 +00:00
|
|
|
#include "lockscreendbusclient.h"
|
2023-03-20 01:32:19 +00:00
|
|
|
#include "shelldbusclient.h"
|
|
|
|
|
#include "shelldbusobject.h"
|
2022-11-11 16:21:12 +00:00
|
|
|
|
|
|
|
|
#include <QQmlContext>
|
|
|
|
|
#include <QQuickItem>
|
|
|
|
|
|
|
|
|
|
QUrl resolvePath(std::string str)
|
|
|
|
|
{
|
|
|
|
|
return QUrl("qrc:/org/kde/plasma/private/mobileshell/state/qml/" + QString::fromStdString(str));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void MobileShellStatePlugin::registerTypes(const char *uri)
|
|
|
|
|
{
|
|
|
|
|
Q_ASSERT(QLatin1String(uri) == QLatin1String("org.kde.plasma.private.mobileshell.state"));
|
|
|
|
|
|
2023-03-20 01:32:19 +00:00
|
|
|
qmlRegisterSingletonType<ShellDBusClient>(uri, 1, 0, "ShellDBusClient", [](QQmlEngine *, QJSEngine *) -> QObject * {
|
|
|
|
|
return ShellDBusClient::self();
|
|
|
|
|
});
|
2023-03-20 04:10:14 +00:00
|
|
|
qmlRegisterSingletonType<ShellDBusObject>(uri, 1, 0, "ShellDBusObject", [](QQmlEngine *, QJSEngine *) -> QObject * {
|
|
|
|
|
return ShellDBusObject::self();
|
|
|
|
|
});
|
2023-03-25 03:35:26 +00:00
|
|
|
qmlRegisterSingletonType<LockscreenDBusClient>(uri, 1, 0, "LockscreenDBusClient", [](QQmlEngine *, QJSEngine *) -> QObject * {
|
|
|
|
|
return LockscreenDBusClient::self();
|
|
|
|
|
});
|
2022-11-11 16:21:12 +00:00
|
|
|
}
|