Remove compatibility with Qt < 5.15
In theory we support Qt 5.6 (because of SailfishOS) but in practice we are not checking that in the CI so probably we broke the compatibility long ago. Also, I don't think anyone is using this code in SailfishOS, so we can greatly simplify the code by requiring Qt 5.15 or later.
This commit is contained in:
parent
98b5b71031
commit
22be63ae9e
26 changed files with 108 additions and 367 deletions
|
@ -8,15 +8,9 @@ set (RELEASE_SERVICE_VERSION "${RELEASE_SERVICE_VERSION_MAJOR}.${RELEASE_SERVICE
|
|||
|
||||
project(kdeconnect VERSION ${RELEASE_SERVICE_VERSION})
|
||||
|
||||
if (SAILFISHOS)
|
||||
set(KF5_MIN_VERSION "5.36.0")
|
||||
set(QT_MIN_VERSION "5.6.0")
|
||||
else()
|
||||
set(KF5_MIN_VERSION "5.101.0")
|
||||
set(QT_MIN_VERSION "5.15.2")
|
||||
set(KDE_COMPILERSETTINGS_LEVEL "5.84.0")
|
||||
endif()
|
||||
set(KDE_COMPILERSETTINGS_LEVEL "5.82")
|
||||
set(QCA_MIN_VERSION "2.1.0")
|
||||
|
||||
find_package(ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE)
|
||||
|
@ -39,9 +33,7 @@ include(ECMGenerateQmlTypes)
|
|||
include(KDEClangFormat)
|
||||
include(KDEGitCommitHooks)
|
||||
include(ECMQmlModule)
|
||||
if (NOT SAILFISHOS)
|
||||
include(ECMQMLModules)
|
||||
endif()
|
||||
|
||||
include(KDEConnectMacros.cmake)
|
||||
|
||||
|
@ -54,14 +46,6 @@ ecm_setup_version(${RELEASE_SERVICE_VERSION}
|
|||
add_library(kdeconnectversion INTERFACE)
|
||||
target_include_directories(kdeconnectversion INTERFACE ${CMAKE_CURRENT_BINARY_DIR})
|
||||
|
||||
if (SAILFISHOS)
|
||||
set(KF5_REQUIRED_COMPONENTS I18n CoreAddons Config)
|
||||
set(KF5_OPTIONAL_COMPONENTS)
|
||||
|
||||
set(Qca_LIBRARY CONAN_PKG::Qca-qt5)
|
||||
|
||||
add_definitions(-DSAILFISHOS)
|
||||
else()
|
||||
find_package(Qca-qt${QT_MAJOR_VERSION} ${QCA_MIN_VERSION} REQUIRED)
|
||||
set(Qca_LIBRARY qca-qt${QT_MAJOR_VERSION})
|
||||
|
||||
|
@ -100,8 +84,6 @@ else()
|
|||
#ecm_find_qmlmodule(org.kde.people 1.0) FIXME This results in KPeople code being called which triggers DBus calls which breaks the Windows CI
|
||||
ecm_find_qmlmodule(QtQuick.Particles 2.0)
|
||||
|
||||
endif()
|
||||
|
||||
add_definitions(-DQT_NO_URL_CAST_FROM_STRING -DQT_NO_KEYWORDS -DQT_NO_CAST_FROM_ASCII)
|
||||
|
||||
find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} REQUIRED COMPONENTS DBus Quick QuickControls2 Network Multimedia)
|
||||
|
@ -126,8 +108,6 @@ add_subdirectory(core)
|
|||
add_subdirectory(plugins)
|
||||
add_subdirectory(interfaces)
|
||||
|
||||
if (NOT SAILFISHOS)
|
||||
|
||||
find_package(KF5QQC2DesktopStyle ${KF5_MIN_VERSION} REQUIRED)
|
||||
set_package_properties(KF5QQC2DesktopStyle PROPERTIES TYPE RUNTIME)
|
||||
|
||||
|
@ -151,7 +131,6 @@ if (NOT SAILFISHOS)
|
|||
add_subdirectory(kio)
|
||||
add_subdirectory(plasmoid)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(KF5DocTools_FOUND)
|
||||
add_subdirectory(doc)
|
||||
|
|
|
@ -2,27 +2,9 @@
|
|||
# Redistribution and use is allowed according to the terms of the BSD license.
|
||||
|
||||
|
||||
if (SAILFISHOS)
|
||||
function(kdeconnect_add_plugin plugin)
|
||||
set(options)
|
||||
set(oneValueArgs JSON)
|
||||
set(multiValueArgs SOURCES)
|
||||
cmake_parse_arguments(KC_ADD_PLUGIN "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
|
||||
|
||||
if(NOT KC_ADD_PLUGIN_SOURCES)
|
||||
message(FATAL_ERROR "kdeconnect_add_plugin called without SOURCES parameter")
|
||||
endif()
|
||||
get_filename_component(json "${KC_ADD_PLUGIN_JSON}" REALPATH)
|
||||
|
||||
add_library(${plugin} STATIC ${KC_ADD_PLUGIN_SOURCES})
|
||||
set_property(TARGET ${plugin} APPEND PROPERTY AUTOGEN_TARGET_DEPENDS ${json})
|
||||
set_property(TARGET ${plugin} APPEND PROPERTY COMPILE_DEFINITIONS QT_STATICPLUGIN)
|
||||
endfunction()
|
||||
else()
|
||||
function(kdeconnect_add_plugin)
|
||||
kcoreaddons_add_plugin(${ARGN} INSTALL_NAMESPACE kdeconnect)
|
||||
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${ARGV0}_config.qml")
|
||||
install(FILES "${ARGV0}_config.qml" DESTINATION ${DATA_INSTALL_DIR}/kdeconnect)
|
||||
endif()
|
||||
endfunction()
|
||||
endif()
|
||||
|
|
|
@ -13,6 +13,4 @@ target_link_libraries(kdeconnect-cli
|
|||
|
||||
install(TARGETS kdeconnect-cli ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
|
||||
|
||||
if (NOT SAILFISHOS)
|
||||
install(FILES kdeconnect.zsh RENAME _kdeconnect DESTINATION ${KDE_INSTALL_ZSHAUTOCOMPLETEDIR})
|
||||
endif()
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
#include "compositeuploadjob.h"
|
||||
#include "lanlinkprovider.h"
|
||||
#include "plugins/share/shareplugin.h"
|
||||
#include "qtcompat_p.h"
|
||||
#include <KJobTrackerInterface>
|
||||
#include <KLocalizedString>
|
||||
#include <core_debug.h>
|
||||
|
@ -95,21 +94,14 @@ void CompositeUploadJob::startNextSubJob()
|
|||
m_currentJobSendPayloadSize = 0;
|
||||
emitDescription(m_currentJob->getNetworkPacket().get<QString>(QStringLiteral("filename")));
|
||||
|
||||
#ifdef SAILFISHOS
|
||||
connect(m_currentJob, SIGNAL(processedAmount(KJob *, KJob::Unit, qulonglong)), this, SLOT(slotProcessedAmount(KJob *, KJob::Unit, qulonglong)));
|
||||
#else
|
||||
connect(m_currentJob, QOverload<KJob *, KJob::Unit, qulonglong>::of(&UploadJob::processedAmount), this, &CompositeUploadJob::slotProcessedAmount);
|
||||
#endif
|
||||
|
||||
// Already done by KCompositeJob
|
||||
// connect(m_currentJob, &KJob::result, this, &CompositeUploadJob::slotResult);
|
||||
|
||||
// TODO: Create a copy of the networkpacket that can be re-injected if sending via lan fails?
|
||||
NetworkPacket np = m_currentJob->getNetworkPacket();
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 8, 0)
|
||||
np.setPayload({}, np.payloadSize());
|
||||
#else
|
||||
np.setPayload(nullptr, np.payloadSize());
|
||||
#endif
|
||||
np.setPayloadTransferInfo({{QStringLiteral("port"), m_port}});
|
||||
np.set<int>(QStringLiteral("numberOfFiles"), m_totalJobs);
|
||||
np.set<quint64>(QStringLiteral("totalPayloadSize"), m_totalPayloadSize);
|
||||
|
@ -144,11 +136,7 @@ void CompositeUploadJob::newConnection()
|
|||
m_currentJob->setSocket(m_socket);
|
||||
|
||||
connect(m_socket, &QSslSocket::disconnected, this, &CompositeUploadJob::socketDisconnected);
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
|
||||
connect(m_socket, QOverload<QAbstractSocket::SocketError>::of(&QAbstractSocket::error), this, &CompositeUploadJob::socketError);
|
||||
#else
|
||||
connect(m_socket, &QAbstractSocket::errorOccurred, this, &CompositeUploadJob::socketError);
|
||||
#endif
|
||||
connect(m_socket, QOverload<const QList<QSslError> &>::of(&QSslSocket::sslErrors), this, &CompositeUploadJob::sslError);
|
||||
connect(m_socket, &QSslSocket::encrypted, this, &CompositeUploadJob::encrypted);
|
||||
|
||||
|
|
|
@ -33,7 +33,6 @@
|
|||
#include "daemon.h"
|
||||
#include "kdeconnectconfig.h"
|
||||
#include "landevicelink.h"
|
||||
#include "qtcompat_p.h"
|
||||
|
||||
static const int MAX_UNPAIRED_CONNECTIONS = 42;
|
||||
static const int MAX_REMEMBERED_IDENTITY_PACKETS = 42;
|
||||
|
@ -294,11 +293,7 @@ void LanLinkProvider::udpBroadcastReceived()
|
|||
m_receivedIdentityPackets[socket].np = receivedPacket;
|
||||
m_receivedIdentityPackets[socket].sender = sender;
|
||||
connect(socket, &QAbstractSocket::connected, this, &LanLinkProvider::tcpSocketConnected);
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
|
||||
connect(socket, QOverload<QAbstractSocket::SocketError>::of(&QAbstractSocket::error), this, &LanLinkProvider::connectError);
|
||||
#else
|
||||
connect(socket, &QAbstractSocket::errorOccurred, this, &LanLinkProvider::connectError);
|
||||
#endif
|
||||
socket->connectToHost(sender, tcpPort);
|
||||
}
|
||||
}
|
||||
|
@ -330,11 +325,7 @@ void LanLinkProvider::tcpSocketConnected()
|
|||
return;
|
||||
}
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
|
||||
disconnect(socket, QOverload<QAbstractSocket::SocketError>::of(&QAbstractSocket::error), this, &LanLinkProvider::connectError);
|
||||
#else
|
||||
disconnect(socket, &QAbstractSocket::errorOccurred, this, &LanLinkProvider::connectError);
|
||||
#endif
|
||||
|
||||
configureSocket(socket);
|
||||
|
||||
|
|
|
@ -47,14 +47,10 @@ void CompositeFileTransferJob::startNextSubJob()
|
|||
{i18nc("The destination of a file operation", "Destination"), m_currentJob->destination().toDisplayString(QUrl::PreferLocalFile)});
|
||||
|
||||
m_currentJob->start();
|
||||
#ifdef SAILFISHOS
|
||||
connect(m_currentJob, SIGNAL(processedAmount(KJob *, KJob::Unit, qulonglong)), this, SLOT(slotProcessedAmount(KJob *, KJob::Unit, qulonglong)));
|
||||
#else
|
||||
connect(m_currentJob,
|
||||
QOverload<KJob *, KJob::Unit, qulonglong>::of(&FileTransferJob::processedAmount),
|
||||
this,
|
||||
&CompositeFileTransferJob::slotProcessedAmount);
|
||||
#endif
|
||||
}
|
||||
|
||||
bool CompositeFileTransferJob::addSubjob(KJob *job)
|
||||
|
|
|
@ -28,9 +28,6 @@
|
|||
#include "backends/loopback/loopbacklinkprovider.h"
|
||||
#include "device.h"
|
||||
|
||||
// In older Qt released, qAsConst isnt available
|
||||
#include "qtcompat_p.h"
|
||||
|
||||
static Daemon *s_instance = nullptr;
|
||||
|
||||
struct DaemonPrivate {
|
||||
|
|
|
@ -26,9 +26,6 @@
|
|||
#include "networkpacket.h"
|
||||
#include "pluginloader.h"
|
||||
|
||||
// In older Qt released, qAsConst isnt available
|
||||
#include "qtcompat_p.h"
|
||||
|
||||
class Device::DevicePrivate
|
||||
{
|
||||
public:
|
||||
|
|
|
@ -95,11 +95,7 @@ void FileTransferJob::startTransfer()
|
|||
|
||||
m_written = bytesSent;
|
||||
});
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
|
||||
connect(m_reply, static_cast<void (QNetworkReply::*)(QNetworkReply::NetworkError)>(&QNetworkReply::error), this, &FileTransferJob::transferFailed);
|
||||
#else
|
||||
connect(m_reply, &QNetworkReply::errorOccurred, this, &FileTransferJob::transferFailed);
|
||||
#endif
|
||||
connect(m_reply, &QNetworkReply::finished, this, &FileTransferJob::transferFinished);
|
||||
}
|
||||
|
||||
|
|
|
@ -47,19 +47,6 @@ struct KdeConnectConfigPrivate {
|
|||
|
||||
static QString getDefaultDeviceName()
|
||||
{
|
||||
#ifdef SAILFISHOS
|
||||
const QString hwReleaseFile = QStringLiteral("/etc/hw-release");
|
||||
// QSettings will crash if the file does not exist or can be created, like in this case by us in /etc.
|
||||
// E.g. in the SFOS SDK Emulator there is no such file, so check before to protect against the crash.
|
||||
if (QFile::exists(hwReleaseFile)) {
|
||||
QSettings hwRelease(hwReleaseFile, QSettings::IniFormat);
|
||||
auto hwName = hwRelease.value(QStringLiteral("NAME")).toString();
|
||||
if (!hwName.isEmpty()) {
|
||||
return hwName;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
return QHostInfo::localHostName();
|
||||
}
|
||||
|
||||
|
@ -109,9 +96,6 @@ void KdeConnectConfig::setName(const QString &name)
|
|||
|
||||
DeviceType KdeConnectConfig::deviceType()
|
||||
{
|
||||
#ifdef SAILFISHOS
|
||||
return DeviceType::Phone;
|
||||
#else
|
||||
const QByteArrayList platforms = qgetenv("PLASMA_PLATFORM").split(':');
|
||||
|
||||
if (platforms.contains("phone")) {
|
||||
|
@ -125,7 +109,6 @@ DeviceType KdeConnectConfig::deviceType()
|
|||
// TODO non-Plasma mobile platforms
|
||||
|
||||
return DeviceType::Desktop;
|
||||
#endif
|
||||
}
|
||||
|
||||
QString KdeConnectConfig::deviceId()
|
||||
|
|
|
@ -18,9 +18,6 @@
|
|||
#include "kdeconnectconfig.h"
|
||||
#include "kdeconnectplugin.h"
|
||||
|
||||
// In older Qt released, qAsConst isnt available
|
||||
#include "qtcompat_p.h"
|
||||
|
||||
PluginLoader *PluginLoader::instance()
|
||||
{
|
||||
static PluginLoader *instance = new PluginLoader();
|
||||
|
@ -29,22 +26,10 @@ PluginLoader *PluginLoader::instance()
|
|||
|
||||
PluginLoader::PluginLoader()
|
||||
{
|
||||
#ifdef SAILFISHOS
|
||||
const QVector<QStaticPlugin> staticPlugins = QPluginLoader::staticPlugins();
|
||||
for (auto &staticPlugin : staticPlugins) {
|
||||
QJsonObject jsonMetadata = staticPlugin.metaData().value(QStringLiteral("MetaData")).toObject();
|
||||
KPluginMetaData metadata(jsonMetadata, QString());
|
||||
if (metadata.serviceTypes().contains(QStringLiteral("KdeConnect/Plugin"))) {
|
||||
plugins.insert(metadata.pluginId(), metadata);
|
||||
pluginsFactories.insert(metadata.pluginId(), qobject_cast<KPluginFactory *>(staticPlugin.instance()));
|
||||
}
|
||||
}
|
||||
#else
|
||||
const QVector<KPluginMetaData> data = KPluginLoader::findPlugins(QStringLiteral("kdeconnect/"));
|
||||
for (const KPluginMetaData &metadata : data) {
|
||||
plugins[metadata.pluginId()] = metadata;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
QStringList PluginLoader::getPluginList() const
|
||||
|
@ -72,16 +57,12 @@ KdeConnectPlugin *PluginLoader::instantiatePluginForDevice(const QString &plugin
|
|||
return ret;
|
||||
}
|
||||
|
||||
#ifdef SAILFISHOS
|
||||
KPluginFactory *factory = pluginsFactories.value(pluginName);
|
||||
#else
|
||||
KPluginLoader loader(service.fileName());
|
||||
KPluginFactory *factory = loader.factory();
|
||||
if (!factory) {
|
||||
qCDebug(KDECONNECT_CORE) << "KPluginFactory could not load the plugin:" << service.pluginId() << loader.errorString();
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
const QStringList outgoingInterfaces = KPluginMetaData::readStringList(service.rawData(), QStringLiteral("X-KdeConnect-OutgoingPacketType"));
|
||||
|
||||
|
|
|
@ -37,9 +37,6 @@ private:
|
|||
PluginLoader();
|
||||
|
||||
QHash<QString, KPluginMetaData> plugins;
|
||||
#ifdef SAILFISHOS
|
||||
QHash<QString, KPluginFactory *> pluginsFactories;
|
||||
#endif
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1,106 +0,0 @@
|
|||
/*
|
||||
SPDX-FileCopyrightText: 2017 Kevin Funk <kfunk@.kde.org>
|
||||
|
||||
SPDX-License-Identifier: LGPL-2.0-or-later
|
||||
*/
|
||||
|
||||
#ifndef KDEVELOP_QTCOMPAT_P_H
|
||||
#define KDEVELOP_QTCOMPAT_P_H
|
||||
|
||||
#include <qglobal.h>
|
||||
|
||||
#include <QDir>
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 7, 0)
|
||||
namespace QtPrivate
|
||||
{
|
||||
template<typename T>
|
||||
struct QAddConst {
|
||||
typedef const T Type;
|
||||
};
|
||||
}
|
||||
|
||||
// this adds const to non-const objects (like std::as_const)
|
||||
template<typename T>
|
||||
Q_DECL_CONSTEXPR typename QtPrivate::QAddConst<T>::Type &qAsConst(T &t) Q_DECL_NOTHROW
|
||||
{
|
||||
return t;
|
||||
}
|
||||
// prevent rvalue arguments:
|
||||
template<typename T>
|
||||
void qAsConst(const T &&) Q_DECL_EQ_DELETE;
|
||||
#endif
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 7, 0)
|
||||
template<typename... Args>
|
||||
struct QNonConstOverload {
|
||||
template<typename R, typename T>
|
||||
static constexpr auto of(R (T::*func)(Args...)) noexcept -> decltype(func)
|
||||
{
|
||||
return func;
|
||||
}
|
||||
};
|
||||
|
||||
template<typename... Args>
|
||||
struct QConstOverload {
|
||||
template<typename R, typename T>
|
||||
static constexpr auto of(R (T::*func)(Args...) const) noexcept -> decltype(func)
|
||||
{
|
||||
return func;
|
||||
}
|
||||
};
|
||||
|
||||
template<typename... Args>
|
||||
struct QOverload : QConstOverload<Args...>, QNonConstOverload<Args...> {
|
||||
using QConstOverload<Args...>::of;
|
||||
using QNonConstOverload<Args...>::of;
|
||||
|
||||
template<typename R>
|
||||
static constexpr auto of(R (*func)(Args...)) noexcept -> decltype(func)
|
||||
{
|
||||
return func;
|
||||
}
|
||||
};
|
||||
#endif
|
||||
|
||||
// compat for Q_FALLTHROUGH
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 8, 0)
|
||||
|
||||
#if defined(__has_cpp_attribute)
|
||||
#if __has_cpp_attribute(fallthrough)
|
||||
#define Q_FALLTHROUGH() [[fallthrough]]
|
||||
#elif __has_cpp_attribute(clang::fallthrough)
|
||||
#define Q_FALLTHROUGH() [[clang::fallthrough]]
|
||||
#elif __has_cpp_attribute(gnu::fallthrough)
|
||||
#define Q_FALLTHROUGH() [[gnu::fallthrough]]
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef Q_FALLTHROUGH
|
||||
#if defined(__GNUC__) && !defined(__INTEL_COMPILER) && (((__GNUC__ * 100) + __GNUC_MINOR__) >= 700)
|
||||
#define Q_FALLTHROUGH() __attribute__((fallthrough))
|
||||
#else
|
||||
#define Q_FALLTHROUGH() (void)0
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
namespace QtCompat
|
||||
{
|
||||
// TODO: Just use QDir::listSeparator once we depend on Qt 5.6
|
||||
Q_DECL_CONSTEXPR inline QChar listSeparator() Q_DECL_NOTHROW
|
||||
{
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 6, 0)
|
||||
#ifdef Q_OS_WIN
|
||||
return QLatin1Char(';');
|
||||
#else
|
||||
return QLatin1Char(':');
|
||||
#endif
|
||||
#else
|
||||
return QDir::listSeparator();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
|
@ -3,6 +3,4 @@ install (FILES "kdeconnect-thunar.desktop" DESTINATION ${KDE_INSTALL_DATADIR}/Th
|
|||
install(FILES org.kde.kdeconnect_open.desktop DESTINATION ${KDE_INSTALL_APPDIR})
|
||||
install (FILES "kdeconnect-dde.desktop" DESTINATION ${KDE_INSTALL_DATADIR}/deepin/dde-file-manager/oem-menuextensions/)
|
||||
|
||||
if(NOT SAILFISHOS)
|
||||
install(FILES org.kde.kdeconnect.metainfo.xml DESTINATION ${KDE_INSTALL_METAINFODIR})
|
||||
endif()
|
||||
|
|
|
@ -102,11 +102,7 @@ void KdeConnectDeclarativePlugin::registerTypes(const char *uri)
|
|||
return new OpenConfig;
|
||||
});
|
||||
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
|
||||
qmlRegisterAnonymousType<QAbstractItemModel>(uri, 1);
|
||||
#else
|
||||
qmlRegisterType<QAbstractItemModel>();
|
||||
#endif
|
||||
|
||||
registerFactory<DeviceDbusInterface>(uri, "DeviceDbusInterfaceFactory");
|
||||
registerFactory<BatteryDbusInterface>(uri, "DeviceBatteryDbusInterfaceFactory");
|
||||
|
|
|
@ -11,9 +11,6 @@
|
|||
#include <QDBusPendingReply>
|
||||
#include <QDebug>
|
||||
|
||||
// In older Qt released, qAsConst isnt available
|
||||
#include "core/qtcompat_p.h"
|
||||
|
||||
Q_DECLARE_METATYPE(QDBusPendingReply<>)
|
||||
Q_DECLARE_METATYPE(QDBusPendingReply<QVariant>)
|
||||
Q_DECLARE_METATYPE(QDBusPendingReply<bool>)
|
||||
|
|
|
@ -11,12 +11,10 @@ QString DaemonDbusInterface::activatedService()
|
|||
{
|
||||
static const QString service = QStringLiteral("org.kde.kdeconnect");
|
||||
|
||||
#ifndef SAILFISHOS
|
||||
auto reply = QDBusConnection::sessionBus().interface()->startService(service);
|
||||
if (!reply.isValid()) {
|
||||
qWarning() << "error activating kdeconnectd:" << reply.error();
|
||||
}
|
||||
#endif
|
||||
|
||||
return service;
|
||||
}
|
||||
|
|
|
@ -11,8 +11,6 @@
|
|||
|
||||
#include <dbushelper.h>
|
||||
|
||||
// In older Qt released, qAsConst isnt available
|
||||
#include "core/qtcompat_p.h"
|
||||
#include "interfaces_debug.h"
|
||||
|
||||
NotificationsModel::NotificationsModel(QObject *parent)
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
|
||||
#include <QDebug>
|
||||
|
||||
#include <core/qtcompat_p.h>
|
||||
#include <dbushelper.h>
|
||||
|
||||
RemoteSinksModel::RemoteSinksModel(QObject *parent)
|
||||
|
|
|
@ -20,7 +20,6 @@ endif()
|
|||
|
||||
add_subdirectory(presenter)
|
||||
|
||||
if(NOT SAILFISHOS)
|
||||
if((WIN32 AND MSVC AND (${CMAKE_SYSTEM_VERSION} VERSION_GREATER_EQUAL 10.0.17763.0)) OR NOT WIN32)
|
||||
add_subdirectory(mpriscontrol)
|
||||
endif()
|
||||
|
@ -64,7 +63,6 @@ if(NOT SAILFISHOS)
|
|||
if (WIN32 OR APPLE OR KF5PulseAudioQt_FOUND)
|
||||
add_subdirectory(systemvolume)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
# If we split notifications per plugin, in several notifyrc files, they won't
|
||||
|
|
|
@ -13,9 +13,7 @@
|
|||
#include "mprisplayer.h"
|
||||
#include <dbushelper.h>
|
||||
|
||||
// In older Qt released, qAsConst isnt available
|
||||
#include "plugin_pausemusic_debug.h"
|
||||
#include "qtcompat_p.h"
|
||||
|
||||
K_PLUGIN_CLASS_WITH_JSON(PauseMusicPlugin, "kdeconnect_pausemusic.json")
|
||||
|
||||
|
|
|
@ -19,7 +19,6 @@ target_link_libraries(kdeconnect_runcommand
|
|||
KF5::I18n)
|
||||
|
||||
#----------------------
|
||||
if(NOT SAILFISHOS)
|
||||
kcoreaddons_add_plugin(kdeconnect_runcommand_config SOURCES runcommand_config.cpp INSTALL_NAMESPACE "kdeconnect/kcms")
|
||||
target_link_libraries( kdeconnect_runcommand_config
|
||||
kdeconnectcore
|
||||
|
@ -27,6 +26,4 @@ if(NOT SAILFISHOS)
|
|||
KF5::I18n
|
||||
KF5::CoreAddons
|
||||
KF5::ConfigWidgets
|
||||
|
||||
)
|
||||
endif()
|
||||
|
|
|
@ -14,12 +14,8 @@
|
|||
#include <QProcess>
|
||||
#include <QSettings>
|
||||
|
||||
#ifdef SAILFISHOS
|
||||
#define KCMUTILS_VERSION 0
|
||||
#else
|
||||
#include <KShell>
|
||||
#include <kcmutils_version.h>
|
||||
#endif
|
||||
|
||||
#include <core/daemon.h>
|
||||
#include <core/device.h>
|
||||
|
|
|
@ -1,10 +1,3 @@
|
|||
if (SAILFISHOS)
|
||||
set(SN_PLUGIN_ENABLED_BY_DEFAULT "true")
|
||||
else()
|
||||
set(SN_PLUGIN_ENABLED_BY_DEFAULT "false")
|
||||
endif()
|
||||
|
||||
configure_file(kdeconnect_sendnotifications.json.in kdeconnect_sendnotifications.json)
|
||||
|
||||
set(debug_file_SRCS)
|
||||
ecm_qt_declare_logging_category(
|
||||
|
@ -17,7 +10,6 @@ set(kdeconnect_sendnotifications_SRCS
|
|||
sendnotificationsplugin.cpp
|
||||
notificationslistener.cpp
|
||||
notifyingapplication.cpp
|
||||
kdeconnect_sendnotifications.json
|
||||
${debug_file_SRCS}
|
||||
)
|
||||
|
||||
|
@ -35,7 +27,6 @@ target_link_libraries(kdeconnect_sendnotifications
|
|||
|
||||
#######################################
|
||||
# Config
|
||||
if (NOT SAILFISHOS)
|
||||
|
||||
kcoreaddons_add_plugin(kdeconnect_sendnotifications_config INSTALL_NAMESPACE "kdeconnect/kcms")
|
||||
|
||||
|
@ -52,4 +43,3 @@ target_link_libraries( kdeconnect_sendnotifications_config
|
|||
KF5::I18n
|
||||
KF5::KCMUtils
|
||||
)
|
||||
endif()
|
||||
|
|
|
@ -45,7 +45,7 @@
|
|||
"Description[x-test]": "xxBroadcast this computer's notifications, so they can be shown on other devices.xx",
|
||||
"Description[zh_CN]": "广播此计算机的通知,以被其他设备显示。",
|
||||
"Description[zh_TW]": "廣播此電腦的通知,這樣可以顯示在其他裝置上。",
|
||||
"EnabledByDefault": ${SN_PLUGIN_ENABLED_BY_DEFAULT},
|
||||
"EnabledByDefault": false,
|
||||
"Icon": "preferences-desktop-notification",
|
||||
"Id": "kdeconnect_sendnotifications",
|
||||
"License": "GPL",
|
|
@ -28,9 +28,6 @@
|
|||
#include "plugin_sendnotification_debug.h"
|
||||
#include "sendnotificationsplugin.h"
|
||||
|
||||
// In older Qt released, qAsConst isnt available
|
||||
#include "qtcompat_p.h"
|
||||
|
||||
NotificationsListener::NotificationsListener(KdeConnectPlugin *aPlugin)
|
||||
: QObject(aPlugin)
|
||||
, m_plugin(aPlugin)
|
||||
|
|
Loading…
Reference in a new issue