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
131
CMakeLists.txt
131
CMakeLists.txt
|
@ -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(KF5_MIN_VERSION "5.101.0")
|
||||
set(QT_MIN_VERSION "5.15.2")
|
||||
set(KDE_COMPILERSETTINGS_LEVEL "5.84.0")
|
||||
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(ECMQMLModules)
|
||||
|
||||
include(KDEConnectMacros.cmake)
|
||||
|
||||
|
@ -54,54 +46,44 @@ 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)
|
||||
find_package(Qca-qt${QT_MAJOR_VERSION} ${QCA_MIN_VERSION} REQUIRED)
|
||||
set(Qca_LIBRARY qca-qt${QT_MAJOR_VERSION})
|
||||
|
||||
set(Qca_LIBRARY CONAN_PKG::Qca-qt5)
|
||||
set(KF5_REQUIRED_COMPONENTS I18n ConfigWidgets DBusAddons IconThemes Notifications KIO KCMUtils Service Solid Kirigami2 People WindowSystem GuiAddons)
|
||||
set(KF5_OPTIONAL_COMPONENTS DocTools)
|
||||
|
||||
add_definitions(-DSAILFISHOS)
|
||||
else()
|
||||
find_package(Qca-qt${QT_MAJOR_VERSION} ${QCA_MIN_VERSION} REQUIRED)
|
||||
set(Qca_LIBRARY qca-qt${QT_MAJOR_VERSION})
|
||||
set_package_properties(KF5Kirigami2 PROPERTIES
|
||||
DESCRIPTION "QtQuick plugins to build user interfaces based on KDE UX guidelines"
|
||||
PURPOSE "Required for KDE Connect's QML-based GUI applications"
|
||||
URL "https://www.kde.org/products/kirigami/"
|
||||
TYPE RUNTIME
|
||||
)
|
||||
|
||||
set(KF5_REQUIRED_COMPONENTS I18n ConfigWidgets DBusAddons IconThemes Notifications KIO KCMUtils Service Solid Kirigami2 People WindowSystem GuiAddons)
|
||||
set(KF5_OPTIONAL_COMPONENTS DocTools)
|
||||
|
||||
set_package_properties(KF5Kirigami2 PROPERTIES
|
||||
DESCRIPTION "QtQuick plugins to build user interfaces based on KDE UX guidelines"
|
||||
PURPOSE "Required for KDE Connect's QML-based GUI applications"
|
||||
URL "https://www.kde.org/products/kirigami/"
|
||||
TYPE RUNTIME
|
||||
)
|
||||
|
||||
if(UNIX AND NOT APPLE)
|
||||
find_package(KF5Package REQUIRED)
|
||||
find_package(KF5PulseAudioQt)
|
||||
if (QT_MAJOR_VERSION EQUAL "5")
|
||||
find_package(QtWaylandScanner REQUIRED)
|
||||
endif()
|
||||
find_package(Wayland 1.9 REQUIRED Client)
|
||||
find_package(Qt${QT_MAJOR_VERSION} REQUIRED COMPONENTS WaylandClient)
|
||||
find_package(WaylandProtocols REQUIRED)
|
||||
pkg_check_modules(XkbCommon IMPORTED_TARGET xkbcommon)
|
||||
pkg_check_modules(GIO REQUIRED IMPORTED_TARGET gio-2.0)
|
||||
if(UNIX AND NOT APPLE)
|
||||
find_package(KF5Package REQUIRED)
|
||||
find_package(KF5PulseAudioQt)
|
||||
if (QT_MAJOR_VERSION EQUAL "5")
|
||||
find_package(QtWaylandScanner REQUIRED)
|
||||
endif()
|
||||
|
||||
find_package(KF5PeopleVCard)
|
||||
set_package_properties(KF5PeopleVCard PROPERTIES
|
||||
PURPOSE "Read vcards from the file system"
|
||||
URL "https://invent.kde.org/pim/kpeoplevcard"
|
||||
TYPE RUNTIME
|
||||
)
|
||||
|
||||
add_definitions(-DHAVE_KIO)
|
||||
|
||||
#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)
|
||||
|
||||
find_package(Wayland 1.9 REQUIRED Client)
|
||||
find_package(Qt${QT_MAJOR_VERSION} REQUIRED COMPONENTS WaylandClient)
|
||||
find_package(WaylandProtocols REQUIRED)
|
||||
pkg_check_modules(XkbCommon IMPORTED_TARGET xkbcommon)
|
||||
pkg_check_modules(GIO REQUIRED IMPORTED_TARGET gio-2.0)
|
||||
endif()
|
||||
|
||||
find_package(KF5PeopleVCard)
|
||||
set_package_properties(KF5PeopleVCard PROPERTIES
|
||||
PURPOSE "Read vcards from the file system"
|
||||
URL "https://invent.kde.org/pim/kpeoplevcard"
|
||||
TYPE RUNTIME
|
||||
)
|
||||
|
||||
add_definitions(-DHAVE_KIO)
|
||||
|
||||
#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)
|
||||
|
||||
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,31 +108,28 @@ 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)
|
||||
|
||||
find_package(KF5QQC2DesktopStyle ${KF5_MIN_VERSION} REQUIRED)
|
||||
set_package_properties(KF5QQC2DesktopStyle PROPERTIES TYPE RUNTIME)
|
||||
add_subdirectory(icons)
|
||||
add_subdirectory(data)
|
||||
add_subdirectory(cli)
|
||||
add_subdirectory(declarativeplugin)
|
||||
|
||||
add_subdirectory(icons)
|
||||
add_subdirectory(data)
|
||||
add_subdirectory(cli)
|
||||
add_subdirectory(declarativeplugin)
|
||||
add_subdirectory(kcm)
|
||||
add_subdirectory(kcmplugin)
|
||||
add_subdirectory(daemon)
|
||||
add_subdirectory(app)
|
||||
add_subdirectory(indicator)
|
||||
add_subdirectory(urlhandler)
|
||||
add_subdirectory(nautilus-extension)
|
||||
add_subdirectory(fileitemactionplugin)
|
||||
add_subdirectory(smsapp)
|
||||
add_subdirectory(settings)
|
||||
|
||||
add_subdirectory(kcm)
|
||||
add_subdirectory(kcmplugin)
|
||||
add_subdirectory(daemon)
|
||||
add_subdirectory(app)
|
||||
add_subdirectory(indicator)
|
||||
add_subdirectory(urlhandler)
|
||||
add_subdirectory(nautilus-extension)
|
||||
add_subdirectory(fileitemactionplugin)
|
||||
add_subdirectory(smsapp)
|
||||
add_subdirectory(settings)
|
||||
|
||||
if(NOT WIN32 AND NOT APPLE)
|
||||
add_subdirectory(kio)
|
||||
add_subdirectory(plasmoid)
|
||||
endif()
|
||||
if(NOT WIN32 AND NOT APPLE)
|
||||
add_subdirectory(kio)
|
||||
add_subdirectory(plasmoid)
|
||||
endif()
|
||||
|
||||
if(KF5DocTools_FOUND)
|
||||
|
|
|
@ -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()
|
||||
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()
|
||||
|
|
|
@ -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()
|
||||
install(FILES kdeconnect.zsh RENAME _kdeconnect DESTINATION ${KDE_INSTALL_ZSHAUTOCOMPLETEDIR})
|
||||
|
|
|
@ -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()
|
||||
install(FILES org.kde.kdeconnect.metainfo.xml DESTINATION ${KDE_INSTALL_METAINFODIR})
|
||||
|
|
|
@ -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,50 +20,48 @@ 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()
|
||||
add_subdirectory(photo)
|
||||
add_subdirectory(mprisremote)
|
||||
add_subdirectory(lockdevice)
|
||||
add_subdirectory(contacts)
|
||||
add_subdirectory(share)
|
||||
add_subdirectory(remotekeyboard)
|
||||
add_subdirectory(notifications)
|
||||
add_subdirectory(findmyphone)
|
||||
add_subdirectory(telephony)
|
||||
add_subdirectory(mousepad)
|
||||
add_subdirectory(sms)
|
||||
add_subdirectory(screensaver-inhibit)
|
||||
add_subdirectory(virtualmonitor)
|
||||
if((WIN32 AND MSVC AND (${CMAKE_SYSTEM_VERSION} VERSION_GREATER_EQUAL 10.0.17763.0)) OR NOT WIN32)
|
||||
add_subdirectory(mpriscontrol)
|
||||
endif()
|
||||
add_subdirectory(photo)
|
||||
add_subdirectory(mprisremote)
|
||||
add_subdirectory(lockdevice)
|
||||
add_subdirectory(contacts)
|
||||
add_subdirectory(share)
|
||||
add_subdirectory(remotekeyboard)
|
||||
add_subdirectory(notifications)
|
||||
add_subdirectory(findmyphone)
|
||||
add_subdirectory(telephony)
|
||||
add_subdirectory(mousepad)
|
||||
add_subdirectory(sms)
|
||||
add_subdirectory(screensaver-inhibit)
|
||||
add_subdirectory(virtualmonitor)
|
||||
|
||||
if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
|
||||
find_package(KF5ModemManagerQt ${KF5_MIN_VERSION})
|
||||
if (TARGET KF5::ModemManagerQt)
|
||||
add_subdirectory(mmtelephony)
|
||||
endif()
|
||||
if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
|
||||
find_package(KF5ModemManagerQt ${KF5_MIN_VERSION})
|
||||
if (TARGET KF5::ModemManagerQt)
|
||||
add_subdirectory(mmtelephony)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(NOT WIN32 AND NOT APPLE)
|
||||
add_subdirectory(sendnotifications)
|
||||
endif()
|
||||
if(NOT WIN32 AND NOT APPLE)
|
||||
add_subdirectory(sendnotifications)
|
||||
endif()
|
||||
|
||||
if(NOT APPLE)
|
||||
add_subdirectory(sftp)
|
||||
endif()
|
||||
if(NOT APPLE)
|
||||
add_subdirectory(sftp)
|
||||
endif()
|
||||
|
||||
if(KF5PulseAudioQt_FOUND OR WIN32)
|
||||
add_subdirectory(pausemusic)
|
||||
endif()
|
||||
if(KF5PulseAudioQt_FOUND OR WIN32)
|
||||
add_subdirectory(pausemusic)
|
||||
endif()
|
||||
|
||||
if(Qt5Multimedia_FOUND AND (KF5PulseAudioQt_FOUND OR WIN32))
|
||||
add_subdirectory(findthisdevice)
|
||||
endif()
|
||||
if(Qt5Multimedia_FOUND AND (KF5PulseAudioQt_FOUND OR WIN32))
|
||||
add_subdirectory(findthisdevice)
|
||||
endif()
|
||||
|
||||
if (WIN32 OR APPLE OR KF5PulseAudioQt_FOUND)
|
||||
add_subdirectory(systemvolume)
|
||||
endif()
|
||||
if (WIN32 OR APPLE OR KF5PulseAudioQt_FOUND)
|
||||
add_subdirectory(systemvolume)
|
||||
endif()
|
||||
|
||||
|
||||
|
|
|
@ -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,14 +19,11 @@ 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
|
||||
kdeconnectpluginkcm
|
||||
KF5::I18n
|
||||
KF5::CoreAddons
|
||||
KF5::ConfigWidgets
|
||||
|
||||
)
|
||||
endif()
|
||||
kcoreaddons_add_plugin(kdeconnect_runcommand_config SOURCES runcommand_config.cpp INSTALL_NAMESPACE "kdeconnect/kcms")
|
||||
target_link_libraries( kdeconnect_runcommand_config
|
||||
kdeconnectcore
|
||||
kdeconnectpluginkcm
|
||||
KF5::I18n
|
||||
KF5::CoreAddons
|
||||
KF5::ConfigWidgets
|
||||
)
|
||||
|
|
|
@ -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