plugins: Use QLatin1String::arg for faster and simpler string concatination
Using an infix with .arg() is simpler than having two string literals
This commit is contained in:
parent
5e270fea2e
commit
69d6c17214
21 changed files with 21 additions and 21 deletions
|
@ -124,7 +124,7 @@ void BatteryPlugin::receivePacket(const NetworkPacket &np)
|
||||||
|
|
||||||
QString BatteryPlugin::dbusPath() const
|
QString BatteryPlugin::dbusPath() const
|
||||||
{
|
{
|
||||||
return QStringLiteral("/modules/kdeconnect/devices/") + device()->id() + QStringLiteral("/battery");
|
return QLatin1String("/modules/kdeconnect/devices/%1/battery").arg(device()->id());
|
||||||
}
|
}
|
||||||
|
|
||||||
#include "batteryplugin.moc"
|
#include "batteryplugin.moc"
|
||||||
|
|
|
@ -29,7 +29,7 @@ void BigscreenPlugin::receivePacket(const NetworkPacket &np)
|
||||||
|
|
||||||
QString BigscreenPlugin::dbusPath() const
|
QString BigscreenPlugin::dbusPath() const
|
||||||
{
|
{
|
||||||
return QStringLiteral("/modules/kdeconnect/devices/") + device()->id() + QStringLiteral("/bigscreen");
|
return QLatin1String("/modules/kdeconnect/devices/%1/bigscreen").arg(device()->id());
|
||||||
}
|
}
|
||||||
|
|
||||||
#include "bigscreenplugin.moc"
|
#include "bigscreenplugin.moc"
|
||||||
|
|
|
@ -28,7 +28,7 @@ void ClipboardPlugin::connected()
|
||||||
|
|
||||||
QString ClipboardPlugin::dbusPath() const
|
QString ClipboardPlugin::dbusPath() const
|
||||||
{
|
{
|
||||||
return QStringLiteral("/modules/kdeconnect/devices/") + device()->id() + QStringLiteral("/clipboard");
|
return QLatin1String("/modules/kdeconnect/devices/%1/clipboard").arg(device()->id());
|
||||||
}
|
}
|
||||||
|
|
||||||
void ClipboardPlugin::clipboardChanged(const QString &content, ClipboardListener::ClipboardContentType contentType)
|
void ClipboardPlugin::clipboardChanged(const QString &content, ClipboardListener::ClipboardContentType contentType)
|
||||||
|
|
|
@ -45,7 +45,7 @@ void ConnectivityReportPlugin::receivePacket(const NetworkPacket &np)
|
||||||
|
|
||||||
QString ConnectivityReportPlugin::dbusPath() const
|
QString ConnectivityReportPlugin::dbusPath() const
|
||||||
{
|
{
|
||||||
return QStringLiteral("/modules/kdeconnect/devices/") + device()->id() + QStringLiteral("/connectivity_report");
|
return QLatin1String("/modules/kdeconnect/devices/%1/connectivity_report").arg(device()->id());
|
||||||
}
|
}
|
||||||
|
|
||||||
#include "connectivity_reportplugin.moc"
|
#include "connectivity_reportplugin.moc"
|
||||||
|
|
|
@ -186,7 +186,7 @@ bool ContactsPlugin::sendRequestWithIDs(const QString &packetType, const uIDList
|
||||||
|
|
||||||
QString ContactsPlugin::dbusPath() const
|
QString ContactsPlugin::dbusPath() const
|
||||||
{
|
{
|
||||||
return QStringLiteral("/modules/kdeconnect/devices/") + device()->id() + QStringLiteral("/contacts");
|
return QLatin1String("/modules/kdeconnect/devices/%1/contacts").arg(device()->id());
|
||||||
}
|
}
|
||||||
|
|
||||||
#include "contactsplugin.moc"
|
#include "contactsplugin.moc"
|
||||||
|
|
|
@ -22,7 +22,7 @@ void FindMyPhonePlugin::ring()
|
||||||
|
|
||||||
QString FindMyPhonePlugin::dbusPath() const
|
QString FindMyPhonePlugin::dbusPath() const
|
||||||
{
|
{
|
||||||
return QLatin1String("/modules/kdeconnect/devices/") + device()->id() + QLatin1String("/findmyphone");
|
return QLatin1String("/modules/kdeconnect/devices/%1/findmyphone").arg(device()->id());
|
||||||
}
|
}
|
||||||
|
|
||||||
#include "findmyphoneplugin.moc"
|
#include "findmyphoneplugin.moc"
|
||||||
|
|
|
@ -81,7 +81,7 @@ void FindThisDevicePlugin::receivePacket(const NetworkPacket & /*np*/)
|
||||||
|
|
||||||
QString FindThisDevicePlugin::dbusPath() const
|
QString FindThisDevicePlugin::dbusPath() const
|
||||||
{
|
{
|
||||||
return QStringLiteral("/modules/kdeconnect/devices/") + device()->id() + QStringLiteral("/findthisdevice");
|
return QLatin1String("/modules/kdeconnect/devices/%1/findthisdevice").arg(device()->id());
|
||||||
}
|
}
|
||||||
|
|
||||||
#include "findthisdeviceplugin.moc"
|
#include "findthisdeviceplugin.moc"
|
||||||
|
|
|
@ -91,7 +91,7 @@ void LockDevicePlugin::connected()
|
||||||
|
|
||||||
QString LockDevicePlugin::dbusPath() const
|
QString LockDevicePlugin::dbusPath() const
|
||||||
{
|
{
|
||||||
return QStringLiteral("/modules/kdeconnect/devices/") + device()->id() + QStringLiteral("/lockdevice");
|
return QLatin1String("/modules/kdeconnect/devices/%1/lockdevice").arg(device()->id());
|
||||||
}
|
}
|
||||||
|
|
||||||
#include "lockdeviceplugin-win.moc"
|
#include "lockdeviceplugin-win.moc"
|
||||||
|
|
|
@ -125,7 +125,7 @@ void LockDevicePlugin::connected()
|
||||||
|
|
||||||
QString LockDevicePlugin::dbusPath() const
|
QString LockDevicePlugin::dbusPath() const
|
||||||
{
|
{
|
||||||
return QStringLiteral("/modules/kdeconnect/devices/") + device()->id() + QStringLiteral("/lockdevice");
|
return QLatin1String("/modules/kdeconnect/devices/%1/lockdevice").arg(device()->id());
|
||||||
}
|
}
|
||||||
|
|
||||||
#include "lockdeviceplugin.moc"
|
#include "lockdeviceplugin.moc"
|
||||||
|
|
|
@ -67,7 +67,7 @@ long MprisRemotePlugin::position() const
|
||||||
|
|
||||||
QString MprisRemotePlugin::dbusPath() const
|
QString MprisRemotePlugin::dbusPath() const
|
||||||
{
|
{
|
||||||
return QStringLiteral("/modules/kdeconnect/devices/") + device()->id() + QStringLiteral("/mprisremote");
|
return QLatin1String("/modules/kdeconnect/devices/%1/mprisremote").arg(device()->id());
|
||||||
}
|
}
|
||||||
|
|
||||||
void MprisRemotePlugin::requestPlayerStatus(const QString &player)
|
void MprisRemotePlugin::requestPlayerStatus(const QString &player)
|
||||||
|
|
|
@ -188,7 +188,7 @@ QString NotificationsPlugin::newId()
|
||||||
|
|
||||||
QString NotificationsPlugin::dbusPath() const
|
QString NotificationsPlugin::dbusPath() const
|
||||||
{
|
{
|
||||||
return QStringLiteral("/modules/kdeconnect/devices/") + device()->id() + QStringLiteral("/notifications");
|
return QLatin1String("/modules/kdeconnect/devices/%1/notifications").arg(device()->id());
|
||||||
}
|
}
|
||||||
|
|
||||||
#include "moc_notificationsplugin.cpp"
|
#include "moc_notificationsplugin.cpp"
|
||||||
|
|
|
@ -42,7 +42,7 @@ void PhotoPlugin::requestPhoto(const QString &url)
|
||||||
|
|
||||||
QString PhotoPlugin::dbusPath() const
|
QString PhotoPlugin::dbusPath() const
|
||||||
{
|
{
|
||||||
return QStringLiteral("/modules/kdeconnect/devices/") + device()->id() + QStringLiteral("/photo");
|
return QLatin1String("/modules/kdeconnect/devices/%1/photo").arg(device()->id());
|
||||||
}
|
}
|
||||||
|
|
||||||
#include "moc_photoplugin.cpp"
|
#include "moc_photoplugin.cpp"
|
||||||
|
|
|
@ -46,7 +46,7 @@ void PingPlugin::sendPing(const QString &customMessage)
|
||||||
|
|
||||||
QString PingPlugin::dbusPath() const
|
QString PingPlugin::dbusPath() const
|
||||||
{
|
{
|
||||||
return QStringLiteral("/modules/kdeconnect/devices/") + device()->id() + QStringLiteral("/ping");
|
return QLatin1String("/modules/kdeconnect/devices/%1/ping").arg(device()->id());
|
||||||
}
|
}
|
||||||
|
|
||||||
#include "moc_pingplugin.cpp"
|
#include "moc_pingplugin.cpp"
|
||||||
|
|
|
@ -40,7 +40,7 @@ void RemoteCommandsPlugin::connected()
|
||||||
|
|
||||||
QString RemoteCommandsPlugin::dbusPath() const
|
QString RemoteCommandsPlugin::dbusPath() const
|
||||||
{
|
{
|
||||||
return QStringLiteral("/modules/kdeconnect/devices/") + device()->id() + QStringLiteral("/remotecommands");
|
return QLatin1String("/modules/kdeconnect/devices/%1/remotecommands").arg(device()->id());
|
||||||
}
|
}
|
||||||
|
|
||||||
void RemoteCommandsPlugin::setCommands(const QByteArray &cmds)
|
void RemoteCommandsPlugin::setCommands(const QByteArray &cmds)
|
||||||
|
|
|
@ -34,7 +34,7 @@ void RemoteControlPlugin::sendCommand(const QVariantMap &body)
|
||||||
|
|
||||||
QString RemoteControlPlugin::dbusPath() const
|
QString RemoteControlPlugin::dbusPath() const
|
||||||
{
|
{
|
||||||
return QStringLiteral("/modules/kdeconnect/devices/") + device()->id() + QStringLiteral("/remotecontrol");
|
return QLatin1String("/modules/kdeconnect/devices/%1/remotecontrol").arg(device()->id());
|
||||||
}
|
}
|
||||||
|
|
||||||
#include "moc_remotecontrolplugin.cpp"
|
#include "moc_remotecontrolplugin.cpp"
|
||||||
|
|
|
@ -120,7 +120,7 @@ int RemoteKeyboardPlugin::translateQtKey(int qtKey) const
|
||||||
|
|
||||||
QString RemoteKeyboardPlugin::dbusPath() const
|
QString RemoteKeyboardPlugin::dbusPath() const
|
||||||
{
|
{
|
||||||
return QStringLiteral("/modules/kdeconnect/devices/") + device()->id() + QStringLiteral("/remotekeyboard");
|
return QLatin1String("/modules/kdeconnect/devices/%1/remotekeyboard").arg(device()->id());
|
||||||
}
|
}
|
||||||
|
|
||||||
#include "moc_remotekeyboardplugin.cpp"
|
#include "moc_remotekeyboardplugin.cpp"
|
||||||
|
|
|
@ -70,7 +70,7 @@ QByteArray RemoteSystemVolumePlugin::sinks()
|
||||||
|
|
||||||
QString RemoteSystemVolumePlugin::dbusPath() const
|
QString RemoteSystemVolumePlugin::dbusPath() const
|
||||||
{
|
{
|
||||||
return QStringLiteral("/modules/kdeconnect/devices/") + device()->id() + QStringLiteral("/remotesystemvolume");
|
return QLatin1String("/modules/kdeconnect/devices/%1/remotesystemvolume").arg(device()->id());
|
||||||
}
|
}
|
||||||
|
|
||||||
#include "moc_remotesystemvolumeplugin.cpp"
|
#include "moc_remotesystemvolumeplugin.cpp"
|
||||||
|
|
|
@ -266,7 +266,7 @@ void SharePlugin::shareText(const QString &text)
|
||||||
|
|
||||||
QString SharePlugin::dbusPath() const
|
QString SharePlugin::dbusPath() const
|
||||||
{
|
{
|
||||||
return QStringLiteral("/modules/kdeconnect/devices/") + device()->id() + QStringLiteral("/share");
|
return QLatin1String("/modules/kdeconnect/devices/%1/share").arg(device()->id());
|
||||||
}
|
}
|
||||||
|
|
||||||
#include "moc_shareplugin.cpp"
|
#include "moc_shareplugin.cpp"
|
||||||
|
|
|
@ -231,7 +231,7 @@ Attachment SmsPlugin::createAttachmentFromUrl(const QString &url)
|
||||||
|
|
||||||
QString SmsPlugin::dbusPath() const
|
QString SmsPlugin::dbusPath() const
|
||||||
{
|
{
|
||||||
return QStringLiteral("/modules/kdeconnect/devices/") + device()->id() + QStringLiteral("/sms");
|
return QLatin1String("/modules/kdeconnect/devices/%1/sms").arg(device()->id());
|
||||||
}
|
}
|
||||||
|
|
||||||
void SmsPlugin::launchApp()
|
void SmsPlugin::launchApp()
|
||||||
|
|
|
@ -91,7 +91,7 @@ void TelephonyPlugin::sendMutePacket()
|
||||||
|
|
||||||
QString TelephonyPlugin::dbusPath() const
|
QString TelephonyPlugin::dbusPath() const
|
||||||
{
|
{
|
||||||
return QStringLiteral("/modules/kdeconnect/devices/") + device()->id() + QStringLiteral("/telephony");
|
return QLatin1String("/modules/kdeconnect/devices/%1/telepony").arg(device()->id());
|
||||||
}
|
}
|
||||||
|
|
||||||
#include "moc_telephonyplugin.cpp"
|
#include "moc_telephonyplugin.cpp"
|
||||||
|
|
|
@ -79,7 +79,7 @@ QString VirtualMonitorPlugin::dbusPath() const
|
||||||
if (QStandardPaths::findExecutable(QS("krfb-virtualmonitor")).isEmpty())
|
if (QStandardPaths::findExecutable(QS("krfb-virtualmonitor")).isEmpty())
|
||||||
return {};
|
return {};
|
||||||
|
|
||||||
return QS("/modules/kdeconnect/devices/") + device()->id() + QS("/virtualmonitor");
|
return QLatin1String("/modules/kdeconnect/devices/%1/virtualmonitor").arg(device()->id());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool VirtualMonitorPlugin::requestVirtualMonitor()
|
bool VirtualMonitorPlugin::requestVirtualMonitor()
|
||||||
|
|
Loading…
Reference in a new issue