kdeconnect-kde/plugins/findmyphone/findmyphoneplugin.cpp
Alexander Lohnau 1631ada5b3 Simplify KDEConnectPlugin::recievePacket
- We do not need the return type. If a plugin declares it can handle the
  packet it should do so. We don't have any fallback logic in place and
  the packet types are namespaced with the plugin IDs anyway.

- Provide a default implementation with a warning, not all plugins need
  to overwrite this
2023-08-03 20:49:44 +02:00

34 lines
890 B
C++

/**
* SPDX-FileCopyrightText: 2014 Apoorv Parle <apparle@gmail.com>
* SPDX-FileCopyrightText: 2015 David Edmundson <davidedmundson@kde.org>
*
* SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
*/
#include "findmyphoneplugin.h"
#include <QDBusConnection>
#include <QDebug>
#include <KPluginFactory>
K_PLUGIN_CLASS_WITH_JSON(FindMyPhonePlugin, "kdeconnect_findmyphone.json")
FindMyPhonePlugin::FindMyPhonePlugin(QObject *parent, const QVariantList &args)
: KdeConnectPlugin(parent, args)
{
}
void FindMyPhonePlugin::ring()
{
NetworkPacket np(PACKET_TYPE_FINDMYPHONE_REQUEST);
sendPacket(np);
}
QString FindMyPhonePlugin::dbusPath() const
{
return QString::fromLatin1("/modules/kdeconnect/devices/") + device()->id() + QString::fromLatin1("/findmyphone");
}
#include "findmyphoneplugin.moc"
#include "moc_findmyphoneplugin.cpp"