File indexing completed on 2024-04-28 08:49:06

0001 /**
0002  * SPDX-FileCopyrightText: 2020 Aditya Mehra <aix.m@outlook.com>
0003  *
0004  * SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0005  */
0006 
0007 #include "bigscreenplugin.h"
0008 
0009 #include <KLocalizedString>
0010 #include <KPluginFactory>
0011 
0012 #include <QDBusConnection>
0013 #include <QDebug>
0014 #include <QLoggingCategory>
0015 
0016 #include <core/daemon.h>
0017 #include <core/device.h>
0018 
0019 K_PLUGIN_CLASS_WITH_JSON(BigscreenPlugin, "kdeconnect_bigscreen.json")
0020 
0021 void BigscreenPlugin::receivePacket(const NetworkPacket &np)
0022 {
0023     QString message = np.get<QString>(QStringLiteral("content"));
0024     /* Emit a signal that will be consumed by Plasma BigScreen:
0025      * https://invent.kde.org/plasma/plasma-bigscreen/-/blob/master/containments/homescreen/package/contents/ui/indicators/KdeConnect.qml
0026      */
0027     Q_EMIT messageReceived(message);
0028 }
0029 
0030 QString BigscreenPlugin::dbusPath() const
0031 {
0032     return QLatin1String("/modules/kdeconnect/devices/%1/bigscreen").arg(device()->id());
0033 }
0034 
0035 #include "bigscreenplugin.moc"
0036 #include "moc_bigscreenplugin.cpp"