Compare commits
25 commits
master
...
work/mart/
Author | SHA1 | Date | |
---|---|---|---|
|
bc47ac3c42 | ||
|
1e3b4626e9 | ||
|
8fc0e78f93 | ||
|
4a4aa35ec4 | ||
|
4eddedb3dc | ||
|
b1b04eff67 | ||
|
120ac70802 | ||
|
4993daa973 | ||
|
44be5caf5b | ||
|
907d007f16 | ||
|
4c94b9d9f5 | ||
|
50ce331d40 | ||
|
7ee3feaa2e | ||
|
8558431e68 | ||
|
1ca156c5a0 | ||
|
81fea21100 | ||
|
624fadbe6e | ||
|
e203e9c049 | ||
|
5dcb60eb99 | ||
|
a5a375d7d9 | ||
|
719305550f | ||
|
b6af8d3dad | ||
|
c1be9a28eb | ||
|
cd3c02417e | ||
|
5b6d81c22d |
89 changed files with 552 additions and 467 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -33,3 +33,4 @@ CMakeLists.txt.user
|
|||
.idea
|
||||
/cmake-build*
|
||||
.clang-format
|
||||
app/resources.generated.qrc
|
||||
|
|
|
@ -11,6 +11,9 @@ project(kdeconnect VERSION ${RELEASE_SERVICE_VERSION})
|
|||
if (SAILFISHOS)
|
||||
set(KF5_MIN_VERSION "5.36.0")
|
||||
set(QT_MIN_VERSION "5.6.0")
|
||||
function(qt_add_resources)
|
||||
qt_add_resources(${ARGN})
|
||||
endfunction()
|
||||
else()
|
||||
set(KF5_MIN_VERSION "5.101.0")
|
||||
set(QT_MIN_VERSION "5.15.2")
|
||||
|
@ -50,6 +53,20 @@ ecm_setup_version(${RELEASE_SERVICE_VERSION}
|
|||
VERSION_HEADER ${CMAKE_CURRENT_BINARY_DIR}/kdeconnect-version.h
|
||||
)
|
||||
|
||||
if(QT_MAJOR_VERSION STREQUAL "6")
|
||||
set(KIRIGAMI_ICON "icon.name")
|
||||
set(KIRIGAMI_ICON_NAME "icon.name")
|
||||
set(KIRIGAMI_PAGE_ACTIONS "actions")
|
||||
set(QTQUICK_FILEDIALOG_FOLDER "currentFolder")
|
||||
else()
|
||||
set(QTQUICK_DIALOGS_IMPORT_VERSION 1.0)
|
||||
set(KIRIGAMI_ICON_NAME "iconName")
|
||||
set(KIRIGAMI_ICON "icon")
|
||||
set(KIRIGAMI_PAGE_ACTIONS "contextualActions")
|
||||
set(QTQUICK_FILEDIALOG_FOLDER "folder")
|
||||
endif()
|
||||
|
||||
|
||||
# Make the version header available by linking against kdeconnectversion
|
||||
add_library(kdeconnectversion INTERFACE)
|
||||
target_include_directories(kdeconnectversion INTERFACE ${CMAKE_CURRENT_BINARY_DIR})
|
||||
|
@ -76,8 +93,8 @@ else()
|
|||
)
|
||||
|
||||
if(UNIX AND NOT APPLE)
|
||||
find_package(KF5Package REQUIRED)
|
||||
find_package(KF5PulseAudioQt)
|
||||
find_package(KF${QT_MAJOR_VERSION}Package REQUIRED)
|
||||
find_package(KF${QT_MAJOR_VERSION}PulseAudioQt)
|
||||
if (QT_MAJOR_VERSION EQUAL "5")
|
||||
find_package(QtWaylandScanner REQUIRED)
|
||||
endif()
|
||||
|
@ -88,8 +105,8 @@ else()
|
|||
pkg_check_modules(GIO REQUIRED IMPORTED_TARGET gio-2.0)
|
||||
endif()
|
||||
|
||||
find_package(KF5PeopleVCard)
|
||||
set_package_properties(KF5PeopleVCard PROPERTIES
|
||||
find_package(KF${QT_MAJOR_VERSION}PeopleVCard)
|
||||
set_package_properties(KF${QT_MAJOR_VERSION}PeopleVCard PROPERTIES
|
||||
PURPOSE "Read vcards from the file system"
|
||||
URL "https://invent.kde.org/pim/kpeoplevcard"
|
||||
TYPE RUNTIME
|
||||
|
@ -108,9 +125,9 @@ find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} REQUIRED COMPONENTS DBus Qu
|
|||
if (UNIX AND NOT APPLE AND QT_MAJOR_VERSION EQUAL "5")
|
||||
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS X11Extras)
|
||||
endif()
|
||||
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS ${KF5_REQUIRED_COMPONENTS})
|
||||
find_package(KF${QT_MAJOR_VERSION} ${KF5_MIN_VERSION} REQUIRED COMPONENTS ${KF5_REQUIRED_COMPONENTS})
|
||||
if (KF5_OPTIONAL_COMPONENTS)
|
||||
find_package(KF5 ${KF5_MIN_VERSION} OPTIONAL_COMPONENTS ${KF5_OPTIONAL_COMPONENTS})
|
||||
find_package(KF${QT_MAJOR_VERSION} ${KF5_MIN_VERSION} OPTIONAL_COMPONENTS ${KF5_OPTIONAL_COMPONENTS})
|
||||
endif()
|
||||
|
||||
if (WIN32)
|
||||
|
@ -128,8 +145,8 @@ add_subdirectory(interfaces)
|
|||
|
||||
if (NOT SAILFISHOS)
|
||||
|
||||
find_package(KF5QQC2DesktopStyle ${KF5_MIN_VERSION} REQUIRED)
|
||||
set_package_properties(KF5QQC2DesktopStyle PROPERTIES TYPE RUNTIME)
|
||||
find_package(KF${QT_MAJOR_VERSION}QQC2DesktopStyle ${KF5_MIN_VERSION} REQUIRED)
|
||||
set_package_properties(KF${QT_MAJOR_VERSION}QQC2DesktopStyle PROPERTIES TYPE RUNTIME)
|
||||
|
||||
add_subdirectory(icons)
|
||||
add_subdirectory(data)
|
||||
|
|
|
@ -22,7 +22,7 @@ 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)
|
||||
install(FILES "${ARGV0}_config.qml" DESTINATION ${KDE_INSTALL_DATADIR}/kdeconnect)
|
||||
endif()
|
||||
endfunction()
|
||||
endif()
|
||||
|
|
|
@ -1,6 +1,11 @@
|
|||
qt5_add_resources(kdeconnect_SRCS resources.qrc)
|
||||
configure_file(qml/main.qml ${CMAKE_CURRENT_BINARY_DIR}/qml/main.qml)
|
||||
configure_file(qml/DevicePage.qml ${CMAKE_CURRENT_BINARY_DIR}/qml/DevicePage.qml)
|
||||
configure_file(qml/FindDevicesPage.qml ${CMAKE_CURRENT_BINARY_DIR}/qml/FindDevicesPage.qml)
|
||||
configure_file(resources.qrc.in ${CMAKE_CURRENT_SOURCE_DIR}/resources.generated.qrc)
|
||||
|
||||
qt5_add_resources(kdeconnect_custom_icons_SRCS ${CMAKE_SOURCE_DIR}/icons/custom_icons.qrc)
|
||||
qt_add_resources(kdeconnect_SRCS resources.generated.qrc)
|
||||
|
||||
qt_add_resources(kdeconnect_custom_icons_SRCS ${CMAKE_SOURCE_DIR}/icons/custom_icons.qrc)
|
||||
|
||||
ecm_setup_version(${PROJECT_VERSION}
|
||||
VARIABLE_PREFIX KDE_CONNECT
|
||||
|
@ -29,7 +34,7 @@ add_executable(kdeconnect-app
|
|||
${kdeconnect_SRCS}
|
||||
${kdeconnect_custom_icons_SRCS}
|
||||
)
|
||||
target_link_libraries(kdeconnect-app Qt::Quick Qt::QuickControls2 Qt::Widgets KF5::CoreAddons KF5::I18n KF5::KCMUtils)
|
||||
target_link_libraries(kdeconnect-app Qt::Quick Qt::QuickControls2 Qt::Widgets KF${QT_MAJOR_VERSION}::CoreAddons KF${QT_MAJOR_VERSION}::I18n KF${QT_MAJOR_VERSION}::KCMUtils)
|
||||
|
||||
install(TARGETS kdeconnect-app ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
|
||||
install(PROGRAMS org.kde.kdeconnect.app.desktop DESTINATION ${KDE_INSTALL_APPDIR})
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
import QtQuick 2.15
|
||||
import QtQuick.Controls 2.15 as QQC2
|
||||
import QtQuick.Layouts 1.15
|
||||
import QtQuick.Dialogs 1.0
|
||||
import QtQuick.Dialogs @QTQUICK_DIALOGS_IMPORT_VERSION@
|
||||
import org.kde.kirigami 2.20 as Kirigami
|
||||
import org.kde.kdeconnect 1.0
|
||||
|
||||
|
@ -16,15 +16,15 @@ Kirigami.ScrollablePage {
|
|||
property QtObject currentDevice
|
||||
title: currentDevice.name
|
||||
|
||||
actions.contextualActions: [
|
||||
@KIRIGAMI_PAGE_ACTIONS@: [
|
||||
Kirigami.Action {
|
||||
iconName:"network-disconnect"
|
||||
@KIRIGAMI_ICON_NAME@:"network-disconnect"
|
||||
onTriggered: root.currentDevice.unpair()
|
||||
text: i18nd("kdeconnect-app", "Unpair")
|
||||
visible: root.currentDevice.isTrusted
|
||||
},
|
||||
Kirigami.Action {
|
||||
iconName:"hands-free"
|
||||
@KIRIGAMI_ICON_NAME@:"hands-free"
|
||||
text: i18nd("kdeconnect-app", "Send Ping")
|
||||
visible: root.currentDevice.isTrusted && root.currentDevice.isReachable
|
||||
onTriggered: {
|
||||
|
@ -32,7 +32,7 @@ Kirigami.ScrollablePage {
|
|||
}
|
||||
},
|
||||
Kirigami.Action {
|
||||
iconName: "settings-configure"
|
||||
@KIRIGAMI_ICON_NAME@: "settings-configure"
|
||||
text: i18n("Plugin Settings")
|
||||
visible: root.currentDevice.isTrusted && root.currentDevice.isReachable
|
||||
onTriggered: {
|
||||
|
@ -155,7 +155,7 @@ Kirigami.ScrollablePage {
|
|||
id: fileDialog
|
||||
readonly property var shareIface: root.currentDevice ? ShareDbusInterfaceFactory.create(root.currentDevice.id()) : null
|
||||
title: i18nd("kdeconnect-app", "Please choose a file")
|
||||
folder: shortcuts.home
|
||||
@QTQUICK_FILEDIALOG_FOLDER@: shortcuts.home
|
||||
onAccepted: shareIface.shareUrl(fileDialog.fileUrl)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -61,7 +61,7 @@ Kirigami.ScrollablePage
|
|||
sourceModel: DevicesModel {}
|
||||
}
|
||||
delegate: Kirigami.BasicListItem {
|
||||
icon: iconName
|
||||
@KIRIGAMI_ICON@: iconName
|
||||
iconColor: "transparent"
|
||||
label: model.name
|
||||
subtitle: toolTip
|
||||
|
|
|
@ -74,7 +74,7 @@ Kirigami.ApplicationWindow {
|
|||
Kirigami.BasicListItem {
|
||||
id: findDevicesAction
|
||||
text: i18nd("kdeconnect-app", "Find devices...")
|
||||
icon: "list-add"
|
||||
@KIRIGAMI_ICON@: "list-add"
|
||||
checked: pageStack.currentItem && pageStack.currentItem.objectName == "FindDevices"
|
||||
Layout.fillWidth: true
|
||||
|
||||
|
@ -119,7 +119,7 @@ Kirigami.ApplicationWindow {
|
|||
|
||||
Kirigami.BasicListItem {
|
||||
text: i18n("Settings")
|
||||
icon: "settings-configure"
|
||||
@KIRIGAMI_ICON@: "settings-configure"
|
||||
onClicked: pageStack.pushDialogLayer('qrc:/qml/Settings.qml', {}, {
|
||||
title: i18n("Settings"),
|
||||
});
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
<!DOCTYPE RCC><RCC version="1.0">
|
||||
<qresource>
|
||||
<file>qml/main.qml</file>
|
||||
<file alias="qml/main.qml">@CMAKE_CURRENT_BINARY_DIR@/qml/main.qml</file>
|
||||
<file>qml/mpris.qml</file>
|
||||
<file>qml/mousepad.qml</file>
|
||||
<file>qml/presentationRemote.qml</file>
|
||||
|
||||
<file>qml/PluginItem.qml</file>
|
||||
<file>qml/DevicePage.qml</file>
|
||||
<file>qml/FindDevicesPage.qml</file>
|
||||
<file alias="qml/DevicePage.qml">@CMAKE_CURRENT_BINARY_DIR@/qml/DevicePage.qml</file>
|
||||
<file alias="qml/FindDevicesPage.qml">@CMAKE_CURRENT_BINARY_DIR@/qml/FindDevicesPage.qml</file>
|
||||
<file>qml/runcommand.qml</file>
|
||||
<file>qml/volume.qml</file>
|
||||
<file>qml/MprisSlider.qml</file>
|
|
@ -7,8 +7,8 @@ target_link_libraries(kdeconnect-cli
|
|||
kdeconnectinterfaces
|
||||
kdeconnectcore
|
||||
kdeconnectversion
|
||||
KF5::CoreAddons
|
||||
KF5::I18n
|
||||
KF${QT_MAJOR_VERSION}::CoreAddons
|
||||
KF${QT_MAJOR_VERSION}::I18n
|
||||
)
|
||||
|
||||
install(TARGETS kdeconnect-cli ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
|
||||
|
|
|
@ -58,16 +58,16 @@ target_include_directories(kdeconnectcore PUBLIC ${PROJECT_SOURCE_DIR})
|
|||
target_link_libraries(kdeconnectcore
|
||||
PUBLIC
|
||||
Qt${QT_MAJOR_VERSION}::Network
|
||||
KF5::CoreAddons
|
||||
KF${QT_MAJOR_VERSION}::CoreAddons
|
||||
${Qca_LIBRARY}
|
||||
PRIVATE
|
||||
Qt${QT_MAJOR_VERSION}::DBus
|
||||
KF5::I18n
|
||||
KF5::ConfigCore
|
||||
KF${QT_MAJOR_VERSION}::I18n
|
||||
KF${QT_MAJOR_VERSION}::ConfigCore
|
||||
)
|
||||
|
||||
if(${KF5KIO_FOUND})
|
||||
target_link_libraries(kdeconnectcore PUBLIC KF5::KIOCore KF5::KIOGui)
|
||||
if(KF5KIO_FOUND OR KF6KIO_FOUND)
|
||||
target_link_libraries(kdeconnectcore PUBLIC KF${QT_MAJOR_VERSION}::KIOCore KF${QT_MAJOR_VERSION}::KIOGui)
|
||||
endif()
|
||||
|
||||
if (BLUETOOTH_ENABLED)
|
||||
|
|
|
@ -98,7 +98,7 @@ void CompositeUploadJob::startNextSubJob()
|
|||
#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);
|
||||
connect(m_currentJob, &UploadJob::processedAmountChanged, this, &CompositeUploadJob::slotProcessedAmount);
|
||||
#endif
|
||||
// Already done by KCompositeJob
|
||||
// connect(m_currentJob, &KJob::result, this, &CompositeUploadJob::slotResult);
|
||||
|
|
|
@ -13,15 +13,13 @@
|
|||
#include <netinet/tcp.h>
|
||||
#include <sys/socket.h>
|
||||
#else
|
||||
#include <winsock2.h>
|
||||
#include <mstcpip.h>
|
||||
#include <winsock2.h>
|
||||
#endif
|
||||
|
||||
#include <QHostInfo>
|
||||
#include <QMetaEnum>
|
||||
#include <QNetworkConfigurationManager>
|
||||
#include <QNetworkProxy>
|
||||
#include <QNetworkSession>
|
||||
#include <QSslCipher>
|
||||
#include <QSslConfiguration>
|
||||
#include <QSslKey>
|
||||
|
@ -60,17 +58,22 @@ LanLinkProvider::LanLinkProvider(bool testMode, quint16 udpBroadcastPort, quint1
|
|||
|
||||
m_udpSocket.setProxy(QNetworkProxy::NoProxy);
|
||||
|
||||
// Detect when a network interface changes status, so we announce ourselves in the new network
|
||||
#if QT_VERSION_MAJOR < 6
|
||||
QNetworkConfigurationManager *networkManager = new QNetworkConfigurationManager(this);
|
||||
connect(networkManager, &QNetworkConfigurationManager::configurationChanged, this, &LanLinkProvider::onNetworkConfigurationChanged);
|
||||
}
|
||||
|
||||
void LanLinkProvider::onNetworkConfigurationChanged(const QNetworkConfiguration &config)
|
||||
{
|
||||
if (m_lastConfig != config && config.state() == QNetworkConfiguration::Active) {
|
||||
m_lastConfig = config;
|
||||
onNetworkChange();
|
||||
}
|
||||
connect(networkManager, &QNetworkConfigurationManager::configurationChanged, this, [this](QNetworkConfiguration config) {
|
||||
if (m_lastConfig != config && config.state() == QNetworkConfiguration::Active) {
|
||||
m_lastConfig = config;
|
||||
onNetworkChange();
|
||||
}
|
||||
});
|
||||
#else
|
||||
// Detect when a network interface changes status, so we announce ourselves in the new network
|
||||
connect(QNetworkInformation::instance(), &QNetworkInformation::reachabilityChanged, this, [this]() {
|
||||
if (QNetworkInformation::instance()->reachability() == QNetworkInformation::Reachability::Online) {
|
||||
onNetworkChange();
|
||||
}
|
||||
});
|
||||
#endif
|
||||
}
|
||||
|
||||
LanLinkProvider::~LanLinkProvider()
|
||||
|
@ -602,7 +605,7 @@ void LanLinkProvider::configureSocket(QSslSocket *socket)
|
|||
#endif
|
||||
|
||||
#if defined(Q_OS_WIN)
|
||||
int maxIdle = 5 * 60 * 1000; // 5 minutes of idle before sending keep-alives
|
||||
int maxIdle = 5 * 60 * 1000; // 5 minutes of idle before sending keep-alive
|
||||
int interval = 5 * 1000; // 5 seconds interval between probes after 5 minute delay
|
||||
DWORD nop;
|
||||
|
||||
|
@ -610,12 +613,10 @@ void LanLinkProvider::configureSocket(QSslSocket *socket)
|
|||
struct tcp_keepalive keepalive = {
|
||||
1 /* true */,
|
||||
maxIdle,
|
||||
interval
|
||||
interval,
|
||||
};
|
||||
|
||||
int rv = WSAIoctl(socket->socketDescriptor(), SIO_KEEPALIVE_VALS, &keepalive,
|
||||
sizeof(keepalive), nullptr, 0, &nop,
|
||||
nullptr, nullptr);
|
||||
int rv = WSAIoctl(socket->socketDescriptor(), SIO_KEEPALIVE_VALS, &keepalive, sizeof(keepalive), nullptr, 0, &nop, nullptr, nullptr);
|
||||
if (!rv) {
|
||||
int error = WSAGetLastError();
|
||||
qCDebug(KDECONNECT_CORE) << "Could not enable TCP Keep-Alive: " << error;
|
||||
|
|
|
@ -7,12 +7,17 @@
|
|||
#ifndef LANLINKPROVIDER_H
|
||||
#define LANLINKPROVIDER_H
|
||||
|
||||
#include <QNetworkSession>
|
||||
#include <QObject>
|
||||
#include <QSslSocket>
|
||||
#include <QTcpServer>
|
||||
#include <QTimer>
|
||||
#include <QUdpSocket>
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||
#include <QNetworkConfigurationManager>
|
||||
#include <QNetworkSession>
|
||||
#else
|
||||
#include <QNetworkInformation>
|
||||
#endif
|
||||
|
||||
#include "backends/linkprovider.h"
|
||||
#include "kdeconnectcore_export.h"
|
||||
|
@ -75,7 +80,6 @@ private Q_SLOTS:
|
|||
private:
|
||||
LanPairingHandler *createPairingHandler(DeviceLink *link);
|
||||
|
||||
void onNetworkConfigurationChanged(const QNetworkConfiguration &config);
|
||||
void addLink(const QString &deviceId, QSslSocket *socket, NetworkPacket *receivedPacket, LanDeviceLink::ConnectionStarted connectionOrigin);
|
||||
QList<QHostAddress> getBroadcastAddresses();
|
||||
void sendBroadcasts(QUdpSocket &socket, const NetworkPacket &np, const QList<QHostAddress> &addresses);
|
||||
|
@ -95,9 +99,11 @@ private:
|
|||
QHostAddress sender;
|
||||
};
|
||||
QMap<QSslSocket *, PendingConnect> m_receivedIdentityPackets;
|
||||
QNetworkConfiguration m_lastConfig;
|
||||
const bool m_testMode;
|
||||
QTimer m_combineBroadcastsTimer;
|
||||
#if QT_VERSION_MAJOR < 6
|
||||
QNetworkConfiguration m_lastConfig;
|
||||
#endif
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -50,10 +50,7 @@ void CompositeFileTransferJob::startNextSubJob()
|
|||
#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);
|
||||
connect(m_currentJob, &FileTransferJob::processedAmountChanged, this, &CompositeFileTransferJob::slotProcessedAmount);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
#include <QDebug>
|
||||
#include <QFile>
|
||||
#include <QProcess>
|
||||
#include <QRegExp>
|
||||
#include <QRegularExpression>
|
||||
#include <QStandardPaths>
|
||||
#include <QUrl>
|
||||
|
||||
|
@ -44,7 +44,7 @@ static DBusInstancePrivate dbusInstance;
|
|||
|
||||
void filterNonExportableCharacters(QString &s)
|
||||
{
|
||||
static QRegExp regexp(QStringLiteral("[^A-Za-z0-9_]"), Qt::CaseSensitive, QRegExp::Wildcard);
|
||||
static QRegularExpression regexp(QStringLiteral("[^A-Za-z0-9_]"), QRegularExpression::CaseInsensitiveOption);
|
||||
s.replace(regexp, QLatin1String("_"));
|
||||
}
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
#include "networkpacket.h"
|
||||
#include "pluginloader.h"
|
||||
|
||||
// In older Qt released, qAsConst isnt available
|
||||
// In older Qt released, qAsConst isn't available
|
||||
#include "qtcompat_p.h"
|
||||
|
||||
class Device::DevicePrivate
|
||||
|
@ -76,7 +76,7 @@ Device::Device(QObject *parent, const QString &id)
|
|||
QDBusConnection::sessionBus().registerObject(dbusPath(), this, QDBusConnection::ExportScriptableContents | QDBusConnection::ExportAdaptors);
|
||||
|
||||
// Assume every plugin is supported until addLink is called and we can get the actual list
|
||||
d->m_allPlugins = PluginLoader::instance()->getPluginList().toSet();
|
||||
d->m_allPlugins = PluginLoader::instance()->getPluginSet();
|
||||
d->m_supportedPlugins = d->m_allPlugins;
|
||||
|
||||
connect(this, &Device::pairingError, this, &warn);
|
||||
|
@ -87,7 +87,7 @@ Device::Device(QObject *parent, const NetworkPacket &identityPacket, DeviceLink
|
|||
, d(new Device::DevicePrivate(identityPacket.get<QString>(QStringLiteral("deviceId"))))
|
||||
{
|
||||
d->m_deviceName = identityPacket.get<QString>(QStringLiteral("deviceName"));
|
||||
d->m_allPlugins = PluginLoader::instance()->getPluginList().toSet();
|
||||
d->m_allPlugins = PluginLoader::instance()->getPluginSet();
|
||||
|
||||
addLink(identityPacket, dl);
|
||||
|
||||
|
@ -132,7 +132,7 @@ int Device::protocolVersion()
|
|||
|
||||
QStringList Device::supportedPlugins() const
|
||||
{
|
||||
return d->m_supportedPlugins.toList();
|
||||
return QList(d->m_supportedPlugins.cbegin(), d->m_supportedPlugins.cend());
|
||||
}
|
||||
|
||||
bool Device::hasPlugin(const QString &name) const
|
||||
|
@ -158,8 +158,7 @@ void Device::reloadPlugins()
|
|||
const KPluginMetaData service = loader->getPluginInfo(pluginName);
|
||||
|
||||
const bool pluginEnabled = isPluginEnabled(pluginName);
|
||||
const QSet<QString> incomingCapabilities =
|
||||
KPluginMetaData::readStringList(service.rawData(), QStringLiteral("X-KdeConnect-SupportedPacketType")).toSet();
|
||||
const QStringList incomingCapabilities = service.rawData().value(QStringLiteral("X-KdeConnect-SupportedPacketType")).toVariant().toStringList();
|
||||
|
||||
if (pluginEnabled) {
|
||||
KdeConnectPlugin *plugin = d->m_plugins.take(pluginName);
|
||||
|
@ -291,14 +290,22 @@ void Device::addLink(const NetworkPacket &identityPacket, DeviceLink *link)
|
|||
std::sort(d->m_deviceLinks.begin(), d->m_deviceLinks.end(), lessThan);
|
||||
|
||||
const bool capabilitiesSupported = identityPacket.has(QStringLiteral("incomingCapabilities")) || identityPacket.has(QStringLiteral("outgoingCapabilities"));
|
||||
const auto toSet = [](const QStringList &l) {
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
|
||||
return l.toSet();
|
||||
#else
|
||||
return QSet(l.begin(), l.end());
|
||||
#endif
|
||||
};
|
||||
|
||||
if (capabilitiesSupported) {
|
||||
const QSet<QString> outgoingCapabilities = identityPacket.get<QStringList>(QStringLiteral("outgoingCapabilities")).toSet(),
|
||||
incomingCapabilities = identityPacket.get<QStringList>(QStringLiteral("incomingCapabilities")).toSet();
|
||||
const QSet<QString> outgoingCapabilities = toSet(identityPacket.get<QStringList>(QStringLiteral("outgoingCapabilities"))),
|
||||
incomingCapabilities = toSet(identityPacket.get<QStringList>(QStringLiteral("incomingCapabilities")));
|
||||
|
||||
d->m_supportedPlugins = PluginLoader::instance()->pluginsForCapabilities(incomingCapabilities, outgoingCapabilities);
|
||||
// qDebug() << "new plugins for" << m_deviceName << m_supportedPlugins << incomingCapabilities << outgoingCapabilities;
|
||||
} else {
|
||||
d->m_supportedPlugins = PluginLoader::instance()->getPluginList().toSet();
|
||||
d->m_supportedPlugins = PluginLoader::instance()->getPluginSet();
|
||||
}
|
||||
|
||||
reloadPlugins();
|
||||
|
|
|
@ -22,7 +22,13 @@ KdeConnectPlugin::KdeConnectPlugin(QObject *parent, const QVariantList &args)
|
|||
{
|
||||
d->m_device = qvariant_cast<Device *>(args.at(0));
|
||||
d->m_pluginName = args.at(1).toString();
|
||||
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
|
||||
const QStringList cap = args.at(2).toStringList();
|
||||
d->m_outgoingCapabilties = QSet(cap.begin(), cap.end());
|
||||
#else
|
||||
d->m_outgoingCapabilties = args.at(2).toStringList().toSet();
|
||||
#endif
|
||||
d->m_config = nullptr;
|
||||
d->iconName = args.at(3).toString();
|
||||
}
|
||||
|
|
|
@ -7,18 +7,17 @@
|
|||
#include "pluginloader.h"
|
||||
|
||||
#include <KPluginFactory>
|
||||
#include <KPluginLoader>
|
||||
#include <KPluginMetaData>
|
||||
#include <QPluginLoader>
|
||||
#include <QStaticPlugin>
|
||||
#include <QVector>
|
||||
|
||||
#include "kdeconnectconfig.h"
|
||||
#include "core_debug.h"
|
||||
#include "device.h"
|
||||
#include "kdeconnectconfig.h"
|
||||
#include "kdeconnectplugin.h"
|
||||
|
||||
// In older Qt released, qAsConst isnt available
|
||||
// In older Qt released, qAsConst isn't available
|
||||
#include "qtcompat_p.h"
|
||||
|
||||
PluginLoader *PluginLoader::instance()
|
||||
|
@ -40,7 +39,7 @@ PluginLoader::PluginLoader()
|
|||
}
|
||||
}
|
||||
#else
|
||||
const QVector<KPluginMetaData> data = KPluginLoader::findPlugins(QStringLiteral("kdeconnect/"));
|
||||
const QVector<KPluginMetaData> data = KPluginMetaData::findPlugins(QStringLiteral("kdeconnect/"));
|
||||
for (const KPluginMetaData &metadata : data) {
|
||||
plugins[metadata.pluginId()] = metadata;
|
||||
}
|
||||
|
@ -70,15 +69,14 @@ KdeConnectPlugin *PluginLoader::instantiatePluginForDevice(const QString &plugin
|
|||
#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();
|
||||
auto factoryResult = KPluginFactory::loadFactory(service);
|
||||
if (!factoryResult) {
|
||||
qCDebug(KDECONNECT_CORE) << "KPluginFactory could not load the plugin:" << service.pluginId() << factoryResult.errorString;
|
||||
return ret;
|
||||
}
|
||||
KPluginFactory *factory = factoryResult.plugin;
|
||||
#endif
|
||||
|
||||
const QStringList outgoingInterfaces = KPluginMetaData::readStringList(service.rawData(), QStringLiteral("X-KdeConnect-OutgoingPacketType"));
|
||||
const QStringList outgoingInterfaces = service.rawData().value(QStringLiteral("X-KdeConnect-OutgoingPacketType")).toVariant().toStringList();
|
||||
|
||||
QVariant deviceVariant = QVariant::fromValue<Device *>(device);
|
||||
|
||||
|
@ -119,33 +117,32 @@ QSet<QString> PluginLoader::pluginsForCapabilities(const QSet<QString> &incoming
|
|||
QString myDeviceType = KdeConnectConfig::instance().deviceType();
|
||||
|
||||
for (const KPluginMetaData &service : qAsConst(plugins)) {
|
||||
|
||||
// Check if the plugin support this device type
|
||||
const QSet<QString> supportedDeviceTypes = KPluginMetaData::readStringList(service.rawData(), QStringLiteral("X-KdeConnect-SupportedDeviceTypes")).toSet();
|
||||
const QStringList supportedDeviceTypes = service.rawData().value(QStringLiteral("X-KdeConnect-SupportedDeviceTypes")).toVariant().toStringList();
|
||||
if (!supportedDeviceTypes.isEmpty()) {
|
||||
if (!supportedDeviceTypes.contains(myDeviceType)) {
|
||||
qCDebug(KDECONNECT_CORE) << "Not loading plugin" << service.pluginId() << "because this device of type" << myDeviceType << "is not supported. Supports:" << supportedDeviceTypes.toList().join(QStringLiteral(", "));
|
||||
qCDebug(KDECONNECT_CORE) << "Not loading plugin" << service.pluginId() << "because this device of type" << myDeviceType
|
||||
<< "is not supported. Supports:" << supportedDeviceTypes.join(QStringLiteral(", "));
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// Check if capbilites intersect with the remote device
|
||||
const QSet<QString> pluginIncomingCapabilities =
|
||||
KPluginMetaData::readStringList(service.rawData(), QStringLiteral("X-KdeConnect-SupportedPacketType")).toSet();
|
||||
const QSet<QString> pluginOutgoingCapabilities =
|
||||
KPluginMetaData::readStringList(service.rawData(), QStringLiteral("X-KdeConnect-OutgoingPacketType")).toSet();
|
||||
const QStringList pluginIncomingCapabilities = service.rawData().value(QStringLiteral("X-KdeConnect-SupportedPacketType")).toVariant().toStringList();
|
||||
const QStringList pluginOutgoingCapabilities = service.rawData().value(QStringLiteral("X-KdeConnect-OutgoingPacketType")).toVariant().toStringList();
|
||||
|
||||
bool capabilitiesEmpty = (pluginIncomingCapabilities.isEmpty() && pluginOutgoingCapabilities.isEmpty());
|
||||
if (!capabilitiesEmpty) {
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 6, 0))
|
||||
bool capabilitiesIntersect = (outgoing.intersects(pluginIncomingCapabilities) || incoming.intersects(pluginOutgoingCapabilities));
|
||||
#else
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 6, 0))
|
||||
bool capabilitiesIntersect = (outgoing.intersects(QSet(pluginIncomingCapabilities.begin(), pluginIncomingCapabilities.end()))
|
||||
|| incoming.intersects(QSet(pluginOutgoingCapabilities.begin(), pluginOutgoingCapabilities.end())));
|
||||
#else
|
||||
QSet<QString> commonIncoming = incoming;
|
||||
commonIncoming.intersect(pluginOutgoingCapabilities);
|
||||
commonIncoming.intersect(pluginOutgoingCapabilities.toSet());
|
||||
QSet<QString> commonOutgoing = outgoing;
|
||||
commonOutgoing.intersect(pluginIncomingCapabilities);
|
||||
commonOutgoing.intersect(pluginIncomingCapabilities.toSet());
|
||||
bool capabilitiesIntersect = (!commonIncoming.isEmpty() || !commonOutgoing.isEmpty());
|
||||
#endif
|
||||
#endif
|
||||
|
||||
if (!capabilitiesIntersect) {
|
||||
qCDebug(KDECONNECT_CORE) << "Not loading plugin" << service.pluginId() << "because device doesn't support it";
|
||||
|
@ -155,7 +152,6 @@ QSet<QString> PluginLoader::pluginsForCapabilities(const QSet<QString> &incoming
|
|||
|
||||
// If we get here, the plugin can be loaded
|
||||
ret += service.pluginId();
|
||||
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
|
|
@ -25,6 +25,15 @@ public:
|
|||
static PluginLoader *instance();
|
||||
|
||||
QStringList getPluginList() const;
|
||||
QSet<QString> getPluginSet() const
|
||||
{
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
|
||||
return getPluginList().toSet();
|
||||
#else
|
||||
const QStringList pluginList = getPluginList();
|
||||
return QSet(pluginList.begin(), pluginList.end());
|
||||
#endif
|
||||
}
|
||||
KPluginMetaData getPluginInfo(const QString &name) const;
|
||||
KdeConnectPlugin *instantiatePluginForDevice(const QString &name, Device *device) const;
|
||||
|
||||
|
|
|
@ -7,16 +7,16 @@ ecm_qt_declare_logging_category(
|
|||
DEFAULT_SEVERITY Warning
|
||||
EXPORT kdeconnect-kde DESCRIPTION "kdeconnect (daemon)")
|
||||
|
||||
qt5_add_resources(kdeconnect_custom_icons_SRCS ${CMAKE_SOURCE_DIR}/icons/custom_icons.qrc)
|
||||
qt_add_resources(kdeconnect_custom_icons_SRCS ${CMAKE_SOURCE_DIR}/icons/custom_icons.qrc)
|
||||
|
||||
add_executable(kdeconnectd kdeconnectd.cpp ${kdeconnect_custom_icons_SRCS} ${debug_file_SRCS})
|
||||
target_link_libraries(kdeconnectd
|
||||
kdeconnectcore kdeconnectversion
|
||||
KF5::KIOWidgets
|
||||
KF5::DBusAddons
|
||||
KF5::Notifications
|
||||
KF5::I18n
|
||||
KF5::WindowSystem
|
||||
KF${QT_MAJOR_VERSION}::KIOWidgets
|
||||
KF${QT_MAJOR_VERSION}::DBusAddons
|
||||
KF${QT_MAJOR_VERSION}::Notifications
|
||||
KF${QT_MAJOR_VERSION}::I18n
|
||||
KF${QT_MAJOR_VERSION}::WindowSystem
|
||||
Qt::Widgets)
|
||||
|
||||
ecm_mark_nongui_executable(kdeconnectd)
|
||||
|
|
|
@ -16,10 +16,10 @@
|
|||
|
||||
#include <KAboutData>
|
||||
#include <KDBusService>
|
||||
#include <KIO/Global>
|
||||
#include <KLocalizedString>
|
||||
#include <KNotification>
|
||||
#include <KWindowSystem>
|
||||
#include <KIO/Global>
|
||||
|
||||
#include <dbushelper.h>
|
||||
|
||||
|
@ -61,7 +61,7 @@ public:
|
|||
oc.openConfiguration(deviceId);
|
||||
};
|
||||
connect(notification, &KNotification::action3Activated, openSettings);
|
||||
connect(notification, QOverload<>::of(&KNotification::activated), openSettings);
|
||||
connect(notification, QOverload<unsigned int>::of(&KNotification::activated), openSettings);
|
||||
notification->sendEvent();
|
||||
}
|
||||
|
||||
|
|
|
@ -41,10 +41,10 @@ QtObject {
|
|||
readonly property var v: DBusAsyncResponse {
|
||||
id: response
|
||||
autoDelete: false
|
||||
onSuccess: {
|
||||
onSuccess: result => {
|
||||
prop._value = result;
|
||||
}
|
||||
onError: {
|
||||
onError: message => {
|
||||
console.warn("failed call", object, read, write, change)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,8 +10,8 @@ ecm_qt_declare_logging_category(
|
|||
add_library(kdeconnectfileitemaction MODULE sendfileitemaction.cpp ${debug_file_SRCS})
|
||||
target_link_libraries(
|
||||
kdeconnectfileitemaction
|
||||
KF5::KIOWidgets
|
||||
KF5::I18n
|
||||
KF${QT_MAJOR_VERSION}::KIOWidgets
|
||||
KF${QT_MAJOR_VERSION}::I18n
|
||||
kdeconnectinterfaces
|
||||
kdeconnectcore
|
||||
)
|
||||
|
|
|
@ -7,7 +7,7 @@ ecm_qt_declare_logging_category(
|
|||
DEFAULT_SEVERITY Warning
|
||||
EXPORT kdeconnect-kde DESCRIPTION "kdeconnect (indicator)")
|
||||
|
||||
qt5_add_resources(kdeconnect_custom_icons_SRCS ${CMAKE_SOURCE_DIR}/icons/custom_icons.qrc)
|
||||
qt_add_resources(kdeconnect_custom_icons_SRCS ${CMAKE_SOURCE_DIR}/icons/custom_icons.qrc)
|
||||
|
||||
set(indicator_SRCS
|
||||
main.cpp
|
||||
|
@ -43,7 +43,7 @@ add_executable(kdeconnect-indicator ${indicator_SRCS} ${debug_file_SRCS})
|
|||
|
||||
target_include_directories(kdeconnect-indicator PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/systray_actions)
|
||||
|
||||
target_link_libraries(kdeconnect-indicator Qt::Widgets KF5::CoreAddons KF5::I18n KF5::Notifications KF5::DBusAddons KF5::KCMUtils kdeconnectinterfaces kdeconnectcore kdeconnectversion)
|
||||
target_link_libraries(kdeconnect-indicator Qt::Widgets KF${QT_MAJOR_VERSION}::CoreAddons KF${QT_MAJOR_VERSION}::I18n KF${QT_MAJOR_VERSION}::Notifications KF${QT_MAJOR_VERSION}::DBusAddons KF${QT_MAJOR_VERSION}::KCMUtils kdeconnectinterfaces kdeconnectcore kdeconnectversion)
|
||||
|
||||
if (WIN32)
|
||||
add_compile_definitions(QSYSTRAY)
|
||||
|
|
|
@ -59,7 +59,13 @@ geninterface(${PROJECT_SOURCE_DIR}/plugins/bigscreen/bigscreenplugin.h bigscreen
|
|||
geninterface(${PROJECT_SOURCE_DIR}/plugins/virtualmonitor/virtualmonitorplugin.h virtualmonitorinterface)
|
||||
geninterface(${PROJECT_SOURCE_DIR}/plugins/photo/photoplugin.h photointerface)
|
||||
|
||||
add_library(kdeconnectinterfaces ${libkdeconnect_SRC})
|
||||
if ("${QT_MAJOR_VERSION}" STREQUAL "6")
|
||||
add_library(kdeconnectinterfaces STATIC)
|
||||
else()
|
||||
add_library(kdeconnectinterfaces)
|
||||
endif()
|
||||
|
||||
target_sources(kdeconnectinterfaces PRIVATE ${libkdeconnect_SRC})
|
||||
set_target_properties(kdeconnectinterfaces PROPERTIES
|
||||
VERSION ${KDECONNECT_VERSION}
|
||||
SOVERSION ${KDECONNECT_VERSION_MAJOR}
|
||||
|
@ -71,12 +77,12 @@ target_link_libraries(kdeconnectinterfaces
|
|||
LINK_PUBLIC
|
||||
Qt${QT_MAJOR_VERSION}::Gui
|
||||
Qt${QT_MAJOR_VERSION}::DBus
|
||||
KF5::ConfigCore
|
||||
KF${QT_MAJOR_VERSION}::ConfigCore
|
||||
LINK_PRIVATE
|
||||
kdeconnectcore
|
||||
KF5::I18n
|
||||
KF${QT_MAJOR_VERSION}::I18n
|
||||
kdeconnectcore
|
||||
KF5::CoreAddons
|
||||
KF${QT_MAJOR_VERSION}::CoreAddons
|
||||
)
|
||||
|
||||
install(TARGETS kdeconnectinterfaces EXPORT kdeconnectLibraryTargets ${KDE_INSTALL_TARGETS_DEFAULT_ARGS} LIBRARY NAMELINK_SKIP)
|
||||
|
|
|
@ -8,8 +8,11 @@
|
|||
|
||||
#include <QDebug>
|
||||
|
||||
#include "kcoreaddons_version.h"
|
||||
#include <KConfigGroup>
|
||||
#if KCOREADDONS_VERSION < QT_VERSION_CHECK(5, 86, 0)
|
||||
#include <KPluginLoader>
|
||||
#endif
|
||||
|
||||
PluginModel::PluginModel(QObject *parent)
|
||||
: QAbstractListModel(parent)
|
||||
|
@ -18,7 +21,11 @@ PluginModel::PluginModel(QObject *parent)
|
|||
connect(this, &QAbstractItemModel::rowsRemoved, this, &PluginModel::rowsChanged);
|
||||
|
||||
beginResetModel();
|
||||
#if KCOREADDONS_VERSION < QT_VERSION_CHECK(5, 84, 0)
|
||||
m_plugins = KPluginLoader::findPlugins(QStringLiteral("kdeconnect/"));
|
||||
#else
|
||||
m_plugins = KPluginMetaData::findPlugins(QStringLiteral("kdeconnect/"));
|
||||
#endif
|
||||
endResetModel();
|
||||
}
|
||||
|
||||
|
|
|
@ -9,8 +9,8 @@ ki18n_wrap_ui(kcm_kdeconnect kcm.ui)
|
|||
target_link_libraries(kcm_kdeconnect
|
||||
Qt::Core
|
||||
Qt::Gui
|
||||
KF5::I18n
|
||||
KF5::KCMUtils
|
||||
KF${QT_MAJOR_VERSION}::I18n
|
||||
KF${QT_MAJOR_VERSION}::KCMUtils
|
||||
kdeconnectinterfaces
|
||||
kdeconnectversion
|
||||
)
|
||||
|
|
35
kcm/kcm.cpp
35
kcm/kcm.cpp
|
@ -27,32 +27,19 @@ static QString createId()
|
|||
return QStringLiteral("kcm") + QString::number(QCoreApplication::applicationPid());
|
||||
}
|
||||
|
||||
KdeConnectKcm::KdeConnectKcm(QWidget *parent, const QVariantList &args)
|
||||
: KCModule(parent)
|
||||
KdeConnectKcm::KdeConnectKcm(QObject *parent, const QVariantList &args)
|
||||
: KCModule(qobject_cast<QWidget *>(parent))
|
||||
, kcmUi(new Ui::KdeConnectKcmUi())
|
||||
, daemon(new DaemonDbusInterface(this))
|
||||
, devicesModel(new DevicesModel(this))
|
||||
, currentDevice(nullptr)
|
||||
{
|
||||
KAboutData *about = new KAboutData(QStringLiteral("kdeconnect-kcm"),
|
||||
i18n("KDE Connect Settings"),
|
||||
QStringLiteral(KDECONNECT_VERSION_STRING),
|
||||
i18n("KDE Connect Settings module"),
|
||||
KAboutLicense::KAboutLicense::GPL_V2,
|
||||
i18n("(C) 2015 Albert Vaca Cintora"),
|
||||
QString(),
|
||||
QStringLiteral("https://community.kde.org/KDEConnect"));
|
||||
about->addAuthor(i18n("Albert Vaca Cintora"));
|
||||
about->setProgramLogo(QIcon(QStringLiteral(":/icons/kdeconnect/kdeconnect.svg")));
|
||||
|
||||
setAboutData(about);
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
KColorSchemeManager manager;
|
||||
QApplication::setStyle(QStringLiteral("breeze"));
|
||||
#endif
|
||||
|
||||
kcmUi->setupUi(this);
|
||||
kcmUi->setupUi(widget());
|
||||
|
||||
sortProxyModel = new DevicesSortProxyModel(devicesModel);
|
||||
|
||||
|
@ -95,8 +82,6 @@ KdeConnectKcm::KdeConnectKcm(QWidget *parent, const QVariantList &args)
|
|||
|
||||
daemon->acquireDiscoveryMode(createId());
|
||||
|
||||
#if KCMUTILS_VERSION >= QT_VERSION_CHECK(5, 45, 0)
|
||||
|
||||
if (!args.isEmpty() && args.first().type() == QVariant::String) {
|
||||
const QString input = args.first().toString();
|
||||
const auto colonIdx = input.indexOf(QLatin1Char(':'));
|
||||
|
@ -115,8 +100,6 @@ KdeConnectKcm::KdeConnectKcm(QWidget *parent, const QVariantList &args)
|
|||
disconnect(devicesModel, &DevicesModel::rowsInserted, this, nullptr);
|
||||
});
|
||||
}
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
void KdeConnectKcm::renameShow()
|
||||
|
@ -251,7 +234,7 @@ void KdeConnectKcm::resetDeviceView()
|
|||
|
||||
KSharedConfigPtr deviceConfig = KSharedConfig::openConfig(currentDevice->pluginsConfigFile());
|
||||
kcmUi->pluginSelector->clear();
|
||||
kcmUi->pluginSelector->setConfigurationArguments(QStringList(currentDevice->id()));
|
||||
kcmUi->pluginSelector->setConfigurationArguments({currentDevice->id()});
|
||||
kcmUi->pluginSelector->addPlugins(availablePluginInfo, i18n("Available plugins"));
|
||||
kcmUi->pluginSelector->setConfig(deviceConfig->group("Plugins"));
|
||||
connect(kcmUi->pluginSelector, &KPluginWidget::changed, this, &KdeConnectKcm::pluginsConfigChanged);
|
||||
|
@ -362,15 +345,5 @@ void KdeConnectKcm::sendPing()
|
|||
currentDevice->pluginCall(QStringLiteral("ping"), QStringLiteral("sendPing"));
|
||||
}
|
||||
|
||||
QSize KdeConnectKcm::sizeHint() const
|
||||
{
|
||||
return QSize(890, 550); // Golden ratio :D
|
||||
}
|
||||
|
||||
QSize KdeConnectKcm::minimumSizeHint() const
|
||||
{
|
||||
return QSize(500, 300);
|
||||
}
|
||||
|
||||
#include "kcm.moc"
|
||||
#include "moc_kcm.cpp"
|
||||
|
|
12
kcm/kcm.h
12
kcm/kcm.h
|
@ -9,6 +9,7 @@
|
|||
|
||||
#include <KCModule>
|
||||
#include <QStandardItemModel>
|
||||
#include <kconfigwidgets_version.h>
|
||||
|
||||
class QModelIndex;
|
||||
class DeviceDbusInterface;
|
||||
|
@ -25,13 +26,18 @@ class KdeConnectKcm : public KCModule
|
|||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
KdeConnectKcm(QWidget *parent, const QVariantList &);
|
||||
KdeConnectKcm(QObject *parent, const QVariantList &);
|
||||
~KdeConnectKcm() override;
|
||||
|
||||
#if KCONFIGWIDGETS_VERSION < QT_VERSION_CHECK(5, 105, 0)
|
||||
QWidget *widget()
|
||||
{
|
||||
return this;
|
||||
}
|
||||
#endif
|
||||
|
||||
private:
|
||||
void save() override;
|
||||
QSize sizeHint() const override;
|
||||
QSize minimumSizeHint() const override;
|
||||
|
||||
private Q_SLOTS:
|
||||
void deviceSelected(const QModelIndex ¤t);
|
||||
|
|
|
@ -4,12 +4,12 @@ add_library(kdeconnectpluginkcm kdeconnectpluginkcm.cpp)
|
|||
target_link_libraries(kdeconnectpluginkcm
|
||||
PUBLIC
|
||||
kdeconnectcore
|
||||
KF${QT_MAJOR_VERSION}::KCMUtils
|
||||
PRIVATE
|
||||
Qt::DBus
|
||||
Qt::Gui
|
||||
KF5::I18n
|
||||
KF5::ConfigCore
|
||||
KF5::KCMUtils
|
||||
KF${QT_MAJOR_VERSION}::I18n
|
||||
KF${QT_MAJOR_VERSION}::ConfigCore
|
||||
)
|
||||
|
||||
set_target_properties(kdeconnectpluginkcm PROPERTIES
|
||||
|
|
|
@ -15,8 +15,8 @@ struct KdeConnectPluginKcmPrivate {
|
|||
KdeConnectPluginConfig *m_config = nullptr;
|
||||
};
|
||||
|
||||
KdeConnectPluginKcm::KdeConnectPluginKcm(QWidget *parent, const QVariantList &args, const QString &pluginName)
|
||||
: KCModule(parent, args)
|
||||
KdeConnectPluginKcm::KdeConnectPluginKcm(QObject *parent, const QVariantList &args, const QString &pluginName)
|
||||
: KCModule(qobject_cast<QWidget *>(parent), args)
|
||||
, d(new KdeConnectPluginKcmPrivate())
|
||||
{
|
||||
d->m_deviceId = args.at(0).toString();
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
#define KDECONNECTPLUGINKCM_H
|
||||
|
||||
#include <KCModule>
|
||||
#include <kconfigwidgets_version.h>
|
||||
|
||||
#include "core/kdeconnectpluginconfig.h"
|
||||
#include "kdeconnectpluginkcm_export.h"
|
||||
|
@ -23,7 +24,7 @@ class KDECONNECTPLUGINKCM_EXPORT KdeConnectPluginKcm : public KCModule
|
|||
Q_OBJECT
|
||||
|
||||
public:
|
||||
KdeConnectPluginKcm(QWidget *parent, const QVariantList &args, const QString &componentName);
|
||||
KdeConnectPluginKcm(QObject *parent, const QVariantList &args, const QString &componentName);
|
||||
~KdeConnectPluginKcm() override;
|
||||
|
||||
/**
|
||||
|
@ -36,6 +37,13 @@ public:
|
|||
*/
|
||||
KdeConnectPluginConfig *config() const;
|
||||
|
||||
#if KCONFIGWIDGETS_VERSION < QT_VERSION_CHECK(5, 105, 0)
|
||||
QWidget *widget()
|
||||
{
|
||||
return this;
|
||||
}
|
||||
#endif
|
||||
|
||||
private:
|
||||
QScopedPointer<KdeConnectPluginKcmPrivate> d;
|
||||
};
|
||||
|
|
|
@ -18,8 +18,8 @@ target_link_libraries(kio_kdeconnect
|
|||
kdeconnectinterfaces
|
||||
Qt::Core
|
||||
Qt::Network
|
||||
KF5::KIOCore
|
||||
KF5::I18n
|
||||
KF${QT_MAJOR_VERSION}::KIOCore
|
||||
KF${QT_MAJOR_VERSION}::I18n
|
||||
)
|
||||
|
||||
########### install files ###############
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
kpackage_install_package(package org.kde.kdeconnect plasmoids plasma NO_DEPRECATED_WARNING)
|
||||
|
||||
install(FILES package/metadata.desktop
|
||||
DESTINATION ${KDE_INSTALL_KSERVICESDIR}
|
||||
RENAME plasma-kdeconnect.desktop)
|
||||
#install(FILES package/metadata.desktop
|
||||
# DESTINATION ${KDE_INSTALL_KSERVICESDIR}
|
||||
#RENAME plasma-kdeconnect.desktop)
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
import QtQuick 2.1
|
||||
import org.kde.plasma.core 2.0 as PlasmaCore
|
||||
import org.kde.plasma.components 2.0 as PlasmaComponents
|
||||
import org.kde.plasma.components 3.0 as PlasmaComponents
|
||||
import org.kde.kdeconnect 1.0
|
||||
|
||||
QtObject {
|
||||
|
|
|
@ -24,9 +24,13 @@ DropArea {
|
|||
MouseArea {
|
||||
id: kdeConnectMouseArea
|
||||
anchors.fill: parent
|
||||
property bool wasExpanded
|
||||
|
||||
onPressed: {
|
||||
wasExpanded = root.expanded;
|
||||
}
|
||||
onClicked: {
|
||||
plasmoid.expanded = !plasmoid.expanded;
|
||||
root.expanded = !wasExpanded;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
import QtQuick 2.1
|
||||
import org.kde.plasma.core 2.0 as PlasmaCore
|
||||
import org.kde.plasma.components 2.0 as PlasmaComponents
|
||||
import org.kde.plasma.components 3.0 as PlasmaComponents
|
||||
import org.kde.kdeconnect 1.0
|
||||
|
||||
QtObject {
|
||||
|
|
|
@ -7,13 +7,13 @@
|
|||
import QtQuick 2.1
|
||||
import QtQuick.Layouts 1.1
|
||||
import org.kde.plasma.core 2.0 as PlasmaCore
|
||||
import org.kde.plasma.components 2.0 as PlasmaComponents
|
||||
import org.kde.plasma.components 3.0 as PlasmaComponents3
|
||||
import org.kde.plasma.extras 2.0 as PlasmaExtras
|
||||
import org.kde.kdeconnect 1.0
|
||||
import QtQuick.Dialogs 1.0
|
||||
import QtQuick.Dialogs
|
||||
import QtQuick.Controls 2.4
|
||||
|
||||
PlasmaComponents.ListItem
|
||||
PlasmaComponents3.ItemDelegate
|
||||
{
|
||||
id: root
|
||||
readonly property QtObject device: DeviceDbusInterfaceFactory.create(model.deviceId)
|
||||
|
@ -70,7 +70,7 @@ PlasmaComponents.ListItem
|
|||
device: root.device
|
||||
}
|
||||
|
||||
PlasmaComponents.Label {
|
||||
PlasmaComponents3.Label {
|
||||
id: deviceName
|
||||
elide: Text.ElideRight
|
||||
text: model.name
|
||||
|
@ -110,7 +110,7 @@ PlasmaComponents.ListItem
|
|||
visible: valid
|
||||
}
|
||||
|
||||
PlasmaComponents.Label {
|
||||
PlasmaComponents3.Label {
|
||||
// Fallback plain-text label. Only show this if the icon doesn't work.
|
||||
id: connectivityText
|
||||
text: connectivity.displayString
|
||||
|
@ -133,7 +133,7 @@ PlasmaComponents.ListItem
|
|||
Layout.alignment: Qt.AlignCenter
|
||||
}
|
||||
|
||||
PlasmaComponents.Label {
|
||||
PlasmaComponents3.Label {
|
||||
id: batteryPercent
|
||||
text: i18nc("Battery charge percentage", "%1%", battery.charge)
|
||||
textFormat: Text.PlainText
|
||||
|
@ -143,23 +143,23 @@ PlasmaComponents.ListItem
|
|||
PlasmaComponents3.ToolButton {
|
||||
id: overflowMenu
|
||||
icon.name: "application-menu"
|
||||
checked: menu.status === PlasmaComponents.DialogStatus.Open
|
||||
checked: menu.status === PlasmaExtras.DialogStatus.Open
|
||||
|
||||
onPressed: menu.openRelative()
|
||||
|
||||
PlasmaComponents.ContextMenu {
|
||||
PlasmaExtras.Menu {
|
||||
id: menu
|
||||
visualParent: overflowMenu
|
||||
placement: PlasmaCore.Types.BottomPosedLeftAlignedPopup
|
||||
|
||||
//Share
|
||||
PlasmaComponents.MenuItem
|
||||
PlasmaExtras.MenuItem
|
||||
{
|
||||
FileDialog {
|
||||
id: fileDialog
|
||||
title: i18n("Please choose a file")
|
||||
folder: shortcuts.home
|
||||
selectMultiple: true
|
||||
currentFolder: shortcuts.home
|
||||
fileMode: FileDialog.OpenFiles
|
||||
onAccepted: fileDialog.fileUrls.forEach(url => share.plugin.shareUrl(url))
|
||||
}
|
||||
|
||||
|
@ -171,14 +171,14 @@ PlasmaComponents.ListItem
|
|||
}
|
||||
|
||||
//Photo
|
||||
PlasmaComponents.MenuItem
|
||||
PlasmaExtras.MenuItem
|
||||
{
|
||||
FileDialog {
|
||||
id: photoFileDialog
|
||||
title: i18n("Save As")
|
||||
folder: shortcuts.pictures
|
||||
selectMultiple: false
|
||||
selectExisting: false
|
||||
currentFolder: shortcuts.pictures
|
||||
fileMode: FileDialog.SaveFile
|
||||
//selectExisting: false
|
||||
onAccepted: {
|
||||
var path = photoFileDialog.fileUrl.toString();
|
||||
photo.plugin.requestPhoto(path);
|
||||
|
@ -193,7 +193,7 @@ PlasmaComponents.ListItem
|
|||
}
|
||||
|
||||
//Find my phone
|
||||
PlasmaComponents.MenuItem
|
||||
PlasmaExtras.MenuItem
|
||||
{
|
||||
FindMyPhone {
|
||||
id: findmyphone
|
||||
|
@ -211,7 +211,7 @@ PlasmaComponents.ListItem
|
|||
}
|
||||
|
||||
//SFTP
|
||||
PlasmaComponents.MenuItem
|
||||
PlasmaExtras.MenuItem
|
||||
{
|
||||
Sftp {
|
||||
id: sftp
|
||||
|
@ -229,7 +229,7 @@ PlasmaComponents.ListItem
|
|||
}
|
||||
|
||||
//SMS
|
||||
PlasmaComponents.MenuItem
|
||||
PlasmaExtras.MenuItem
|
||||
{
|
||||
SMS {
|
||||
id: sms
|
||||
|
@ -249,7 +249,7 @@ PlasmaComponents.ListItem
|
|||
}
|
||||
|
||||
//RemoteKeyboard
|
||||
PlasmaComponents.ListItem {
|
||||
PlasmaComponents3.ItemDelegate {
|
||||
visible: remoteKeyboard.remoteState
|
||||
width: parent.width
|
||||
|
||||
|
@ -257,7 +257,7 @@ PlasmaComponents.ListItem
|
|||
width: parent.width
|
||||
spacing: 5
|
||||
|
||||
PlasmaComponents.Label {
|
||||
PlasmaComponents3.Label {
|
||||
id: remoteKeyboardLabel
|
||||
text: i18n("Remote Keyboard")
|
||||
}
|
||||
|
@ -271,18 +271,20 @@ PlasmaComponents.ListItem
|
|||
}
|
||||
|
||||
//Notifications
|
||||
PlasmaComponents.ListItem {
|
||||
PlasmaComponents3.ItemDelegate {
|
||||
visible: notificationsModel.count>0
|
||||
enabled: true
|
||||
PlasmaComponents.Label {
|
||||
PlasmaComponents3.Label {
|
||||
text: i18n("Notifications:")
|
||||
}
|
||||
PlasmaComponents.ToolButton {
|
||||
PlasmaComponents3.ToolButton {
|
||||
enabled: true
|
||||
visible: notificationsModel.isAnyDimissable;
|
||||
anchors.right: parent.right
|
||||
iconSource: "edit-clear-history"
|
||||
tooltip: i18n("Dismiss all notifications")
|
||||
icon.name: "edit-clear-history"
|
||||
PlasmaComponents3.ToolTip.text: i18n("Dismiss all notifications")
|
||||
PlasmaComponents3.ToolTip.visible: hovered
|
||||
PlasmaComponents3.ToolTip.delay: Kirigami.Units.toolTipDelay
|
||||
onClicked: notificationsModel.dismissAll();
|
||||
}
|
||||
}
|
||||
|
@ -292,7 +294,7 @@ PlasmaComponents.ListItem
|
|||
id: notificationsModel
|
||||
deviceId: root.device.id()
|
||||
}
|
||||
delegate: PlasmaComponents.ListItem {
|
||||
delegate: PlasmaComponents3.ItemDelegate {
|
||||
id: listitem
|
||||
enabled: true
|
||||
onClicked: checked = !checked
|
||||
|
@ -306,7 +308,7 @@ PlasmaComponents.ListItem
|
|||
height: width
|
||||
anchors.left: parent.left
|
||||
}
|
||||
PlasmaComponents.Label {
|
||||
PlasmaComponents3.Label {
|
||||
id: notificationLabel
|
||||
text: appName + ": " + (title.length>0 ? (appName==title?notitext:title+": "+notitext) : model.name)
|
||||
anchors.right: replyButton.left
|
||||
|
@ -315,22 +317,26 @@ PlasmaComponents.ListItem
|
|||
maximumLineCount: listitem.checked ? 0 : 1
|
||||
wrapMode: Text.WordWrap
|
||||
}
|
||||
PlasmaComponents.ToolButton {
|
||||
PlasmaComponents3.ToolButton {
|
||||
id: replyButton
|
||||
visible: repliable
|
||||
enabled: repliable && !replying
|
||||
anchors.right: dismissButton.left
|
||||
iconSource: "mail-reply-sender"
|
||||
tooltip: i18n("Reply")
|
||||
icon.name: "mail-reply-sender"
|
||||
PlasmaComponents3.ToolTip.text: i18n("Reply")
|
||||
PlasmaComponents3.ToolTip.visible: hovered
|
||||
PlasmaComponents3.ToolTip.delay: Kirigami.Units.toolTipDelay
|
||||
onClicked: { replying = true; replyTextField.forceActiveFocus(); }
|
||||
}
|
||||
PlasmaComponents.ToolButton {
|
||||
PlasmaComponents3.ToolButton {
|
||||
id: dismissButton
|
||||
visible: notificationsModel.isAnyDimissable;
|
||||
enabled: dismissable
|
||||
anchors.right: parent.right
|
||||
iconSource: "window-close"
|
||||
tooltip: i18n("Dismiss")
|
||||
icon.name: "window-close"
|
||||
PlasmaComponents3.ToolTip.text: i18n("Dismiss")
|
||||
PlasmaComponents3.ToolTip.visible: hovered
|
||||
PlasmaComponents3.ToolTip.delay: Kirigami.Units.toolTipDelay
|
||||
onClicked: dbusInterface.dismiss();
|
||||
}
|
||||
RowLayout {
|
||||
|
@ -393,16 +399,18 @@ PlasmaComponents.ListItem
|
|||
visible: rc.available
|
||||
width: parent.width
|
||||
|
||||
PlasmaComponents.Label {
|
||||
PlasmaComponents3.Label {
|
||||
text: i18n("Run command")
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
|
||||
PlasmaComponents.Button
|
||||
PlasmaComponents3.Button
|
||||
{
|
||||
id: addCommandButton
|
||||
iconSource: "list-add"
|
||||
tooltip: i18n("Add command")
|
||||
icon.name: "list-add"
|
||||
PlasmaComponents3.ToolTip.text: i18n("Add command")
|
||||
PlasmaComponents3.ToolTip.visible: hovered
|
||||
PlasmaComponents3.ToolTip.delay: Kirigami.Units.toolTipDelay
|
||||
onClicked: rc.plugin.editCommands()
|
||||
visible: rc.plugin && rc.plugin.canAddCommand
|
||||
}
|
||||
|
@ -414,11 +422,11 @@ PlasmaComponents.ListItem
|
|||
id: commandsModel
|
||||
deviceId: rc.device.id()
|
||||
}
|
||||
delegate: PlasmaComponents.ListItem {
|
||||
delegate: PlasmaComponents3.ItemDelegate {
|
||||
enabled: true
|
||||
onClicked: rc.plugin.triggerCommand(key)
|
||||
|
||||
PlasmaComponents.Label {
|
||||
PlasmaComponents3.Label {
|
||||
text: name + "\n" + command
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
import QtQuick 2.1
|
||||
import org.kde.plasma.core 2.0 as PlasmaCore
|
||||
import org.kde.plasma.components 2.0 as PlasmaComponents
|
||||
import org.kde.plasma.components 3.0 as PlasmaComponents
|
||||
import org.kde.kdeconnect 1.0
|
||||
|
||||
QtObject {
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
import QtQuick 2.1
|
||||
import org.kde.plasma.core 2.0 as PlasmaCore
|
||||
import org.kde.plasma.components 2.0 as PlasmaComponents
|
||||
import org.kde.plasma.components 3.0 as PlasmaComponents
|
||||
import org.kde.kdeconnect 1.0
|
||||
|
||||
QtObject {
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
import QtQuick 2.1
|
||||
import org.kde.plasma.core 2.0 as PlasmaCore
|
||||
import org.kde.plasma.components 2.0 as PlasmaComponents
|
||||
import org.kde.plasma.components 3.0 as PlasmaComponents
|
||||
import org.kde.kdeconnect 1.0
|
||||
|
||||
QtObject {
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
import QtQuick 2.1
|
||||
import org.kde.plasma.core 2.0 as PlasmaCore
|
||||
import org.kde.plasma.components 2.0 as PlasmaComponents
|
||||
import org.kde.plasma.components 3.0 as PlasmaComponents
|
||||
import org.kde.kdeconnect 1.0
|
||||
|
||||
QtObject {
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
import QtQuick 2.1
|
||||
import org.kde.plasma.core 2.0 as PlasmaCore
|
||||
import org.kde.plasma.components 2.0 as PlasmaComponents
|
||||
import org.kde.plasma.components 3.0 as PlasmaComponents
|
||||
import org.kde.kdeconnect 1.0
|
||||
|
||||
QtObject {
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
import QtQuick 2.1
|
||||
import org.kde.plasma.core 2.0 as PlasmaCore
|
||||
import org.kde.plasma.components 2.0 as PlasmaComponents
|
||||
import org.kde.plasma.components 3.0 as PlasmaComponents
|
||||
import org.kde.kdeconnect 1.0
|
||||
|
||||
QtObject
|
||||
|
|
|
@ -10,8 +10,9 @@ import org.kde.plasma.plasmoid 2.0
|
|||
import org.kde.kquickcontrolsaddons 2.0
|
||||
import org.kde.kdeconnect 1.0
|
||||
|
||||
Item
|
||||
PlasmoidItem
|
||||
{
|
||||
id: root
|
||||
DevicesModel {
|
||||
id: connectDeviceModel
|
||||
displayFilter: DevicesModel.Paired | DevicesModel.Reachable
|
||||
|
@ -28,16 +29,16 @@ Item
|
|||
value: (connectDeviceModel.count > 0) ? PlasmaCore.Types.ActiveStatus : PlasmaCore.Types.PassiveStatus
|
||||
}
|
||||
|
||||
Plasmoid.fullRepresentation: FullRepresentation {
|
||||
fullRepresentation: FullRepresentation {
|
||||
devicesModel: connectDeviceModel
|
||||
}
|
||||
|
||||
Plasmoid.compactRepresentation: CompactRepresentation {
|
||||
compactRepresentation: CompactRepresentation {
|
||||
}
|
||||
|
||||
readonly property bool isConstrained: (plasmoid.formFactor == PlasmaCore.Types.Vertical || plasmoid.formFactor == PlasmaCore.Types.Horizontal)
|
||||
|
||||
Plasmoid.preferredRepresentation: isConstrained ? Plasmoid.compactRepresentation : Plasmoid.fullRepresentation
|
||||
preferredRepresentation: isConstrained ? Plasmoid.compactRepresentation : Plasmoid.fullRepresentation
|
||||
|
||||
function action_launchkcm() {
|
||||
OpenConfig.openConfiguration()
|
||||
|
|
|
@ -1,118 +0,0 @@
|
|||
[Desktop Entry]
|
||||
Name=KDE Connect
|
||||
Name[ar]=كِيدِي المتّصل
|
||||
Name[az]=KDE Connect
|
||||
Name[bg]=KDE Connect
|
||||
Name[bs]=Konekcija KDE
|
||||
Name[ca]=KDE Connect
|
||||
Name[ca@valencia]=KDE Connect
|
||||
Name[cs]=KDE Connect
|
||||
Name[da]=KDE Connect
|
||||
Name[de]=KDE Connect
|
||||
Name[el]=KDE Connect
|
||||
Name[en_GB]=KDE Connect
|
||||
Name[es]=KDE Connect
|
||||
Name[et]=KDE Connect
|
||||
Name[eu]=KDE Connect
|
||||
Name[fi]=KDE Connect
|
||||
Name[fr]=KDE Connect
|
||||
Name[gl]=KDE Connect
|
||||
Name[he]=KDE Connect
|
||||
Name[hu]=KDE Connect
|
||||
Name[ia]=KDE Connect
|
||||
Name[id]=KDE Connect
|
||||
Name[ie]=KDE Connect
|
||||
Name[is]=KDE Connect
|
||||
Name[it]=KDE Connect
|
||||
Name[ja]=KDE Connect
|
||||
Name[ka]=KDE Connect
|
||||
Name[ko]=KDE Connect
|
||||
Name[lt]=KDE Connect
|
||||
Name[ml]=കെ.ഡി.ഇ കണക്റ്റ്
|
||||
Name[nl]=KDE Connect
|
||||
Name[nn]=KDE Connect
|
||||
Name[pl]=KDE Connect
|
||||
Name[pt]=KDE Connect
|
||||
Name[pt_BR]=KDE Connect
|
||||
Name[ro]=KDE Connect
|
||||
Name[ru]=KDE Connect
|
||||
Name[sk]=KDE Connect
|
||||
Name[sl]=KDE Connect
|
||||
Name[sr]=КДЕ‑конекција
|
||||
Name[sr@ijekavian]=КДЕ‑конекција
|
||||
Name[sr@ijekavianlatin]=KDE‑konekcija
|
||||
Name[sr@latin]=KDE‑konekcija
|
||||
Name[sv]=KDE-anslut
|
||||
Name[ta]=கே.டீ.யீ. கனெக்ட்
|
||||
Name[tr]=KDE Bağlan
|
||||
Name[uk]=З’єднання KDE
|
||||
Name[x-test]=xxKDE Connectxx
|
||||
Name[zh_CN]=KDE Connect
|
||||
Name[zh_TW]=KDE 連線
|
||||
Comment=Show notifications from your devices using KDE Connect
|
||||
Comment[ar]=أظهر الإخطارات من أجهزتك باستخدام «كِيدِي المتّصل»
|
||||
Comment[az]=KDE Connect istifadə edərək cihazlarınızdan bildirişləri göstərmək
|
||||
Comment[bg]=Показване на уведомления от вашите устройства чрез KDE Connect
|
||||
Comment[bs]=Prikaži obavlještenja sa uređaja koji koriste KDE konekciju
|
||||
Comment[ca]=Mostra les notificacions dels vostres dispositius emprant el KDE Connect
|
||||
Comment[ca@valencia]=Mostra les notificacions dels vostres dispositius emprant KDE Connect
|
||||
Comment[cs]=Zobrazit oznámení z vašich zařízení pomocí KDE Connect
|
||||
Comment[da]=Vis bekendtgørelser fra dine enheder med KDE Connect
|
||||
Comment[de]=Zeigt Benachrichtigungen von Ihren Geräten mit KDE Connect
|
||||
Comment[el]=Προβολή ειδοποιήσεων από τις συσκευές σας με το KDE Connect
|
||||
Comment[en_GB]=Show notifications from your devices using KDE Connect
|
||||
Comment[es]=KDE Connect muestra las notificaciones de sus dispositivos
|
||||
Comment[et]=Seadmete märguannete näitamine KDE Connecti vahendusel
|
||||
Comment[eu]=Ikusi zure gailuetako jakinarazpenak KDE Connect erabiliz
|
||||
Comment[fi]=Näytä laitteidesi ilmoitukset KDE Connectilla
|
||||
Comment[fr]=Afficher les notifications provenant de vos périphériques à l'aide de KDE Connect
|
||||
Comment[gl]=Mostrar notificacións de dispositivos usando KDE Connect.
|
||||
Comment[he]=הראה התראות מההתקן שלך באמצעות KDE Connect
|
||||
Comment[hu]=Az eszközökről származó értesítések megjelenítése a KDE Connect használatával
|
||||
Comment[ia]=Monstra notificationes ex tu dispositivos usante KDE Connect
|
||||
Comment[id]=Tampilkan notifikasi dari peranti Anda menggunakan KDE Connect
|
||||
Comment[is]=Sýna tilkynningar frá tækjunum þínum með KDE Connect
|
||||
Comment[it]=Mostra le notifiche dei tuoi dispositivi tramite KDE Connect
|
||||
Comment[ja]=KDE Connect でデバイスの通知を表示
|
||||
Comment[ka]=KDE Connect-ი შესახებ თქვენი მოწყობილობებიდან გაფრთხილებების ჩვენება
|
||||
Comment[ko]=KDE Connect로 장치에 표시된 알림 보기
|
||||
Comment[lt]=Rodyti pranešimus iš jūsų įrenginių naudojant KDE Connect
|
||||
Comment[nl]=Meldingen van uw apparaten met KDE Connect tonen
|
||||
Comment[nn]=Vis varslingar frå einingane dine med KDE Connect
|
||||
Comment[pl]=Pokazuje powiadomienia z urządzeń z KDE Connect
|
||||
Comment[pt]=Mostrar notificações dos seus dispositivos usando o KDE Connect
|
||||
Comment[pt_BR]=Mostrar notificações dos seus dispositivos usando o KDE Connect
|
||||
Comment[ro]=Arată notificări de pe dispozitivele dumneavoastră folosind KDE Connect
|
||||
Comment[ru]=Просмотр уведомлений с мобильных устройств с помощью KDE Connect
|
||||
Comment[sk]=Zobrazenie oznámení z vašich zariadení pomocou KDE Connect
|
||||
Comment[sl]=Pokaži obvestila iz svojih naprav s pomočjo KDE Connect
|
||||
Comment[sr]=Приказује обавештења са вашег уређаја помоћу КДЕ‑конекције
|
||||
Comment[sr@ijekavian]=Приказује обавештења са вашег уређаја помоћу КДЕ‑конекције
|
||||
Comment[sr@ijekavianlatin]=Prikazuje obaveštenja sa vašeg uređaja pomoću KDE‑konekcije
|
||||
Comment[sr@latin]=Prikazuje obaveštenja sa vašeg uređaja pomoću KDE‑konekcije
|
||||
Comment[sv]=Visa underrättelser från apparater med KDE anslut
|
||||
Comment[ta]=கே.டீ.யீ. கனெக்ட் மூலம் உங்கள் சாதனங்களிலிருந்து வரும் அறிவிப்புகளைக் காட்டும்
|
||||
Comment[tr]=KDE Bağlan kullanılarak aygıtınızdan bildirimleri görüntüleyin
|
||||
Comment[uk]=Показ сповіщень з ваших пристроїв за допомогою програми «З’єднання KDE»
|
||||
Comment[x-test]=xxShow notifications from your devices using KDE Connectxx
|
||||
Comment[zh_CN]=通过 KDE Connect 显示来自其他设备的通知
|
||||
Comment[zh_TW]=使用 KDE 連線來顯示您的裝置通知
|
||||
|
||||
Icon=kdeconnect
|
||||
Type=Service
|
||||
X-KDE-ServiceTypes=Plasma/Applet
|
||||
|
||||
X-Plasma-API=declarativeappletscript
|
||||
X-Plasma-MainScript=ui/main.qml
|
||||
X-Plasma-NotificationArea=true
|
||||
X-Plasma-NotificationAreaCategory=Hardware
|
||||
X-Plasma-ConfigPlugins=kcm_kdeconnect
|
||||
|
||||
X-KDE-PluginInfo-Author=Albert Vaca Cintora
|
||||
X-KDE-PluginInfo-Email=albertvaka@gmail.com
|
||||
X-KDE-PluginInfo-Name=org.kde.kdeconnect
|
||||
X-KDE-PluginInfo-Version=0.1
|
||||
X-KDE-PluginInfo-Website=https://albertvaka.wordpress.com
|
||||
X-KDE-PluginInfo-Category=System Information
|
||||
X-KDE-PluginInfo-License=GPL
|
||||
X-KDE-PluginInfo-EnabledByDefault=true
|
126
plasmoid/package/metadata.json
Normal file
126
plasmoid/package/metadata.json
Normal file
|
@ -0,0 +1,126 @@
|
|||
{
|
||||
"KPackageStructure": "Plasma/Applet",
|
||||
"KPlugin": {
|
||||
"Authors": [
|
||||
{
|
||||
"Email": "albertvaka@gmail.com",
|
||||
"Name": "Albert Vaca Cintora"
|
||||
}
|
||||
],
|
||||
"Category": "System Information",
|
||||
"Description": "Show notifications from your devices using KDE Connect",
|
||||
"Description[ar]": "أظهر الإخطارات من أجهزتك باستخدام «كِيدِي المتّصل»",
|
||||
"Description[az]": "KDE Connect istifadə edərək cihazlarınızdan bildirişləri göstərmək",
|
||||
"Description[bg]": "Показване на уведомления от вашите устройства чрез KDE Connect",
|
||||
"Description[bs]": "Prikaži obavlještenja sa uređaja koji koriste KDE konekciju",
|
||||
"Description[ca@valencia]": "Mostra les notificacions dels vostres dispositius emprant KDE Connect",
|
||||
"Description[ca]": "Mostra les notificacions dels vostres dispositius emprant el KDE Connect",
|
||||
"Description[cs]": "Zobrazit oznámení z vašich zařízení pomocí KDE Connect",
|
||||
"Description[da]": "Vis bekendtgørelser fra dine enheder med KDE Connect",
|
||||
"Description[de]": "Zeigt Benachrichtigungen von Ihren Geräten mit KDE Connect",
|
||||
"Description[el]": "Προβολή ειδοποιήσεων από τις συσκευές σας με το KDE Connect",
|
||||
"Description[en_GB]": "Show notifications from your devices using KDE Connect",
|
||||
"Description[es]": "KDE Connect muestra las notificaciones de sus dispositivos",
|
||||
"Description[et]": "Seadmete märguannete näitamine KDE Connecti vahendusel",
|
||||
"Description[eu]": "Ikusi zure gailuetako jakinarazpenak KDE Connect erabiliz",
|
||||
"Description[fi]": "Näytä laitteidesi ilmoitukset KDE Connectilla",
|
||||
"Description[fr]": "Afficher les notifications provenant de vos périphériques à l'aide de KDE Connect",
|
||||
"Description[gl]": "Mostrar notificacións de dispositivos usando KDE Connect.",
|
||||
"Description[he]": "הראה התראות מההתקן שלך באמצעות KDE Connect",
|
||||
"Description[hu]": "Az eszközökről származó értesítések megjelenítése a KDE Connect használatával",
|
||||
"Description[ia]": "Monstra notificationes ex tu dispositivos usante KDE Connect",
|
||||
"Description[id]": "Tampilkan notifikasi dari peranti Anda menggunakan KDE Connect",
|
||||
"Description[is]": "Sýna tilkynningar frá tækjunum þínum með KDE Connect",
|
||||
"Description[it]": "Mostra le notifiche dei tuoi dispositivi tramite KDE Connect",
|
||||
"Description[ja]": "KDE Connect でデバイスの通知を表示",
|
||||
"Description[ka]": "KDE Connect-ი შესახებ თქვენი მოწყობილობებიდან გაფრთხილებების ჩვენება",
|
||||
"Description[ko]": "KDE Connect로 장치에 표시된 알림 보기",
|
||||
"Description[lt]": "Rodyti pranešimus iš jūsų įrenginių naudojant KDE Connect",
|
||||
"Description[nl]": "Meldingen van uw apparaten met KDE Connect tonen",
|
||||
"Description[nn]": "Vis varslingar frå einingane dine med KDE Connect",
|
||||
"Description[pl]": "Pokazuje powiadomienia z urządzeń z KDE Connect",
|
||||
"Description[pt]": "Mostrar notificações dos seus dispositivos usando o KDE Connect",
|
||||
"Description[pt_BR]": "Mostrar notificações dos seus dispositivos usando o KDE Connect",
|
||||
"Description[ro]": "Arată notificări de pe dispozitivele dumneavoastră folosind KDE Connect",
|
||||
"Description[ru]": "Просмотр уведомлений с мобильных устройств с помощью KDE Connect",
|
||||
"Description[sk]": "Zobrazenie oznámení z vašich zariadení pomocou KDE Connect",
|
||||
"Description[sl]": "Pokaži obvestila iz svojih naprav s pomočjo KDE Connect",
|
||||
"Description[sr@ijekavian]": "Приказује обавештења са вашег уређаја помоћу КДЕ‑конекције",
|
||||
"Description[sr@ijekavianlatin]": "Prikazuje obaveštenja sa vašeg uređaja pomoću KDE‑konekcije",
|
||||
"Description[sr@latin]": "Prikazuje obaveštenja sa vašeg uređaja pomoću KDE‑konekcije",
|
||||
"Description[sr]": "Приказује обавештења са вашег уређаја помоћу КДЕ‑конекције",
|
||||
"Description[sv]": "Visa underrättelser från apparater med KDE anslut",
|
||||
"Description[ta]": "கே.டீ.யீ. கனெக்ட் மூலம் உங்கள் சாதனங்களிலிருந்து வரும் அறிவிப்புகளைக் காட்டும்",
|
||||
"Description[tr]": "KDE Bağlan kullanılarak aygıtınızdan bildirimleri görüntüleyin",
|
||||
"Description[uk]": "Показ сповіщень з ваших пристроїв за допомогою програми «З’єднання KDE»",
|
||||
"Description[x-test]": "xxShow notifications from your devices using KDE Connectxx",
|
||||
"Description[zh_CN]": "通过 KDE Connect 显示来自其他设备的通知",
|
||||
"Description[zh_TW]": "使用 KDE 連線來顯示您的裝置通知",
|
||||
"EnabledByDefault": true,
|
||||
"Icon": "kdeconnect",
|
||||
"Id": "org.kde.kdeconnect",
|
||||
"License": "GPL",
|
||||
"Name": "KDE Connect",
|
||||
"Name[ar]": "كِيدِي المتّصل",
|
||||
"Name[az]": "KDE Connect",
|
||||
"Name[bg]": "KDE Connect",
|
||||
"Name[bs]": "Konekcija KDE",
|
||||
"Name[ca@valencia]": "KDE Connect",
|
||||
"Name[ca]": "KDE Connect",
|
||||
"Name[cs]": "KDE Connect",
|
||||
"Name[da]": "KDE Connect",
|
||||
"Name[de]": "KDE Connect",
|
||||
"Name[el]": "KDE Connect",
|
||||
"Name[en_GB]": "KDE Connect",
|
||||
"Name[es]": "KDE Connect",
|
||||
"Name[et]": "KDE Connect",
|
||||
"Name[eu]": "KDE Connect",
|
||||
"Name[fi]": "KDE Connect",
|
||||
"Name[fr]": "KDE Connect",
|
||||
"Name[gl]": "KDE Connect",
|
||||
"Name[he]": "KDE Connect",
|
||||
"Name[hu]": "KDE Connect",
|
||||
"Name[ia]": "KDE Connect",
|
||||
"Name[id]": "KDE Connect",
|
||||
"Name[ie]": "KDE Connect",
|
||||
"Name[is]": "KDE Connect",
|
||||
"Name[it]": "KDE Connect",
|
||||
"Name[ja]": "KDE Connect",
|
||||
"Name[ka]": "KDE Connect",
|
||||
"Name[ko]": "KDE Connect",
|
||||
"Name[lt]": "KDE Connect",
|
||||
"Name[ml]": "കെ.ഡി.ഇ കണക്റ്റ്",
|
||||
"Name[nl]": "KDE Connect",
|
||||
"Name[nn]": "KDE Connect",
|
||||
"Name[pl]": "KDE Connect",
|
||||
"Name[pt]": "KDE Connect",
|
||||
"Name[pt_BR]": "KDE Connect",
|
||||
"Name[ro]": "KDE Connect",
|
||||
"Name[ru]": "KDE Connect",
|
||||
"Name[sk]": "KDE Connect",
|
||||
"Name[sl]": "KDE Connect",
|
||||
"Name[sr@ijekavian]": "КДЕ‑конекција",
|
||||
"Name[sr@ijekavianlatin]": "KDE‑konekcija",
|
||||
"Name[sr@latin]": "KDE‑konekcija",
|
||||
"Name[sr]": "КДЕ‑конекција",
|
||||
"Name[sv]": "KDE-anslut",
|
||||
"Name[ta]": "கே.டீ.யீ. கனெக்ட்",
|
||||
"Name[tr]": "KDE Bağlan",
|
||||
"Name[uk]": "З’єднання KDE",
|
||||
"Name[x-test]": "xxKDE Connectxx",
|
||||
"Name[zh_CN]": "KDE Connect",
|
||||
"Name[zh_TW]": "KDE 連線",
|
||||
"ServiceTypes": [
|
||||
"Plasma/Applet"
|
||||
],
|
||||
"Version": "0.1",
|
||||
"Website": "https://albertvaka.wordpress.com"
|
||||
},
|
||||
"X-Plasma-API": "declarativeappletscript",
|
||||
"X-Plasma-ConfigPlugins": [
|
||||
"kcm_kdeconnect"
|
||||
],
|
||||
"X-Plasma-MainScript": "ui/main.qml",
|
||||
"X-Plasma-NotificationArea": "true",
|
||||
"X-Plasma-NotificationAreaCategory": "Hardware"
|
||||
}
|
|
@ -39,8 +39,8 @@ if(NOT SAILFISHOS)
|
|||
add_subdirectory(virtualmonitor)
|
||||
|
||||
if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
|
||||
find_package(KF5ModemManagerQt ${KF5_MIN_VERSION})
|
||||
if (TARGET KF5::ModemManagerQt)
|
||||
find_package(KF${QT_MAJOR_VERSION}ModemManagerQt ${KF5_MIN_VERSION})
|
||||
if (TARGET KF${QT_MAJOR_VERSION}::ModemManagerQt)
|
||||
add_subdirectory(mmtelephony)
|
||||
endif()
|
||||
endif()
|
||||
|
|
|
@ -15,6 +15,6 @@ kdeconnect_add_plugin(kdeconnect_battery SOURCES ${kdeconnect_battery_SRCS})
|
|||
target_link_libraries(kdeconnect_battery
|
||||
kdeconnectcore
|
||||
Qt${QT_MAJOR_VERSION}::DBus
|
||||
KF5::Solid
|
||||
KF5::I18n
|
||||
KF${QT_MAJOR_VERSION}::Solid
|
||||
KF${QT_MAJOR_VERSION}::I18n
|
||||
)
|
||||
|
|
|
@ -4,4 +4,4 @@ set(kdeconnect_bigscreen_SRCS
|
|||
|
||||
kdeconnect_add_plugin(kdeconnect_bigscreen SOURCES ${kdeconnect_bigscreen_SRCS})
|
||||
|
||||
target_link_libraries(kdeconnect_bigscreen kdeconnectcore Qt${QT_MAJOR_VERSION}::DBus KF5::I18n)
|
||||
target_link_libraries(kdeconnect_bigscreen kdeconnectcore Qt${QT_MAJOR_VERSION}::DBus KF${QT_MAJOR_VERSION}::I18n)
|
||||
|
|
|
@ -15,7 +15,7 @@ set(kdeconnect_clipboard_SRCS
|
|||
kdeconnect_add_plugin(kdeconnect_clipboard SOURCES ${kdeconnect_clipboard_SRCS})
|
||||
|
||||
target_link_libraries(kdeconnect_clipboard kdeconnectcore
|
||||
KF5::GuiAddons
|
||||
KF${QT_MAJOR_VERSION}::GuiAddons
|
||||
${kdeconnect_clipboard_WL_LINK_LIBS}
|
||||
)
|
||||
|
||||
|
@ -26,6 +26,6 @@ target_sources(kdeconnect_clipboard_config PRIVATE clipboard_config.cpp ${debug_
|
|||
target_link_libraries( kdeconnect_clipboard_config
|
||||
kdeconnectcore
|
||||
kdeconnectpluginkcm
|
||||
KF5::I18n
|
||||
KF5::KCMUtils
|
||||
KF${QT_MAJOR_VERSION}::I18n
|
||||
KF${QT_MAJOR_VERSION}::KCMUtils
|
||||
)
|
||||
|
|
|
@ -11,11 +11,11 @@
|
|||
|
||||
K_PLUGIN_FACTORY(ClipboardConfigFactory, registerPlugin<ClipboardConfig>();)
|
||||
|
||||
ClipboardConfig::ClipboardConfig(QWidget* parent, const QVariantList &args)
|
||||
ClipboardConfig::ClipboardConfig(QObject *parent, const QVariantList &args)
|
||||
: KdeConnectPluginKcm(parent, args, QStringLiteral("kdeconnect_clipboard"))
|
||||
, m_ui(new Ui::ClipboardConfigUi())
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
m_ui->setupUi(widget());
|
||||
|
||||
connect(m_ui->check_unknown, SIGNAL(toggled(bool)), this, SLOT(changed()));
|
||||
connect(m_ui->check_password, SIGNAL(toggled(bool)), this, SLOT(changed()));
|
||||
|
@ -31,7 +31,7 @@ void ClipboardConfig::defaults()
|
|||
KCModule::defaults();
|
||||
m_ui->check_unknown->setChecked(true);
|
||||
m_ui->check_password->setChecked(true);
|
||||
Q_EMIT changed(true);
|
||||
markAsChanged();
|
||||
}
|
||||
|
||||
void ClipboardConfig::load()
|
||||
|
@ -41,8 +41,6 @@ void ClipboardConfig::load()
|
|||
bool password = config()->getBool(QStringLiteral("sendPassword"), true);
|
||||
m_ui->check_unknown->setChecked(unknown);
|
||||
m_ui->check_password->setChecked(password);
|
||||
|
||||
Q_EMIT changed(false);
|
||||
}
|
||||
|
||||
void ClipboardConfig::save()
|
||||
|
@ -50,7 +48,6 @@ void ClipboardConfig::save()
|
|||
config()->set(QStringLiteral("sendUnknown"), m_ui->check_unknown->isChecked());
|
||||
config()->set(QStringLiteral("sendPassword"), m_ui->check_password->isChecked());
|
||||
KCModule::save();
|
||||
Q_EMIT changed(false);
|
||||
}
|
||||
|
||||
#include "clipboard_config.moc"
|
||||
|
|
|
@ -9,16 +9,16 @@
|
|||
|
||||
#include "kcmplugin/kdeconnectpluginkcm.h"
|
||||
|
||||
namespace Ui {
|
||||
class ClipboardConfigUi;
|
||||
namespace Ui
|
||||
{
|
||||
class ClipboardConfigUi;
|
||||
}
|
||||
|
||||
class ClipboardConfig
|
||||
: public KdeConnectPluginKcm
|
||||
class ClipboardConfig : public KdeConnectPluginKcm
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
ClipboardConfig(QWidget *parent, const QVariantList&);
|
||||
ClipboardConfig(QObject *parent, const QVariantList &);
|
||||
~ClipboardConfig() override;
|
||||
|
||||
public Q_SLOTS:
|
||||
|
@ -28,7 +28,6 @@ public Q_SLOTS:
|
|||
|
||||
private:
|
||||
Ui::ClipboardConfigUi *m_ui;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -15,6 +15,6 @@ kdeconnect_add_plugin(kdeconnect_connectivity_report SOURCES ${kdeconnect_connec
|
|||
target_link_libraries(kdeconnect_connectivity_report
|
||||
kdeconnectcore
|
||||
Qt${QT_MAJOR_VERSION}::DBus
|
||||
KF5::Solid
|
||||
KF5::I18n
|
||||
KF${QT_MAJOR_VERSION}::Solid
|
||||
KF${QT_MAJOR_VERSION}::I18n
|
||||
)
|
||||
|
|
|
@ -22,7 +22,7 @@ target_link_libraries(kdeconnect_findthisdevice
|
|||
|
||||
if (NOT WIN32)
|
||||
target_link_libraries(kdeconnect_findthisdevice
|
||||
KF5::PulseAudioQt
|
||||
KF${QT_MAJOR_VERSION}::PulseAudioQt
|
||||
)
|
||||
endif()
|
||||
|
||||
|
@ -33,8 +33,8 @@ target_sources(kdeconnect_findthisdevice_config PRIVATE findthisdevice_config.cp
|
|||
target_link_libraries(kdeconnect_findthisdevice_config
|
||||
kdeconnectpluginkcm
|
||||
Qt::Multimedia
|
||||
KF5::I18n
|
||||
KF5::CoreAddons
|
||||
KF5::ConfigWidgets
|
||||
KF5::KIOWidgets # KUrlRequester
|
||||
KF${QT_MAJOR_VERSION}::I18n
|
||||
KF${QT_MAJOR_VERSION}::CoreAddons
|
||||
KF${QT_MAJOR_VERSION}::ConfigWidgets
|
||||
KF${QT_MAJOR_VERSION}::KIOWidgets # KUrlRequester
|
||||
)
|
||||
|
|
|
@ -19,5 +19,5 @@ kdeconnect_add_plugin(kdeconnect_lockdevice SOURCES ${lockdevice_SRCS} ${debug_f
|
|||
target_link_libraries(kdeconnect_lockdevice
|
||||
kdeconnectcore
|
||||
Qt::DBus
|
||||
KF5::I18n
|
||||
KF${QT_MAJOR_VERSION}::I18n
|
||||
)
|
||||
|
|
|
@ -15,6 +15,6 @@ kdeconnect_add_plugin(kdeconnect_mmtelephony SOURCES ${kdeconnect_mmtelephony_SR
|
|||
target_link_libraries(kdeconnect_mmtelephony
|
||||
kdeconnectcore
|
||||
Qt${QT_MAJOR_VERSION}::DBus
|
||||
KF5::ModemManagerQt
|
||||
KF5::I18n
|
||||
KF${QT_MAJOR_VERSION}::ModemManagerQt
|
||||
KF${QT_MAJOR_VERSION}::I18n
|
||||
)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
kdeconnect_add_plugin(kdeconnect_mousepad SOURCES mousepadplugin.cpp abstractremoteinput.cpp)
|
||||
|
||||
if(UNIX AND NOT APPLE)
|
||||
qt5_add_dbus_interface(
|
||||
qt_add_dbus_interface(
|
||||
SRCS
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/xdp_dbus_remotedesktop_interface.xml
|
||||
xdp_dbus_remotedesktop_interface
|
||||
|
@ -36,7 +36,7 @@ set(HAVE_X11 ${LibFakeKey_FOUND})
|
|||
set(HAVE_MACOS ${APPLE})
|
||||
configure_file(config-mousepad.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-mousepad.h)
|
||||
|
||||
target_link_libraries(kdeconnect_mousepad kdeconnectcore Qt::Gui KF5::I18n)
|
||||
target_link_libraries(kdeconnect_mousepad kdeconnectcore Qt::Gui KF${QT_MAJOR_VERSION}::I18n)
|
||||
|
||||
if (HAVE_WINDOWS)
|
||||
target_sources(kdeconnect_mousepad PUBLIC windowsremoteinput.cpp)
|
||||
|
@ -46,6 +46,8 @@ if(HAVE_X11)
|
|||
target_sources(kdeconnect_mousepad PUBLIC x11remoteinput.cpp)
|
||||
if (QT_MAJOR_VERSION EQUAL "5")
|
||||
target_link_libraries(kdeconnect_mousepad Qt5::X11Extras)
|
||||
elseif(QT_MAJOR_VERSION EQUAL "6")
|
||||
target_link_libraries(kdeconnect_mousepad Qt6::GuiPrivate)
|
||||
endif()
|
||||
target_link_libraries(kdeconnect_mousepad ${X11_LIBRARIES} ${XTEST_LIBRARIES} ${LibFakeKey_LIBRARIES})
|
||||
endif()
|
||||
|
|
|
@ -9,7 +9,11 @@
|
|||
|
||||
#include <QCursor>
|
||||
#include <QDebug>
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||
#include <QX11Info>
|
||||
#else
|
||||
#include <private/qtx11extras_p.h>
|
||||
#endif
|
||||
|
||||
#include <X11/extensions/XTest.h>
|
||||
#include <X11/keysym.h>
|
||||
|
|
|
@ -19,13 +19,15 @@ kdeconnect_add_plugin(kdeconnect_notifications SOURCES ${kdeconnect_notification
|
|||
target_link_libraries(kdeconnect_notifications
|
||||
kdeconnectcore
|
||||
Qt::DBus
|
||||
KF5::Notifications
|
||||
KF5::I18n
|
||||
KF5::WindowSystem
|
||||
KF${QT_MAJOR_VERSION}::Notifications
|
||||
KF${QT_MAJOR_VERSION}::I18n
|
||||
KF${QT_MAJOR_VERSION}::WindowSystem
|
||||
)
|
||||
|
||||
if (UNIX AND NOT APPLE AND QT_MAJOR_VERSION EQUAL "5")
|
||||
target_link_libraries(kdeconnect_notifications
|
||||
Qt5::X11Extras
|
||||
)
|
||||
if (UNIX AND NOT APPLE)
|
||||
if (QT_MAJOR_VERSION EQUAL "5")
|
||||
target_link_libraries(kdeconnect_notifications Qt5::X11Extras)
|
||||
else()
|
||||
target_link_libraries(kdeconnect_notifications Qt6::GuiPrivate)
|
||||
endif()
|
||||
endif()
|
||||
|
|
|
@ -14,7 +14,11 @@
|
|||
#include <KStartupInfo>
|
||||
|
||||
#if !defined(Q_OS_WIN) && !defined(Q_OS_MAC)
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||
#include <QX11Info>
|
||||
#else
|
||||
#include <private/qtx11extras_p.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
K_PLUGIN_CLASS_WITH_JSON(NotificationsPlugin, "kdeconnect_notifications.json")
|
||||
|
|
|
@ -26,7 +26,7 @@ target_link_libraries(kdeconnect_pausemusic
|
|||
)
|
||||
if (NOT WIN32)
|
||||
target_link_libraries(kdeconnect_pausemusic
|
||||
KF5::PulseAudioQt
|
||||
KF${QT_MAJOR_VERSION}::PulseAudioQt
|
||||
)
|
||||
else()
|
||||
target_link_libraries(kdeconnect_pausemusic
|
||||
|
@ -47,6 +47,6 @@ ki18n_wrap_ui(kdeconnect_pausemusic_config pausemusic_config.ui)
|
|||
target_link_libraries( kdeconnect_pausemusic_config
|
||||
kdeconnectcore
|
||||
kdeconnectpluginkcm
|
||||
KF5::I18n
|
||||
KF5::KCMUtils
|
||||
KF${QT_MAJOR_VERSION}::I18n
|
||||
KF${QT_MAJOR_VERSION}::KCMUtils
|
||||
)
|
||||
|
|
|
@ -15,5 +15,5 @@ kdeconnect_add_plugin(kdeconnect_ping SOURCES ${kdeconnect_ping_SRCS})
|
|||
target_link_libraries(kdeconnect_ping
|
||||
kdeconnectcore
|
||||
Qt${QT_MAJOR_VERSION}::DBus
|
||||
KF5::I18n
|
||||
KF${QT_MAJOR_VERSION}::I18n
|
||||
)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
qt5_add_resources(presenter_SRCS assets.qrc)
|
||||
qt_add_resources(presenter_SRCS assets.qrc)
|
||||
|
||||
set(debug_file_SRCS)
|
||||
ecm_qt_declare_logging_category(
|
||||
|
@ -12,5 +12,5 @@ target_link_libraries(kdeconnect_presenter
|
|||
kdeconnectcore
|
||||
Qt${QT_MAJOR_VERSION}::DBus
|
||||
Qt${QT_MAJOR_VERSION}::Quick
|
||||
KF5::I18n
|
||||
KF${QT_MAJOR_VERSION}::I18n
|
||||
)
|
||||
|
|
|
@ -34,7 +34,9 @@ public:
|
|||
windowFlags |= Qt::WindowTransparentForInput;
|
||||
#endif
|
||||
setFlags(windowFlags);
|
||||
#if QT_VERSION_MAJOR < 6
|
||||
setClearBeforeRendering(true);
|
||||
#endif
|
||||
setColor(QColor(Qt::transparent));
|
||||
|
||||
setResizeMode(QQuickView::SizeViewToRootObject);
|
||||
|
|
|
@ -10,5 +10,5 @@ kdeconnect_add_plugin(kdeconnect_remotecontrol SOURCES remotecontrolplugin.cpp $
|
|||
target_link_libraries(kdeconnect_remotecontrol
|
||||
kdeconnectcore
|
||||
Qt${QT_MAJOR_VERSION}::DBus
|
||||
KF5::I18n
|
||||
KF${QT_MAJOR_VERSION}::I18n
|
||||
)
|
||||
|
|
|
@ -15,5 +15,5 @@ kdeconnect_add_plugin(kdeconnect_remotesystemvolume SOURCES ${kdeconnect_remotes
|
|||
target_link_libraries(kdeconnect_remotesystemvolume
|
||||
kdeconnectcore
|
||||
Qt${QT_MAJOR_VERSION}::DBus
|
||||
KF5::I18n
|
||||
KF${QT_MAJOR_VERSION}::I18n
|
||||
)
|
||||
|
|
|
@ -15,8 +15,8 @@ kdeconnect_add_plugin(kdeconnect_runcommand SOURCES ${kdeconnect_runcommand_SRCS
|
|||
target_link_libraries(kdeconnect_runcommand
|
||||
kdeconnectcore
|
||||
Qt${QT_MAJOR_VERSION}::DBus
|
||||
KF5::KCMUtils
|
||||
KF5::I18n)
|
||||
KF${QT_MAJOR_VERSION}::KCMUtils
|
||||
KF${QT_MAJOR_VERSION}::I18n)
|
||||
|
||||
#----------------------
|
||||
if(NOT SAILFISHOS)
|
||||
|
@ -24,9 +24,9 @@ if(NOT SAILFISHOS)
|
|||
target_link_libraries( kdeconnect_runcommand_config
|
||||
kdeconnectcore
|
||||
kdeconnectpluginkcm
|
||||
KF5::I18n
|
||||
KF5::CoreAddons
|
||||
KF5::ConfigWidgets
|
||||
KF${QT_MAJOR_VERSION}::I18n
|
||||
KF${QT_MAJOR_VERSION}::CoreAddons
|
||||
KF${QT_MAJOR_VERSION}::ConfigWidgets
|
||||
|
||||
)
|
||||
endif()
|
||||
|
|
|
@ -7,11 +7,11 @@
|
|||
#include "runcommand_config.h"
|
||||
|
||||
#include <QDebug>
|
||||
#include <QFileDialog>
|
||||
#include <QHBoxLayout>
|
||||
#include <QHeaderView>
|
||||
#include <QJsonDocument>
|
||||
#include <QJsonArray>
|
||||
#include <QFileDialog>
|
||||
#include <QJsonDocument>
|
||||
#include <QMenu>
|
||||
#include <QPushButton>
|
||||
#include <QStandardItemModel>
|
||||
|
@ -26,7 +26,7 @@
|
|||
|
||||
K_PLUGIN_FACTORY(ShareConfigFactory, registerPlugin<RunCommandConfig>();)
|
||||
|
||||
RunCommandConfig::RunCommandConfig(QWidget *parent, const QVariantList &args)
|
||||
RunCommandConfig::RunCommandConfig(QObject *parent, const QVariantList &args)
|
||||
: KdeConnectPluginKcm(parent, args, QStringLiteral("kdeconnect_runcommand"))
|
||||
{
|
||||
// The qdbus executable name is different on some systems
|
||||
|
@ -35,7 +35,7 @@ RunCommandConfig::RunCommandConfig(QWidget *parent, const QVariantList &args)
|
|||
qdbusExe = QStringLiteral("qdbus");
|
||||
}
|
||||
|
||||
QMenu *defaultMenu = new QMenu(this);
|
||||
QMenu *defaultMenu = new QMenu(widget());
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
addSuggestedCommand(defaultMenu, i18n("Schedule a shutdown"), QStringLiteral("shutdown /s /t 60"));
|
||||
|
@ -67,25 +67,25 @@ RunCommandConfig::RunCommandConfig(QWidget *parent, const QVariantList &args)
|
|||
QStringLiteral("%0 org.kde.kded5 /modules/plasmavault forceCloseAllVaults").arg(qdbusExe));
|
||||
#endif
|
||||
|
||||
QTableView *table = new QTableView(this);
|
||||
QTableView *table = new QTableView(widget());
|
||||
table->horizontalHeader()->setStretchLastSection(true);
|
||||
table->verticalHeader()->setVisible(false);
|
||||
QVBoxLayout *layout = new QVBoxLayout(this);
|
||||
layout->addWidget(table);
|
||||
QPushButton *button = new QPushButton(QIcon::fromTheme(QStringLiteral("list-add")), i18n("Sample commands"), this);
|
||||
QPushButton *button = new QPushButton(QIcon::fromTheme(QStringLiteral("list-add")), i18n("Sample commands"), widget());
|
||||
button->setMenu(defaultMenu);
|
||||
layout->addWidget(button);
|
||||
|
||||
QHBoxLayout *importExportLayout = new QHBoxLayout(this);
|
||||
QPushButton *exportButton = new QPushButton(i18n("Export"), this);
|
||||
QHBoxLayout *importExportLayout = new QHBoxLayout();
|
||||
QPushButton *exportButton = new QPushButton(i18n("Export"), widget());
|
||||
importExportLayout->addWidget(exportButton);
|
||||
connect(exportButton, &QPushButton::clicked, this, &RunCommandConfig::exportCommands);
|
||||
QPushButton *importButton = new QPushButton(i18n("Import"), this);
|
||||
QPushButton *importButton = new QPushButton(i18n("Import"), widget());
|
||||
importExportLayout->addWidget(importButton);
|
||||
connect(importButton, &QPushButton::clicked, this, &RunCommandConfig::importCommands);
|
||||
layout->addLayout(importExportLayout);
|
||||
|
||||
setLayout(layout);
|
||||
QVBoxLayout *layout = new QVBoxLayout();
|
||||
layout->addWidget(table);
|
||||
layout->addLayout(importExportLayout);
|
||||
layout->addWidget(button);
|
||||
widget()->setLayout(layout);
|
||||
|
||||
m_entriesModel = new QStandardItemModel(this);
|
||||
table->setModel(m_entriesModel);
|
||||
|
@ -99,7 +99,7 @@ RunCommandConfig::~RunCommandConfig()
|
|||
|
||||
void RunCommandConfig::exportCommands()
|
||||
{
|
||||
QString filePath = QFileDialog::getSaveFileName(this, i18n("Export Commands"), QDir::homePath(), QStringLiteral("JSON (*.json)"));
|
||||
QString filePath = QFileDialog::getSaveFileName(widget(), i18n("Export Commands"), QDir::homePath(), QStringLiteral("JSON (*.json)"));
|
||||
if (filePath.isEmpty())
|
||||
return;
|
||||
|
||||
|
@ -124,7 +124,7 @@ void RunCommandConfig::exportCommands()
|
|||
|
||||
void RunCommandConfig::importCommands()
|
||||
{
|
||||
QString filePath = QFileDialog::getOpenFileName(this, i18n("Import Commands"), QDir::homePath(), QStringLiteral("JSON (*.json)"));
|
||||
QString filePath = QFileDialog::getOpenFileName(widget(), i18n("Import Commands"), QDir::homePath(), QStringLiteral("JSON (*.json)"));
|
||||
if (filePath.isEmpty())
|
||||
return;
|
||||
|
||||
|
@ -155,7 +155,7 @@ void RunCommandConfig::importCommands()
|
|||
insertRow(m_entriesModel->rowCount(), name, command);
|
||||
}
|
||||
|
||||
Q_EMIT changed(true);
|
||||
markAsChanged();
|
||||
}
|
||||
|
||||
void RunCommandConfig::addSuggestedCommand(QMenu *menu, const QString &name, const QString &command)
|
||||
|
@ -163,7 +163,7 @@ void RunCommandConfig::addSuggestedCommand(QMenu *menu, const QString &name, con
|
|||
auto action = new QAction(name);
|
||||
connect(action, &QAction::triggered, action, [this, name, command]() {
|
||||
insertRow(0, name, command);
|
||||
Q_EMIT changed(true);
|
||||
markAsChanged();
|
||||
});
|
||||
menu->addAction(action);
|
||||
}
|
||||
|
@ -173,7 +173,7 @@ void RunCommandConfig::defaults()
|
|||
KCModule::defaults();
|
||||
m_entriesModel->removeRows(0, m_entriesModel->rowCount());
|
||||
|
||||
Q_EMIT changed(true);
|
||||
markAsChanged();
|
||||
}
|
||||
|
||||
void RunCommandConfig::load()
|
||||
|
@ -201,12 +201,11 @@ void RunCommandConfig::load()
|
|||
|
||||
insertEmptyRow();
|
||||
connect(m_entriesModel, &QAbstractItemModel::dataChanged, this, &RunCommandConfig::onDataChanged);
|
||||
|
||||
Q_EMIT changed(false);
|
||||
}
|
||||
|
||||
void RunCommandConfig::save()
|
||||
{
|
||||
KCModule::save();
|
||||
QJsonObject jsonConfig;
|
||||
for (int i = 0; i < m_entriesModel->rowCount(); i++) {
|
||||
QString key = m_entriesModel->item(i, 0)->data().toString();
|
||||
|
@ -229,10 +228,6 @@ void RunCommandConfig::save()
|
|||
QJsonDocument document;
|
||||
document.setObject(jsonConfig);
|
||||
config()->set(QStringLiteral("commands"), document.toJson(QJsonDocument::Compact));
|
||||
|
||||
KCModule::save();
|
||||
|
||||
Q_EMIT changed(false);
|
||||
}
|
||||
|
||||
void RunCommandConfig::insertEmptyRow()
|
||||
|
@ -252,7 +247,7 @@ void RunCommandConfig::insertRow(int i, const QString &name, const QString &comm
|
|||
|
||||
void RunCommandConfig::onDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight)
|
||||
{
|
||||
Q_EMIT changed(true);
|
||||
markAsChanged();
|
||||
Q_UNUSED(topLeft);
|
||||
if (bottomRight.row() == m_entriesModel->rowCount() - 1) {
|
||||
// TODO check both entries are still empty
|
||||
|
|
|
@ -16,7 +16,7 @@ class RunCommandConfig : public KdeConnectPluginKcm
|
|||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
RunCommandConfig(QWidget *parent, const QVariantList &);
|
||||
RunCommandConfig(QObject *parent, const QVariantList &);
|
||||
~RunCommandConfig() override;
|
||||
|
||||
public Q_SLOTS:
|
||||
|
|
|
@ -26,7 +26,7 @@ target_link_libraries(kdeconnect_screensaver_inhibit kdeconnectcore)
|
|||
if(NOT APPLE AND NOT WIN32)
|
||||
target_link_libraries(kdeconnect_screensaver_inhibit
|
||||
Qt::DBus
|
||||
KF5::I18n
|
||||
KF${QT_MAJOR_VERSION}::I18n
|
||||
)
|
||||
endif()
|
||||
|
||||
|
|
|
@ -26,10 +26,10 @@ kdeconnect_add_plugin(kdeconnect_sendnotifications SOURCES ${kdeconnect_sendnoti
|
|||
target_link_libraries(kdeconnect_sendnotifications
|
||||
kdeconnectcore
|
||||
Qt::DBus
|
||||
KF5::I18n
|
||||
KF${QT_MAJOR_VERSION}::I18n
|
||||
Qt::Gui
|
||||
KF5::IconThemes
|
||||
KF5::ConfigCore
|
||||
KF${QT_MAJOR_VERSION}::IconThemes
|
||||
KF${QT_MAJOR_VERSION}::ConfigCore
|
||||
PkgConfig::GIO
|
||||
)
|
||||
|
||||
|
@ -49,7 +49,7 @@ target_sources(kdeconnect_sendnotifications_config PRIVATE
|
|||
target_link_libraries( kdeconnect_sendnotifications_config
|
||||
kdeconnectcore
|
||||
kdeconnectpluginkcm
|
||||
KF5::I18n
|
||||
KF5::KCMUtils
|
||||
KF${QT_MAJOR_VERSION}::I18n
|
||||
KF${QT_MAJOR_VERSION}::KCMUtils
|
||||
)
|
||||
endif()
|
||||
|
|
|
@ -35,7 +35,9 @@ NotificationsListener::NotificationsListener(KdeConnectPlugin *aPlugin)
|
|||
: QObject(aPlugin)
|
||||
, m_plugin(aPlugin)
|
||||
{
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||
qRegisterMetaTypeStreamOperators<NotifyingApplication>("NotifyingApplication");
|
||||
#endif
|
||||
|
||||
GError *error = nullptr;
|
||||
m_gdbusConnection = g_bus_get_sync(G_BUS_TYPE_SESSION, nullptr, &error);
|
||||
|
|
|
@ -13,14 +13,16 @@
|
|||
|
||||
K_PLUGIN_FACTORY(SendNotificationsConfigFactory, registerPlugin<SendNotificationsConfig>();)
|
||||
|
||||
SendNotificationsConfig::SendNotificationsConfig(QWidget *parent, const QVariantList &args)
|
||||
SendNotificationsConfig::SendNotificationsConfig(QObject *parent, const QVariantList &args)
|
||||
: KdeConnectPluginKcm(parent, args, QStringLiteral("kdeconnect_sendnotifications"))
|
||||
, m_ui(new Ui::SendNotificationsConfigUi())
|
||||
, appModel(new NotifyingApplicationModel)
|
||||
{
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||
qRegisterMetaTypeStreamOperators<NotifyingApplication>("NotifyingApplication");
|
||||
#endif
|
||||
|
||||
m_ui->setupUi(this);
|
||||
m_ui->setupUi(widget());
|
||||
m_ui->appList->setIconSize(QSize(32, 32));
|
||||
|
||||
m_ui->appList->setModel(appModel);
|
||||
|
@ -55,7 +57,7 @@ void SendNotificationsConfig::defaults()
|
|||
m_ui->spin_urgency->setValue(0);
|
||||
m_ui->check_body->setChecked(true);
|
||||
m_ui->check_icons->setChecked(true);
|
||||
Q_EMIT changed(true);
|
||||
markAsChanged();
|
||||
}
|
||||
|
||||
void SendNotificationsConfig::loadApplications()
|
||||
|
@ -83,11 +85,11 @@ void SendNotificationsConfig::load()
|
|||
m_ui->spin_urgency->setValue(urgency);
|
||||
|
||||
loadApplications();
|
||||
Q_EMIT changed(false);
|
||||
}
|
||||
|
||||
void SendNotificationsConfig::save()
|
||||
{
|
||||
KCModule::save();
|
||||
config()->set(QStringLiteral("generalPersistent"), m_ui->check_persistent->isChecked());
|
||||
config()->set(QStringLiteral("generalIncludeBody"), m_ui->check_body->isChecked());
|
||||
config()->set(QStringLiteral("generalSynchronizeIcons"), m_ui->check_icons->isChecked());
|
||||
|
@ -100,8 +102,6 @@ void SendNotificationsConfig::save()
|
|||
list.append(QVariant::fromValue<NotifyingApplication>(a));
|
||||
}
|
||||
config()->setList(QStringLiteral("applications"), list);
|
||||
KCModule::save();
|
||||
Q_EMIT changed(false);
|
||||
}
|
||||
|
||||
#include "sendnotifications_config.moc"
|
||||
|
|
|
@ -20,7 +20,7 @@ class SendNotificationsConfig : public KdeConnectPluginKcm
|
|||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
SendNotificationsConfig(QWidget *parent, const QVariantList &);
|
||||
SendNotificationsConfig(QObject *parent, const QVariantList &);
|
||||
~SendNotificationsConfig() override;
|
||||
|
||||
public Q_SLOTS:
|
||||
|
|
|
@ -26,8 +26,8 @@ kdeconnect_add_plugin(kdeconnect_sftp SOURCES ${kdeconnect_sftp_SRCS} ${debug_fi
|
|||
target_link_libraries(kdeconnect_sftp
|
||||
kdeconnectcore
|
||||
Qt::DBus
|
||||
KF5::I18n
|
||||
KF5::KIOFileWidgets
|
||||
KF5::KIOWidgets
|
||||
KF5::Notifications
|
||||
KF${QT_MAJOR_VERSION}::I18n
|
||||
KF${QT_MAJOR_VERSION}::KIOFileWidgets
|
||||
KF${QT_MAJOR_VERSION}::KIOWidgets
|
||||
KF${QT_MAJOR_VERSION}::Notifications
|
||||
)
|
||||
|
|
|
@ -124,7 +124,13 @@ bool SftpPlugin::startBrowsing()
|
|||
|
||||
bool SftpPlugin::receivePacket(const NetworkPacket &np)
|
||||
{
|
||||
if (!(fields_c - np.body().keys().toSet()).isEmpty() && !np.has(QStringLiteral("errorMessage"))) {
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
|
||||
const auto keys = np.body().keys().toSet();
|
||||
#else
|
||||
const QStringList keysList = np.body().keys();
|
||||
const auto keys = QSet(keysList.begin(), keysList.end());
|
||||
#endif
|
||||
if (!(fields_c - keys).isEmpty() && !np.has(QStringLiteral("errorMessage"))) {
|
||||
// packet is invalid
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -15,11 +15,11 @@ kdeconnect_add_plugin(kdeconnect_share SOURCES ${kdeconnect_share_SRCS})
|
|||
target_link_libraries(kdeconnect_share
|
||||
kdeconnectcore
|
||||
Qt::DBus
|
||||
KF5::Notifications
|
||||
KF5::I18n
|
||||
KF5::GuiAddons
|
||||
KF5::KIOWidgets
|
||||
KF5::Service
|
||||
KF${QT_MAJOR_VERSION}::Notifications
|
||||
KF${QT_MAJOR_VERSION}::I18n
|
||||
KF${QT_MAJOR_VERSION}::GuiAddons
|
||||
KF${QT_MAJOR_VERSION}::KIOWidgets
|
||||
KF${QT_MAJOR_VERSION}::Service
|
||||
)
|
||||
|
||||
#######################################
|
||||
|
@ -30,9 +30,9 @@ kcoreaddons_add_plugin(kdeconnect_share_config SOURCES share_config.cpp INSTALL_
|
|||
ki18n_wrap_ui(kdeconnect_share_config share_config.ui)
|
||||
target_link_libraries( kdeconnect_share_config
|
||||
kdeconnectpluginkcm
|
||||
KF5::I18n
|
||||
KF5::CoreAddons
|
||||
KF5::ConfigWidgets
|
||||
KF5::KIOWidgets
|
||||
KF5::Notifications
|
||||
KF${QT_MAJOR_VERSION}::I18n
|
||||
KF${QT_MAJOR_VERSION}::CoreAddons
|
||||
KF${QT_MAJOR_VERSION}::ConfigWidgets
|
||||
KF${QT_MAJOR_VERSION}::KIOWidgets
|
||||
KF${QT_MAJOR_VERSION}::Notifications
|
||||
)
|
||||
|
|
|
@ -14,11 +14,11 @@
|
|||
|
||||
K_PLUGIN_FACTORY(ShareConfigFactory, registerPlugin<ShareConfig>();)
|
||||
|
||||
ShareConfig::ShareConfig(QWidget *parent, const QVariantList &args)
|
||||
ShareConfig::ShareConfig(QObject *parent, const QVariantList &args)
|
||||
: KdeConnectPluginKcm(parent, args, QStringLiteral("kdeconnect_share"))
|
||||
, m_ui(new Ui::ShareConfigUi())
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
m_ui->setupUi(widget());
|
||||
// xgettext:no-c-format
|
||||
m_ui->commentLabel->setTextFormat(Qt::RichText);
|
||||
m_ui->commentLabel->setText(i18n("%1 in the path will be replaced with the specific device name."));
|
||||
|
@ -37,7 +37,7 @@ void ShareConfig::defaults()
|
|||
|
||||
m_ui->kurlrequester->setText(QStandardPaths::writableLocation(QStandardPaths::DownloadLocation));
|
||||
|
||||
Q_EMIT changed(true);
|
||||
markAsChanged();
|
||||
}
|
||||
|
||||
void ShareConfig::load()
|
||||
|
@ -46,17 +46,12 @@ void ShareConfig::load()
|
|||
|
||||
const auto standardPath = QStandardPaths::writableLocation(QStandardPaths::DownloadLocation);
|
||||
m_ui->kurlrequester->setText(config()->getString(QStringLiteral("incoming_path"), standardPath));
|
||||
|
||||
Q_EMIT changed(false);
|
||||
}
|
||||
|
||||
void ShareConfig::save()
|
||||
{
|
||||
config()->set(QStringLiteral("incoming_path"), m_ui->kurlrequester->text());
|
||||
|
||||
KCModule::save();
|
||||
|
||||
Q_EMIT changed(false);
|
||||
config()->set(QStringLiteral("incoming_path"), m_ui->kurlrequester->text());
|
||||
}
|
||||
|
||||
#include "share_config.moc"
|
||||
|
|
|
@ -18,7 +18,7 @@ class ShareConfig : public KdeConnectPluginKcm
|
|||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
ShareConfig(QWidget *parent, const QVariantList &);
|
||||
ShareConfig(QObject *parent, const QVariantList &);
|
||||
~ShareConfig() override;
|
||||
|
||||
public Q_SLOTS:
|
||||
|
|
|
@ -24,7 +24,12 @@ target_link_libraries(kdeconnect_sms
|
|||
kdeconnectcore
|
||||
kdeconnectinterfaces
|
||||
Qt::DBus
|
||||
KF5::I18n
|
||||
KF5::Notifications
|
||||
KF${QT_MAJOR_VERSION}::I18n
|
||||
KF${QT_MAJOR_VERSION}::Notifications
|
||||
Qt::Widgets
|
||||
)
|
||||
|
||||
if (QT_MAJOR_VERSION STREQUAL "6")
|
||||
find_package(Qt6 REQUIRED COMPONENTS Core5Compat)
|
||||
target_link_libraries(kdeconnect_sms Qt::Core5Compat) # for QTextCodec
|
||||
endif()
|
||||
|
|
|
@ -39,6 +39,6 @@ else()
|
|||
target_link_libraries(kdeconnect_systemvolume
|
||||
kdeconnectcore
|
||||
Qt::Core
|
||||
KF5::PulseAudioQt
|
||||
KF${QT_MAJOR_VERSION}::PulseAudioQt
|
||||
)
|
||||
endif()
|
||||
|
|
|
@ -14,7 +14,7 @@ kdeconnect_add_plugin(kdeconnect_telephony SOURCES ${kdeconnect_telephony_SRCS})
|
|||
|
||||
target_link_libraries(kdeconnect_telephony
|
||||
kdeconnectcore
|
||||
KF5::I18n
|
||||
KF5::Notifications
|
||||
KF${QT_MAJOR_VERSION}::I18n
|
||||
KF${QT_MAJOR_VERSION}::Notifications
|
||||
Qt::DBus
|
||||
)
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
#include <QJsonArray>
|
||||
#include <QProcess>
|
||||
#include <QScreen>
|
||||
#include <QStandardPaths>
|
||||
|
||||
K_PLUGIN_CLASS_WITH_JSON(VirtualMonitorPlugin, "kdeconnect_virtualmonitor.json")
|
||||
#define QS QLatin1String
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
add_definitions(-DTRANSLATION_DOMAIN="kdeconnect-settings")
|
||||
|
||||
qt5_add_resources(kdeconnect_custom_icons_SRCS ${CMAKE_SOURCE_DIR}/icons/custom_icons.qrc)
|
||||
qt_add_resources(kdeconnect_custom_icons_SRCS ${CMAKE_SOURCE_DIR}/icons/custom_icons.qrc)
|
||||
|
||||
add_executable(kdeconnect-settings
|
||||
main.cpp
|
||||
${kdeconnect_custom_icons_SRCS}
|
||||
)
|
||||
|
||||
target_link_libraries(kdeconnect-settings kdeconnectversion KF5::I18n KF5::KCMUtils KF5::DBusAddons KF5::WindowSystem)
|
||||
target_link_libraries(kdeconnect-settings kdeconnectversion KF${QT_MAJOR_VERSION}::I18n KF${QT_MAJOR_VERSION}::KCMUtils KF${QT_MAJOR_VERSION}::DBusAddons KF${QT_MAJOR_VERSION}::WindowSystem)
|
||||
|
||||
install(TARGETS kdeconnect-settings ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
|
||||
install(FILES org.kde.kdeconnect-settings.desktop DESTINATION ${KDE_INSTALL_APPDIR})
|
||||
|
|
|
@ -30,12 +30,12 @@ target_link_libraries(kdeconnectsmshelper
|
|||
PUBLIC
|
||||
Qt::Core
|
||||
Qt::DBus
|
||||
KF5::People
|
||||
KF${QT_MAJOR_VERSION}::People
|
||||
Qt::Qml
|
||||
kdeconnectinterfaces
|
||||
)
|
||||
|
||||
qt5_add_resources(kdeconnect_custom_icons_SRCS ${CMAKE_SOURCE_DIR}/icons/custom_icons.qrc)
|
||||
qt_add_resources(kdeconnect_custom_icons_SRCS ${CMAKE_SOURCE_DIR}/icons/custom_icons.qrc)
|
||||
|
||||
add_executable(kdeconnect-sms
|
||||
main.cpp
|
||||
|
@ -55,11 +55,11 @@ target_link_libraries(kdeconnect-sms
|
|||
Qt::Quick
|
||||
Qt::QuickControls2
|
||||
Qt::Widgets
|
||||
KF5::CoreAddons
|
||||
KF5::DBusAddons
|
||||
KF5::I18n
|
||||
KF5::People
|
||||
KF5::KCMUtils
|
||||
KF${QT_MAJOR_VERSION}::CoreAddons
|
||||
KF${QT_MAJOR_VERSION}::DBusAddons
|
||||
KF${QT_MAJOR_VERSION}::I18n
|
||||
KF${QT_MAJOR_VERSION}::People
|
||||
KF${QT_MAJOR_VERSION}::KCMUtils
|
||||
)
|
||||
|
||||
install(TARGETS kdeconnect-sms ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
|
||||
|
|
|
@ -50,7 +50,7 @@ bool ConversationsSortFilterProxyModel::filterAcceptsRow(int sourceRow, const QM
|
|||
if (filterRole() == ConversationListModel::ConversationIdRole) {
|
||||
return sourceModel()->data(index, ConversationListModel::ConversationIdRole) != INVALID_THREAD_ID;
|
||||
} else {
|
||||
if (sourceModel()->data(index, Qt::DisplayRole).toString().contains(filterRegExp())) {
|
||||
if (sourceModel()->data(index, Qt::DisplayRole).toString().contains(filterRegularExpression())) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -58,7 +58,11 @@ bool ConversationsSortFilterProxyModel::filterAcceptsRow(int sourceRow, const QM
|
|||
const QList<ConversationAddress> addressList = sourceModel()->data(index, ConversationListModel::AddressesRole).value<QList<ConversationAddress>>();
|
||||
for (const ConversationAddress &address : addressList) {
|
||||
QString canonicalAddress = SmsHelper::canonicalizePhoneNumber(address.address());
|
||||
#if QT_VERSION_MAJOR < 6
|
||||
if (canonicalAddress.contains(filterRegExp())) {
|
||||
#else
|
||||
if (canonicalAddress.contains(filterRegularExpression())) {
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,14 +3,14 @@ find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} REQUIRED COMPONENTS Test)
|
|||
set(kdeconnect_libraries
|
||||
kdeconnectcore
|
||||
kdeconnectversion
|
||||
KF5::I18n
|
||||
KF${QT_MAJOR_VERSION}::I18n
|
||||
Qt::DBus
|
||||
Qt::Network
|
||||
Qt::Test
|
||||
)
|
||||
|
||||
if(${KF5KIO_FOUND})
|
||||
list(APPEND kdeconnect_libraries KF5::KIOWidgets)
|
||||
if(KF5KIO_FOUND OR KF6KIO_FOUND)
|
||||
list(APPEND kdeconnect_libraries KF${QT_MAJOR_VERSION}::KIOWidgets)
|
||||
endif()
|
||||
|
||||
ecm_add_test(pluginloadtest.cpp LINK_LIBRARIES ${kdeconnect_libraries})
|
||||
|
|
|
@ -2,7 +2,7 @@ add_definitions(-DTRANSLATION_DOMAIN="kdeconnect-urlhandler")
|
|||
|
||||
ki18n_wrap_ui(telhandler_SRCS dialog.ui)
|
||||
|
||||
qt5_add_resources(kdeconnect_custom_icons_SRCS ${CMAKE_SOURCE_DIR}/icons/custom_icons.qrc)
|
||||
qt_add_resources(kdeconnect_custom_icons_SRCS ${CMAKE_SOURCE_DIR}/icons/custom_icons.qrc)
|
||||
|
||||
add_executable(kdeconnect-handler kdeconnect-handler.cpp ${telhandler_SRCS} ${kdeconnect_custom_icons_SRCS})
|
||||
|
||||
|
@ -12,10 +12,11 @@ target_link_libraries(kdeconnect-handler
|
|||
kdeconnectcore
|
||||
kdeconnectversion
|
||||
Qt::Widgets
|
||||
KF5::CoreAddons
|
||||
KF5::DBusAddons
|
||||
KF5::I18n
|
||||
KF5::KIOCore KF5::KIOFileWidgets KF5::KIOWidgets
|
||||
KF${QT_MAJOR_VERSION}::CoreAddons
|
||||
KF${QT_MAJOR_VERSION}::ConfigWidgets
|
||||
KF${QT_MAJOR_VERSION}::DBusAddons
|
||||
KF${QT_MAJOR_VERSION}::I18n
|
||||
KF${QT_MAJOR_VERSION}::KIOCore KF${QT_MAJOR_VERSION}::KIOFileWidgets KF${QT_MAJOR_VERSION}::KIOWidgets
|
||||
)
|
||||
|
||||
install(TARGETS kdeconnect-handler ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
|
||||
|
|
Loading…
Reference in a new issue