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.
This commit is contained in:
Alexander Lohnau 2023-07-26 10:15:11 +02:00 committed by Albert Vaca Cintora
parent 0d04fa98e9
commit 2e67f95017
114 changed files with 181 additions and 1 deletions

View file

@ -64,3 +64,5 @@ void BluetoothDeviceLink::dataReceived()
Q_EMIT receivedPacket(packet);
}
}
#include "moc_bluetoothdevicelink.cpp"

View file

@ -23,3 +23,5 @@ QSharedPointer<QIODevice> BluetoothDownloadJob::payload() const
void BluetoothDownloadJob::start()
{
}
#include "moc_bluetoothdownloadjob.cpp"

View file

@ -304,3 +304,5 @@ void BluetoothLinkProvider::socketDisconnected(const QBluetoothAddress &peer, Mu
BluetoothLinkProvider::~BluetoothLinkProvider()
{
}
#include "moc_bluetoothlinkprovider.cpp"

View file

@ -64,3 +64,5 @@ void BluetoothUploadJob::closeConnection()
mData->close();
deleteLater();
}
#include "moc_bluetoothuploadjob.cpp"

View file

@ -452,3 +452,5 @@ void ConnectionMultiplexer::removeChannel(QBluetoothUuid channelId)
Q_EMIT channel->disconnected();
}
#include "moc_connectionmultiplexer.cpp"

View file

@ -99,3 +99,5 @@ bool MultiplexChannel::isSequential() const
{
return true;
}
#include "moc_multiplexchannel.cpp"

View file

@ -13,3 +13,5 @@ MultiplexChannelState::MultiplexChannelState()
, close_after_write{false}
{
}
#include "moc_multiplexchannelstate.cpp"

View file

@ -15,3 +15,5 @@ DeviceLink::DeviceLink(const QString &deviceId, LinkProvider *parent)
parent->onLinkDestroyed(deviceId, this);
});
}
#include "moc_devicelink.cpp"

View file

@ -289,3 +289,5 @@ void CompositeUploadJob::emitDescription(const QString &currentFileName)
setProcessedAmount(Files, m_currentJobNum);
setTotalAmount(Files, m_totalJobs);
}
#include "moc_compositeuploadjob.cpp"

View file

@ -113,3 +113,5 @@ void LanDeviceLink::dataReceived()
Q_EMIT receivedPacket(packet);
}
}
#include "moc_landevicelink.cpp"

View file

@ -626,3 +626,5 @@ void LanLinkProvider::addLink(QSslSocket *socket, const DeviceInfo &deviceInfo)
}
Q_EMIT onConnectionReceived(deviceLink);
}
#include "moc_lanlinkprovider.cpp"

View file

@ -118,3 +118,5 @@ void MdnsDiscovery::stopDiscovering()
m_serviceBrowser = nullptr;
}
}
#include "moc_mdnsdiscovery.cpp"

View file

@ -46,3 +46,5 @@ void Server::close()
QTcpServer::close();
Q_EMIT closed();
}
#include "moc_server.cpp"

View file

@ -93,3 +93,5 @@ const NetworkPacket UploadJob::getNetworkPacket()
{
return m_networkPacket;
}
#include "moc_uploadjob.cpp"

View file

@ -35,3 +35,5 @@ void LinkProvider::suspend(bool suspend)
onStart();
}
}
#include "moc_linkprovider.cpp"

View file

@ -35,3 +35,5 @@ DeviceInfo LoopbackDeviceLink::deviceInfo() const
{
return KdeConnectConfig::instance().deviceInfo();
}
#include "moc_loopbackdevicelink.cpp"

View file

@ -39,3 +39,5 @@ void LoopbackLinkProvider::onStop()
delete loopbackDeviceLink;
}
}
#include "moc_loopbacklinkprovider.cpp"

View file

@ -146,3 +146,5 @@ void PairingHandler::pairingDone()
m_pairState = PairState::Paired;
Q_EMIT pairingSuccessful();
}
#include "moc_pairinghandler.cpp"

View file

@ -134,3 +134,5 @@ void CompositeFileTransferJob::slotResult(KJob *job)
emitResult();
}
}
#include "moc_compositefiletransferjob.cpp"

View file

@ -281,3 +281,5 @@ QString Daemon::selfId() const
{
return KdeConnectConfig::instance().deviceId();
}
#include "moc_daemon.cpp"

View file

@ -485,3 +485,5 @@ QString Device::pluginIconName(const QString &pluginName)
}
return QString();
}
#include "moc_device.cpp"

