kdeconnect-kde/plugins/remotecontrol/remotecontrolplugin.cpp
Alexander Lohnau 2e67f95017 Add explicit moc includes to cpp files
The rationale is explained in https://planet.kde.org/friedrich-kossebau-2023-06-28-include-also-moc-files-of-headers/

In case of KDEConnect, it impressively speeds up compilation. Before it
took 390 seconds on a clean build and with this change it took 330 seconds.
This is due to the mocs_compilation having to include the header files
and thus all their headers. Due to the lots of small plugins we have,
this means that the same headers must be compiled plenty of times.
When we include the moc files directly in the C++ file, they are already
available.
2023-07-30 07:27:45 +00:00

46 lines
1.2 KiB
C++

/**
* SPDX-FileCopyrightText: 2015 Aleix Pol Gonzalez <aleixpol@kde.org>
*
* SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
*/
#include "remotecontrolplugin.h"
#include <KLocalizedString>
#include <KPluginFactory>
#include <QDBusConnection>
#include <QDebug>
#include <QPoint>
#include "plugin_remotecontrol_debug.h"
#include <core/device.h>
K_PLUGIN_CLASS_WITH_JSON(RemoteControlPlugin, "kdeconnect_remotecontrol.json")
RemoteControlPlugin::RemoteControlPlugin(QObject *parent, const QVariantList &args)
: KdeConnectPlugin(parent, args)
{
}
void RemoteControlPlugin::moveCursor(const QPoint &p)
{
NetworkPacket np(PACKET_TYPE_MOUSEPAD_REQUEST, {{QStringLiteral("dx"), p.x()}, {QStringLiteral("dy"), p.y()}});
sendPacket(np);
}
void RemoteControlPlugin::sendCommand(const QVariantMap &body)
{
if (body.isEmpty())
return;
NetworkPacket np(PACKET_TYPE_MOUSEPAD_REQUEST, body);
sendPacket(np);
}
QString RemoteControlPlugin::dbusPath() const
{
return QStringLiteral("/modules/kdeconnect/devices/") + device()->id() + QStringLiteral("/remotecontrol");
}
#include "moc_remotecontrolplugin.cpp"
#include "remotecontrolplugin.moc"