From f3998e4b5fb8aea17c765a4d4450f74360c8006d Mon Sep 17 00:00:00 2001 From: Alexander Lohnau Date: Fri, 21 Jul 2023 14:53:23 +0200 Subject: [PATCH] Fix windows build issues - Add dummy args param to QProcess::startDetached - Remove logging category from inline snippet. This was removed due to being unused in non-windows builds. --- daemon/kdeconnectd.cpp | 2 +- indicator/indicatorhelper_win.cpp | 2 +- plugins/findthisdevice/findthisdeviceplugin.h | 3 ++- plugins/runcommand/runcommandplugin.cpp | 4 ++-- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/daemon/kdeconnectd.cpp b/daemon/kdeconnectd.cpp index 3df378900..863d0eff6 100644 --- a/daemon/kdeconnectd.cpp +++ b/daemon/kdeconnectd.cpp @@ -173,7 +173,7 @@ int main(int argc, char *argv[]) #ifdef Q_OS_WIN // make sure indicator shows up in the tray whenever daemon is spawned - QProcess::startDetached(QStringLiteral("kdeconnect-indicator.exe")); + QProcess::startDetached(QStringLiteral("kdeconnect-indicator.exe"), QStringList()); #endif // kdeconnectd is autostarted, so disable session management to speed up startup diff --git a/indicator/indicatorhelper_win.cpp b/indicator/indicatorhelper_win.cpp index 18de3a81c..285fbec00 100644 --- a/indicator/indicatorhelper_win.cpp +++ b/indicator/indicatorhelper_win.cpp @@ -60,7 +60,7 @@ void IndicatorHelper::iconPathHook() int IndicatorHelper::daemonHook(QProcess &kdeconnectd) { - kdeconnectd.start(processes::kdeconnect_daemon); + kdeconnectd.start(processes::kdeconnect_daemon, QStringList()); return 0; } diff --git a/plugins/findthisdevice/findthisdeviceplugin.h b/plugins/findthisdevice/findthisdeviceplugin.h index de54f91ee..4a331b4e5 100644 --- a/plugins/findthisdevice/findthisdeviceplugin.h +++ b/plugins/findthisdevice/findthisdeviceplugin.h @@ -11,6 +11,7 @@ #include #ifdef Q_OS_WIN +#include #include #define INFO_BUFFER_SIZE 32767 #else @@ -42,7 +43,7 @@ inline QString defaultSound() #ifdef Q_OS_WIN wchar_t infoBuf[INFO_BUFFER_SIZE]; if (!GetWindowsDirectory(infoBuf, INFO_BUFFER_SIZE)) { - qCWarning(KDECONNECT_PLUGIN_FINDTHISDEVICE) << "Error with getting the Windows Directory."; + qWarning() << "Error with getting the Windows Directory."; } else { dirPath = QString::fromStdWString(infoBuf) + QStringLiteral("/media"); if (!dirPath.isEmpty()) { diff --git a/plugins/runcommand/runcommandplugin.cpp b/plugins/runcommand/runcommandplugin.cpp index 4a0e13608..4dbe8e509 100644 --- a/plugins/runcommand/runcommandplugin.cpp +++ b/plugins/runcommand/runcommandplugin.cpp @@ -55,9 +55,9 @@ bool RunCommandPlugin::receivePacket(const NetworkPacket &np) const QJsonObject commandJson = value.toObject(); qCInfo(KDECONNECT_PLUGIN_RUNCOMMAND) << "Running:" << COMMAND << ARGS << commandJson[QStringLiteral("command")].toString(); #ifdef Q_OS_WIN - QProcess::startDetached(commandJson[QStringLiteral("command")].toString()); + QProcess::startDetached(commandJson[QStringLiteral("command")].toString(), QStringList()); #else - QProcess::startDetached(QStringLiteral(COMMAND), QStringList() << QStringLiteral(ARGS) << commandJson[QStringLiteral("command")].toString()); + QProcess::startDetached(QStringLiteral(COMMAND), QStringList{QStringLiteral(ARGS), commandJson[QStringLiteral("command")].toString()}); #endif return true; } else if (np.has(QStringLiteral("setup"))) {