View file

@ -146,3 +146,5 @@ bool FileTransferJob::doKill()
return true;
}
#include "moc_filetransferjob.cpp"

View file

@ -76,3 +76,5 @@ QString KdeConnectPlugin::iconName() const
{
return d->iconName;
}
#include "moc_kdeconnectplugin.cpp"

View file

@ -183,3 +183,5 @@ void KdeConnectPluginConfig::loadConfig()
SLOT(slotConfigChanged()));
Q_EMIT configChanged();
}
#include "moc_kdeconnectpluginconfig.cpp"

View file

@ -116,3 +116,5 @@ FileTransferJob *NetworkPacket::createPayloadTransferJob(const QUrl &destination
{
return new FileTransferJob(this, destination);
}
#include "moc_networkpacket.cpp"

View file

@ -51,3 +51,5 @@ NotificationServerInfo::Hints NotificationServerInfo::supportedHints()
{
return m_supportedHints;
}
#include "moc_notificationserverinfo.cpp"

View file

@ -39,3 +39,5 @@ void OpenConfig::openConfiguration(const QString &deviceId, const QString &plugi
m_currentToken = QString();
}
#include "moc_openconfig.cpp"

View file

@ -131,3 +131,5 @@ void KdeConnectDeclarativePlugin::initializeEngine(QQmlEngine *engine, const cha
engine->rootContext()->setContextProperty(QStringLiteral("DBusResponseWaiter"), DBusResponseWaiter::instance());
}
#include "moc_kdeconnectdeclarativeplugin.cpp"

View file

@ -26,3 +26,5 @@ QObject *ObjectFactory::create(const QVariant &arg1, const QVariant &arg2)
return m_f2(arg1, arg2);
return nullptr;
}
#include "moc_objectfactory.cpp"

View file

@ -71,3 +71,5 @@ bool PointerLockerQt::eventFilter(QObject *watched, QEvent *event)
return true;
}
#include "moc_pointerlocker.cpp"

View file

@ -211,4 +211,5 @@ void PointerLockerWayland::setWindow(QWindow *window)
}
}
#include "moc_pointerlockerwayland.cpp"
#include "pointerlockerwayland.moc"

View file

@ -114,3 +114,5 @@ const QDBusPendingCall *DBusResponseWaiter::extractPendingCall(QVariant &variant
return nullptr;
}
#include "moc_responsewaiter.cpp"

View file

@ -88,4 +88,5 @@ void SendFileItemAction::sendFile()
}
}
#include "moc_sendfileitemaction.cpp"
#include "sendfileitemaction.moc"

View file

@ -162,3 +162,5 @@ DeviceIndicator::DeviceIndicator(DeviceDbusInterface *device)
},
this);
}
#include "moc_deviceindicator.cpp"

View file

@ -59,3 +59,5 @@ void BatteryAction::setCharging(bool charging)
m_charging = charging;
update();
}
#include "moc_battery_action.cpp"

View file

@ -81,3 +81,5 @@ void ConnectivityAction::setCellularNetworkType(QString cellularNetworkType)
m_cellularNetworkType = cellularNetworkType;
update();
}
#include "moc_connectivity_action.cpp"

View file

@ -135,3 +135,5 @@ void CommandsModel::addCommand(const QString &name, const QString &command)
endInsertRows();
saveCommands();
}
#include "moc_commandsmodel.cpp"

View file

@ -278,3 +278,5 @@ ClipboardDbusInterface::ClipboardDbusInterface(const QString &deviceId, QObject
ClipboardDbusInterface::~ClipboardDbusInterface()
{
}
#include "moc_dbusinterfaces.cpp"

View file

@ -276,3 +276,5 @@ bool DevicesModel::passesFilter(DeviceDbusInterface *dev) const
return !((onlyReachable && !dev->isReachable()) || (onlyPaired && !dev->isPaired()));
}
#include "moc_devicesmodel.cpp"

View file

@ -22,3 +22,5 @@ QString DevicesPluginFilterProxyModel::pluginFilter() const
{
return m_pluginFilter;
}
#include "moc_devicespluginfilterproxymodel.cpp"

View file

@ -44,3 +44,5 @@ bool DevicesSortProxyModel::filterAcceptsRow(int source_row, const QModelIndex &
// Possible to-do: Implement filter
return true;
}
#include "moc_devicessortproxymodel.cpp"

View file

