2020-05-05 12:53:41 +01:00
|
|
|
/**
|
2020-08-17 10:48:10 +01:00
|
|
|
* SPDX-FileCopyrightText: 2020 Aditya Mehra <aix.m@outlook.com>
|
2020-05-05 12:53:41 +01:00
|
|
|
*
|
2020-08-17 10:48:10 +01:00
|
|
|
* SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
|
2020-05-05 12:53:41 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "bigscreenplugin.h"
|
|
|
|
|
|
|
|
#include <KLocalizedString>
|
|
|
|
#include <KPluginFactory>
|
|
|
|
|
|
|
|
#include <QDBusConnection>
|
2022-09-10 22:23:52 +01:00
|
|
|
#include <QDebug>
|
2020-05-05 12:53:41 +01:00
|
|
|
#include <QLoggingCategory>
|
|
|
|
|
|
|
|
#include <core/daemon.h>
|
2022-09-10 22:23:52 +01:00
|
|
|
#include <core/device.h>
|
2020-05-05 12:53:41 +01:00
|
|
|
|
|
|
|
K_PLUGIN_CLASS_WITH_JSON(BigscreenPlugin, "kdeconnect_bigscreen.json")
|
|
|
|
|
2023-07-31 08:25:45 +01:00
|
|
|
void BigscreenPlugin::receivePacket(const NetworkPacket &np)
|
2020-05-05 12:53:41 +01:00
|
|
|
{
|
|
|
|
QString message = np.get<QString>(QStringLiteral("content"));
|
2020-11-14 03:32:21 +00:00
|
|
|
/* Emit a signal that will be consumed by Plasma BigScreen:
|
|
|
|
* https://invent.kde.org/plasma/plasma-bigscreen/-/blob/master/containments/homescreen/package/contents/ui/indicators/KdeConnect.qml
|
|
|
|
*/
|
2020-05-05 12:53:41 +01:00
|
|
|
Q_EMIT messageReceived(message);
|
|
|
|
}
|
|
|
|
|
|
|
|
QString BigscreenPlugin::dbusPath() const
|
|
|
|
{
|
2023-08-12 12:26:05 +01:00
|
|
|
return QLatin1String("/modules/kdeconnect/devices/%1/bigscreen").arg(device()->id());
|
2020-05-05 12:53:41 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
#include "bigscreenplugin.moc"
|
2023-07-26 09:15:11 +01:00
|
|
|
#include "moc_bigscreenplugin.cpp"
|