Do not require Frameworks 5.45

Summary: Ifdef for old KF5 as discussed in D11684.

Test Plan: Can still use feature when above 5.45

Reviewers: apol

Reviewed By: apol

Subscribers: kdeconnect

Tags: #kde_connect

Differential Revision: https://phabricator.kde.org/D12810
This commit is contained in:
Nicolas Fella
2018-05-10 18:36:06 +02:00
parent c6ebdbe89b
commit 68d0c5d143
3 changed files with 12 additions and 2 deletions

View File

@@ -29,6 +29,7 @@
#include <QSettings>
#include <QJsonDocument>
#include <KShell>
#include <kcmutils_version.h>
#include <core/networkpacket.h>
#include <core/device.h>
@@ -85,7 +86,11 @@ void RunCommandPlugin::sendConfig()
{
QString commands = config()->get<QString>(QStringLiteral("commands"),QStringLiteral("{}"));
NetworkPacket np(PACKET_TYPE_RUNCOMMAND, {{"commandList", commands}});
np.set<bool>(QStringLiteral("canAddCommand"), true);
#if KCMUTILS_VERSION >= QT_VERSION_CHECK(5, 45, 0)
np.set<bool>(QStringLiteral("canAddCommand"), true);
#endif
sendPacket(np);
}