@ -235,3 +235,5 @@ void NotificationsModel::notificationUpdated()
{
Q_EMIT dataChanged(index(0, 0), index(m_notificationList.size() - 1, 0));
}
#include "moc_notificationsmodel.cpp"

View file

@ -117,3 +117,5 @@ QString PluginModel::deviceId()
{
return m_deviceId;
}
#include "moc_pluginmodel.cpp"

View file

@ -131,3 +131,5 @@ void RemoteCommandsModel::clearCommands()
endRemoveRows();
}
}
#include "moc_remotecommandsmodel.cpp"

View file

@ -174,3 +174,5 @@ int RemoteSinksModel::rowCount(const QModelIndex &parent) const
return m_sinkList.count();
}
#include "moc_remotesinksmodel.cpp"

View file

@ -43,3 +43,5 @@ QString KdeConnectPluginKcm::deviceId() const
{
return d->m_deviceId;
}
#include "moc_kdeconnectpluginkcm.cpp"

View file

@ -249,5 +249,5 @@ KIO::WorkerResult KioKdeconnect::get(const QUrl &url)
return KIO::WorkerResult::pass();
}
// needed for JSON file embedding
#include "kiokdeconnect.moc"
#include "moc_kiokdeconnect.cpp"

View file

@ -134,3 +134,4 @@ QString BatteryPlugin::dbusPath() const
}
#include "batteryplugin.moc"
#include "moc_batteryplugin.cpp"

View file

@ -41,3 +41,4 @@ QString BigscreenPlugin::dbusPath() const
}
#include "bigscreenplugin.moc"
#include "moc_bigscreenplugin.cpp"

View file

@ -59,3 +59,4 @@ void ClipboardConfig::save()
}
#include "clipboard_config.moc"
#include "moc_clipboard_config.cpp"

View file

@ -80,3 +80,5 @@ void ClipboardListener::setText(const QString &content)
mime->setText(content);
clipboard->setMimeData(mime, QClipboard::Clipboard);
}
#include "moc_clipboardlistener.cpp"

View file

@ -99,3 +99,4 @@ bool ClipboardPlugin::receivePacket(const NetworkPacket &np)
}
#include "clipboardplugin.moc"
#include "moc_clipboardplugin.cpp"

View file

@ -59,3 +59,4 @@ QString ConnectivityReportPlugin::dbusPath() const
}
#include "connectivity_reportplugin.moc"
#include "moc_connectivity_reportplugin.cpp"

View file

@ -194,3 +194,4 @@ QString ContactsPlugin::dbusPath() const
}
#include "contactsplugin.moc"
#include "moc_contactsplugin.cpp"

View file

@ -37,3 +37,4 @@ QString FindMyPhonePlugin::dbusPath() const
}
#include "findmyphoneplugin.moc"
#include "moc_findmyphoneplugin.cpp"

View file

@ -88,3 +88,4 @@ void FindThisDeviceConfig::playSound(const QUrl &soundUrl)
}
#include "findthisdevice_config.moc"
#include "moc_findthisdevice_config.cpp"

View file

@ -94,3 +94,4 @@ QString FindThisDevicePlugin::dbusPath() const
}
#include "findthisdeviceplugin.moc"
#include "moc_findthisdeviceplugin.cpp"

View file

@ -99,3 +99,4 @@ QString LockDevicePlugin::dbusPath() const
}
#include "lockdeviceplugin-win.moc"
#include "moc_lockdeviceplugin-win.cpp"

View file

@ -133,3 +133,4 @@ QString LockDevicePlugin::dbusPath() const
}
#include "lockdeviceplugin.moc"
#include "moc_lockdeviceplugin.cpp"

View file

@ -133,3 +133,4 @@ void MMTelephonyPlugin::sendCancelMMTelephonyPacket(ModemManager::Call *call, co
}
#include "mmtelephonyplugin.moc"
#include "moc_mmtelephonyplugin.cpp"

View file

@ -11,3 +11,5 @@ AbstractRemoteInput::AbstractRemoteInput(QObject *parent)
: QObject(parent)
{
}
#include "moc_abstractremoteinput.cpp"

View file

@ -223,3 +223,5 @@ bool MacOSRemoteInput::handlePacket(const NetworkPacket& np)
bool MacOSRemoteInput::hasKeyboardSupport() {
return true;
}
#include "moc_macosremoteinput.cpp"

View file

@ -71,4 +71,5 @@ void MousepadPlugin::connected()
sendPacket(np);
}
#include "moc_mousepadplugin.cpp"
#include "mousepadplugin.moc"

