Get rid of QOverload/static_cast for overloaded signals
By exclusing deprecated API in the KF5 build, the deprecated signal no longer cause an ambiguity
This commit is contained in:
parent
e97af9dc15
commit
1ee75463e0
9 changed files with 18 additions and 14 deletions
|
@ -29,6 +29,7 @@ include(KDEClangFormat)
|
|||
include(KDEGitCommitHooks)
|
||||
include(ECMQmlModule)
|
||||
include(ECMQMLModules)
|
||||
include(ECMDeprecationSettings)
|
||||
|
||||
include(KDEConnectMacros.cmake)
|
||||
|
||||
|
@ -48,6 +49,10 @@ else()
|
|||
set(QTQUICK_FILEDIALOG_FOLDER "folder")
|
||||
endif()
|
||||
|
||||
ecm_set_disabled_deprecation_versions(
|
||||
QT ${QT_MIN_VERSION}
|
||||
KF ${KF5_MIN_VERSION}
|
||||
)
|
||||
|
||||
# Make the version header available by linking against kdeconnectversion
|
||||
add_library(kdeconnectversion INTERFACE)
|
||||
|
@ -58,7 +63,7 @@ set(Qca_LIBRARY qca-qt${QT_MAJOR_VERSION})
|
|||
|
||||
set(KF5_REQUIRED_COMPONENTS I18n ConfigWidgets DBusAddons IconThemes Notifications KIO KCMUtils Service Solid Kirigami2 People WindowSystem GuiAddons DocTools)
|
||||
|
||||
set_package_properties(KF5Kirigami2 PROPERTIES
|
||||
set_package_properties(KF${QT_MAJOR_VERSION}Kirigami2 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/"
|
||||
|
@ -71,7 +76,6 @@ if(UNIX AND NOT APPLE)
|
|||
else()
|
||||
set(WITH_X11 OFF)
|
||||
set(WITH_PULSEAUDIO OFF)
|
||||
|
||||
endif()
|
||||
|
||||
if(UNIX AND NOT APPLE)
|
||||
|
|
|
@ -133,7 +133,7 @@ void CompositeUploadJob::newConnection()
|
|||
|
||||
connect(m_socket, &QSslSocket::disconnected, this, &CompositeUploadJob::socketDisconnected);
|
||||
connect(m_socket, &QAbstractSocket::errorOccurred, this, &CompositeUploadJob::socketError);
|
||||
connect(m_socket, QOverload<const QList<QSslError> &>::of(&QSslSocket::sslErrors), this, &CompositeUploadJob::sslError);
|
||||
connect(m_socket, &QSslSocket::sslErrors, this, &CompositeUploadJob::sslError);
|
||||
connect(m_socket, &QSslSocket::encrypted, this, &CompositeUploadJob::encrypted);
|
||||
|
||||
LanLinkProvider::configureSslSocket(m_socket, m_deviceId, true);
|
||||
|
|
|
@ -359,7 +359,7 @@ void LanLinkProvider::tcpSocketConnected()
|
|||
|
||||
connect(socket, &QSslSocket::encrypted, this, &LanLinkProvider::encrypted);
|
||||
|
||||
connect(socket, QOverload<const QList<QSslError> &>::of(&QSslSocket::sslErrors), this, &LanLinkProvider::sslErrors);
|
||||
connect(socket, &QSslSocket::sslErrors, this, &LanLinkProvider::sslErrors);
|
||||
|
||||
socket->startServerEncryption();
|
||||
} else {
|
||||
|
@ -502,7 +502,7 @@ void LanLinkProvider::dataReceived()
|
|||
connect(socket, &QSslSocket::encrypted, this, &LanLinkProvider::encrypted);
|
||||
|
||||
if (isDeviceTrusted) {
|
||||
connect(socket, QOverload<const QList<QSslError> &>::of(&QSslSocket::sslErrors), this, &LanLinkProvider::sslErrors);
|
||||
connect(socket, &QSslSocket::sslErrors, this, &LanLinkProvider::sslErrors);
|
||||
}
|
||||
|
||||
socket->startClientEncryption();
|
||||
|
|
|
@ -10,9 +10,9 @@
|
|||
#include "kdeconnectconfig.h"
|
||||
#include "lanlinkprovider.h"
|
||||
|
||||
#include <KDNSSD/DNSSD/PublicService>
|
||||
#include <KDNSSD/DNSSD/RemoteService>
|
||||
#include <KDNSSD/DNSSD/ServiceBrowser>
|
||||
#include <KDNSSD/PublicService>
|
||||
#include <KDNSSD/RemoteService>
|
||||
#include <KDNSSD/ServiceBrowser>
|
||||
|
||||
const QString kServiceName = QStringLiteral("_kdeconnect._udp");
|
||||
|
||||
|
|
|
@ -65,7 +65,7 @@ public:
|
|||
oc.openConfiguration(deviceId);
|
||||
};
|
||||
connect(notification, &KNotification::action3Activated, openSettings);
|
||||
connect(notification, QOverload<unsigned int>::of(&KNotification::activated), openSettings);
|
||||
connect(notification, &KNotification::activated, openSettings);
|
||||
notification->sendEvent();
|
||||
}
|
||||
|
||||
|
|
|
@ -48,7 +48,7 @@ Notification::Notification(const NetworkPacket &np, const Device *device, QObjec
|
|||
parseNetworkPacket(np);
|
||||
createKNotification(np);
|
||||
|
||||
connect(m_notification, QOverload<unsigned int>::of(&KNotification::activated), this, [this](unsigned int actionIndex) {
|
||||
connect(m_notification, &KNotification::activated, this, [this](unsigned int actionIndex) {
|
||||
// Since 5.81 we use KNotification's inline reply instead of our own action
|
||||
#if KNOTIFICATIONS_VERSION < QT_VERSION_CHECK(5, 81, 0)
|
||||
// Do nothing for our own reply action
|
||||
|
|
|
@ -92,7 +92,7 @@ void Mounter::onPackageReceived(const NetworkPacket &np)
|
|||
|
||||
connect(m_proc, &QProcess::started, this, &Mounter::onStarted);
|
||||
connect(m_proc, &QProcess::errorOccurred, this, &Mounter::onError);
|
||||
connect(m_proc, QOverload<int, QProcess::ExitStatus>::of(&QProcess::finished), this, &Mounter::onFinished);
|
||||
connect(m_proc, &QProcess::finished, this, &Mounter::onFinished);
|
||||
|
||||
QDir().mkpath(m_mountPoint);
|
||||
|
||||
|
@ -217,7 +217,7 @@ void Mounter::unmount(bool finished)
|
|||
|
||||
auto proc = m_proc;
|
||||
m_proc = nullptr;
|
||||
connect(proc, static_cast<void (QProcess::*)(int, QProcess::ExitStatus)>(&QProcess::finished), [proc]() {
|
||||
connect(proc, &QProcess::finished, [proc]() {
|
||||
qCDebug(KDECONNECT_PLUGIN_SFTP) << "Free" << proc;
|
||||
proc->deleteLater();
|
||||
});
|
||||
|
|
|
@ -23,7 +23,7 @@ ShareConfig::ShareConfig(QObject *parent, const QVariantList &args)
|
|||
m_ui->commentLabel->setTextFormat(Qt::RichText);
|
||||
m_ui->commentLabel->setText(i18n("%1 in the path will be replaced with the specific device name."));
|
||||
|
||||
connect(m_ui->kurlrequester, SIGNAL(textChanged(QString)), this, SLOT(changed()));
|
||||
connect(m_ui->kurlrequester, &KUrlRequester::textChanged, this, &ShareConfig::markAsChanged);
|
||||
}
|
||||
|
||||
ShareConfig::~ShareConfig()
|
||||
|
|
|
@ -115,7 +115,7 @@ bool VirtualMonitorPlugin::requestVirtualMonitor()
|
|||
uuid.toString(),
|
||||
QS("--port"),
|
||||
port});
|
||||
connect(m_process, QOverload<int, QProcess::ExitStatus>::of(&QProcess::finished), this, [this](int exitCode, QProcess::ExitStatus exitStatus) {
|
||||
connect(m_process, &QProcess::finished, this, [this](int exitCode, QProcess::ExitStatus exitStatus) {
|
||||
qCWarning(KDECONNECT_PLUGIN_VIRTUALMONITOR) << "virtual display finished with" << device()->name() << m_process->readAllStandardError();
|
||||
|
||||
if (m_retries < 5 && (exitCode == 1 || exitStatus == QProcess::CrashExit)) {
|
||||
|
|
Loading…
Reference in a new issue