2015-09-11 16:51:50 +01:00
|
|
|
/**
|
2020-08-17 10:48:10 +01:00
|
|
|
* SPDX-FileCopyrightText: 2014 Apoorv Parle <apparle@gmail.com>
|
|
|
|
* SPDX-FileCopyrightText: 2015 David Edmundson <davidedmundson@kde.org>
|
2015-09-11 16:51:50 +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
|
2015-09-11 16:51:50 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "findmyphoneplugin.h"
|
|
|
|
|
|
|
|
#include <QDBusConnection>
|
|
|
|
#include <QDebug>
|
|
|
|
|
|
|
|
#include <KPluginFactory>
|
|
|
|
|
2019-06-12 21:16:54 +01:00
|
|
|
K_PLUGIN_CLASS_WITH_JSON(FindMyPhonePlugin, "kdeconnect_findmyphone.json")
|
2015-09-11 16:51:50 +01:00
|
|
|
|
2022-09-10 22:23:52 +01:00
|
|
|
FindMyPhonePlugin::FindMyPhonePlugin(QObject *parent, const QVariantList &args)
|
|
|
|
: KdeConnectPlugin(parent, args)
|
2015-09-11 16:51:50 +01:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
FindMyPhonePlugin::~FindMyPhonePlugin()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2022-09-10 22:23:52 +01:00
|
|
|
bool FindMyPhonePlugin::receivePacket(const NetworkPacket &np)
|
2015-09-11 16:51:50 +01:00
|
|
|
{
|
2015-09-12 11:37:05 +01:00
|
|
|
Q_UNUSED(np);
|
2015-09-11 16:51:50 +01:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
void FindMyPhonePlugin::ring()
|
|
|
|
{
|
2018-03-04 19:48:51 +00:00
|
|
|
NetworkPacket np(PACKET_TYPE_FINDMYPHONE_REQUEST);
|
|
|
|
sendPacket(np);
|
2015-09-11 16:51:50 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
QString FindMyPhonePlugin::dbusPath() const
|
|
|
|
{
|
2019-06-10 15:40:28 +01:00
|
|
|
return QString::fromLatin1("/modules/kdeconnect/devices/") + device()->id() + QString::fromLatin1("/findmyphone");
|
2015-09-11 16:51:50 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
#include "findmyphoneplugin.moc"
|