View file

@ -260,3 +260,5 @@ bool WaylandRemoteInput::handlePacket(const NetworkPacket &np)
}
return true;
}
#include "moc_waylandremoteinput.cpp"

View file

@ -247,3 +247,5 @@ bool WindowsRemoteInput::hasKeyboardSupport()
{
return true;
}
#include "moc_windowsremoteinput.cpp"

View file

@ -211,3 +211,5 @@ bool X11RemoteInput::hasKeyboardSupport()
{
return true;
}
#include "moc_x11remoteinput.cpp"

View file

@ -370,4 +370,5 @@ bool MprisControlPlugin::receivePacket(const NetworkPacket &np)
return true;
}
#include "moc_mpriscontrolplugin-win.cpp"
#include "mpriscontrolplugin-win.moc"

View file

@ -400,4 +400,5 @@ void MprisControlPlugin::mprisPlayerMetadataToNetworkPacket(NetworkPacket &np, c
np.set(QStringLiteral("url"), fileUrl);
}
#include "moc_mpriscontrolplugin.cpp"
#include "mpriscontrolplugin.moc"

View file

@ -190,3 +190,5 @@ QDBusConnection &MprisRemotePlayer::dbus()
{
return m_dbusConnection;
}
#include "moc_mprisremoteplayer.cpp"

View file

@ -58,3 +58,5 @@ QStringList MprisRemotePlayerMediaPlayer2::SupportedMimeTypes() const
{
return {};
}
#include "moc_mprisremoteplayermediaplayer2.cpp"

View file

@ -256,3 +256,5 @@ void MprisRemotePlayerMediaPlayer2Player::emitPropertiesChanged()
m_positionChanged = false;
m_volumeChanged = false;
}
#include "moc_mprisremoteplayermediaplayer2player.cpp"

View file

@ -179,4 +179,5 @@ bool MprisRemotePlugin::canSeek() const
return player ? player->canSeek() : false;
}
#include "moc_mprisremoteplugin.cpp"
#include "mprisremoteplugin.moc"

View file

@ -193,3 +193,5 @@ void Notification::parseNetworkPacket(const NetworkPacket &np)
m_actions.append(value.toString());
}
}
#include "moc_notification.cpp"

View file

@ -198,4 +198,5 @@ QString NotificationsPlugin::dbusPath() const
return QStringLiteral("/modules/kdeconnect/devices/") + device()->id() + QStringLiteral("/notifications");
}
#include "moc_notificationsplugin.cpp"
#include "notificationsplugin.moc"

View file

@ -67,3 +67,5 @@ void SendReplyTextEdit::keyPressEvent(QKeyEvent *event)
}
QTextEdit::keyPressEvent(event);
}
#include "moc_sendreplydialog.cpp"

View file

@ -65,4 +65,5 @@ void PauseMusicConfig::save()
KCModule::save();
}
#include "moc_pausemusic_config.cpp"
#include "pausemusic_config.moc"

View file

@ -212,4 +212,5 @@ bool PauseMusicPlugin::receivePacket(const NetworkPacket &np)
return true;
}
#include "moc_pausemusicplugin-win.cpp"
#include "pausemusicplugin-win.moc"

View file

@ -106,4 +106,5 @@ bool PauseMusicPlugin::receivePacket(const NetworkPacket &np)
return true;
}
#include "moc_pausemusicplugin.cpp"
#include "pausemusicplugin.moc"

View file

@ -51,4 +51,5 @@ QString PhotoPlugin::dbusPath() const
return QStringLiteral("/modules/kdeconnect/devices/") + device()->id() + QStringLiteral("/photo");
}
#include "moc_photoplugin.cpp"
#include "photoplugin.moc"

View file

@ -62,4 +62,5 @@ QString PingPlugin::dbusPath() const
return QStringLiteral("/modules/kdeconnect/devices/") + device()->id() + QStringLiteral("/ping");
}
#include "moc_pingplugin.cpp"
#include "pingplugin.moc"

View file

@ -91,4 +91,5 @@ bool PresenterPlugin::receivePacket(const NetworkPacket &np)
return true;
}
#include "moc_presenterplugin.cpp"
#include "presenterplugin.moc"

View file

@ -66,4 +66,5 @@ void RemoteCommandsPlugin::editCommands()
sendPacket(np);
}
#include "moc_remotecommandsplugin.cpp"
#include "remotecommandsplugin.moc"

