83888412a9
- Using QLatin1String when concatinating strings is faster, because they are more lightweight. For the resulting string, we need to allocate new memory anyway - Use QLatin1String overloads where they are provided by Qt APIs - Just use const char* for log messages, the quoting of QStrings is not needed - Make sure to reuse string results when possible
34 lines
878 B
C++
34 lines
878 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 QLatin1String("/modules/kdeconnect/devices/") + device()->id() + QLatin1String("/findmyphone");
|
|
}
|
|
|
|
#include "findmyphoneplugin.moc"
|
|
#include "moc_findmyphoneplugin.cpp"
|