View file

@ -42,4 +42,5 @@ QString RemoteControlPlugin::dbusPath() const
return QStringLiteral("/modules/kdeconnect/devices/") + device()->id() + QStringLiteral("/remotecontrol");
}
#include "moc_remotecontrolplugin.cpp"
#include "remotecontrolplugin.moc"

View file

@ -126,4 +126,5 @@ QString RemoteKeyboardPlugin::dbusPath() const
return QStringLiteral("/modules/kdeconnect/devices/") + device()->id() + QStringLiteral("/remotekeyboard");
}
#include "moc_remotekeyboardplugin.cpp"
#include "remotekeyboardplugin.moc"

View file

@ -80,4 +80,5 @@ QString RemoteSystemVolumePlugin::dbusPath() const
return QStringLiteral("/modules/kdeconnect/devices/") + device()->id() + QStringLiteral("/remotesystemvolume");
}
#include "moc_remotesystemvolumeplugin.cpp"
#include "remotesystemvolumeplugin.moc"

View file

@ -251,4 +251,5 @@ void RunCommandConfig::onDataChanged(const QModelIndex &topLeft, const QModelInd
}
}
#include "moc_runcommand_config.cpp"
#include "runcommand_config.moc"

View file

@ -82,4 +82,5 @@ void RunCommandPlugin::sendConfig()
sendPacket(np);
}
#include "moc_runcommandplugin.cpp"
#include "runcommandplugin.moc"

View file

@ -39,4 +39,5 @@ bool ScreensaverInhibitPlugin::receivePacket(const NetworkPacket &np)
return false;
}
#include "moc_screensaverinhibitplugin-macos.cpp"
#include "screensaverinhibitplugin-macos.moc"

View file

@ -29,4 +29,5 @@ bool ScreensaverInhibitPlugin::receivePacket(const NetworkPacket &np)
return false;
}
#include "moc_screensaverinhibitplugin-win.cpp"
#include "screensaverinhibitplugin-win.moc"

View file

@ -48,4 +48,5 @@ bool ScreensaverInhibitPlugin::receivePacket(const NetworkPacket &np)
return false;
}
#include "moc_screensaverinhibitplugin.cpp"
#include "screensaverinhibitplugin.moc"

View file

@ -348,3 +348,5 @@ GDBusMessage *NotificationsListener::onMessageFiltered(GDBusConnection *, GDBusM
return nullptr;
}
#include "moc_notificationslistener.cpp"

View file

@ -208,3 +208,5 @@ int NotifyingApplicationModel::rowCount(const QModelIndex &parent) const
}
return m_apps.size();
}
#include "moc_notifyingapplicationmodel.cpp"

View file

@ -104,4 +104,5 @@ void SendNotificationsConfig::save()
config()->setList(QStringLiteral("applications"), list);
}
#include "moc_sendnotifications_config.cpp"
#include "sendnotifications_config.moc"

View file

@ -30,4 +30,5 @@ bool SendNotificationsPlugin::receivePacket(const NetworkPacket &np)
return true;
}
#include "moc_sendnotificationsplugin.cpp"
#include "sendnotificationsplugin.moc"

View file

@ -235,3 +235,5 @@ void Mounter::unmount(bool finished)
}
m_started = false;
}
#include "moc_mounter.cpp"

View file

@ -33,3 +33,5 @@ void MountLoop::exitWith(bool status)
Q_EMIT result(status);
exit(status ? 0 : 1);
}
#include "moc_mountloop.cpp"

View file

@ -76,4 +76,5 @@ bool SftpPlugin::receivePacket(const NetworkPacket &np)
return true;
}
#include "moc_sftpplugin-win.cpp"
#include "sftpplugin-win.moc"

View file

@ -187,4 +187,5 @@ QVariantMap SftpPlugin::getDirectories()
return remoteDirectories;
}
#include "moc_sftpplugin.cpp"
#include "sftpplugin.moc"

View file

@ -54,4 +54,5 @@ void ShareConfig::save()
config()->set(QStringLiteral("incoming_path"), m_ui->kurlrequester->text());
}
#include "moc_share_config.cpp"
#include "share_config.moc"

View file

@ -273,4 +273,5 @@ QString SharePlugin::dbusPath() const
return QStringLiteral("/modules/kdeconnect/devices/") + device()->id() + QStringLiteral("/share");
}
#include "moc_shareplugin.cpp"
#include "shareplugin.moc"

Some files were not shown because too many files have changed in this diff Show more