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
|
.idea
|
||||||
/cmake-build*
|
/cmake-build*
|
||||||
.clang-format
|
.clang-format
|
||||||
|
app/resources.generated.qrc
|
||||||
|
|
|
@ -11,6 +11,9 @@ project(kdeconnect VERSION ${RELEASE_SERVICE_VERSION})
|
||||||
if (SAILFISHOS)
|
if (SAILFISHOS)
|
||||||
set(KF5_MIN_VERSION "5.36.0")
|
set(KF5_MIN_VERSION "5.36.0")
|
||||||
set(QT_MIN_VERSION "5.6.0")
|
set(QT_MIN_VERSION "5.6.0")
|
||||||
|
function(qt_add_resources)
|
||||||
|
qt_add_resources(${ARGN})
|
||||||
|
endfunction()
|
||||||
else()
|
else()
|
||||||
set(KF5_MIN_VERSION "5.101.0")
|
set(KF5_MIN_VERSION "5.101.0")
|
||||||
set(QT_MIN_VERSION "5.15.2")
|
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
|
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
|
# Make the version header available by linking against kdeconnectversion
|
||||||
add_library(kdeconnectversion INTERFACE)
|
add_library(kdeconnectversion INTERFACE)
|
||||||
target_include_directories(kdeconnectversion INTERFACE ${CMAKE_CURRENT_BINARY_DIR})
|
target_include_directories(kdeconnectversion INTERFACE ${CMAKE_CURRENT_BINARY_DIR})
|
||||||
|
@ -76,8 +93,8 @@ else()
|
||||||
)
|
)
|
||||||
|
|
||||||
if(UNIX AND NOT APPLE)
|
if(UNIX AND NOT APPLE)
|
||||||
find_package(KF5Package REQUIRED)
|
find_package(KF${QT_MAJOR_VERSION}Package REQUIRED)
|
||||||
find_package(KF5PulseAudioQt)
|
find_package(KF${QT_MAJOR_VERSION}PulseAudioQt)
|
||||||
if (QT_MAJOR_VERSION EQUAL "5")
|
if (QT_MAJOR_VERSION EQUAL "5")
|
||||||
find_package(QtWaylandScanner REQUIRED)
|
find_package(QtWaylandScanner REQUIRED)
|
||||||
endif()
|
endif()
|
||||||
|
@ -88,8 +105,8 @@ else()
|
||||||
pkg_check_modules(GIO REQUIRED IMPORTED_TARGET gio-2.0)
|
pkg_check_modules(GIO REQUIRED IMPORTED_TARGET gio-2.0)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
find_package(KF5PeopleVCard)
|
find_package(KF${QT_MAJOR_VERSION}PeopleVCard)
|
||||||
set_package_properties(KF5PeopleVCard PROPERTIES
|
set_package_properties(KF${QT_MAJOR_VERSION}PeopleVCard PROPERTIES
|
||||||
PURPOSE "Read vcards from the file system"
|
PURPOSE "Read vcards from the file system"
|
||||||
URL "https://invent.kde.org/pim/kpeoplevcard"
|
URL "https://invent.kde.org/pim/kpeoplevcard"
|
||||||
TYPE RUNTIME
|
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")
|
if (UNIX AND NOT APPLE AND QT_MAJOR_VERSION EQUAL "5")
|
||||||
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS X11Extras)
|
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS X11Extras)
|
||||||
endif()
|
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)
|
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()
|
endif()
|
||||||
|
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
|
@ -128,8 +145,8 @@ add_subdirectory(interfaces)
|
||||||
|
|
||||||
if (NOT SAILFISHOS)
|
if (NOT SAILFISHOS)
|
||||||
|
|
||||||
find_package(KF5QQC2DesktopStyle ${KF5_MIN_VERSION} REQUIRED)
|
find_package(KF${QT_MAJOR_VERSION}QQC2DesktopStyle ${KF5_MIN_VERSION} REQUIRED)
|
||||||
set_package_properties(KF5QQC2DesktopStyle PROPERTIES TYPE RUNTIME)
|
set_package_properties(KF${QT_MAJOR_VERSION}QQC2DesktopStyle PROPERTIES TYPE RUNTIME)
|
||||||
|
|
||||||
add_subdirectory(icons)
|
add_subdirectory(icons)
|
||||||
add_subdirectory(data)
|
add_subdirectory(data)
|
||||||
|
|
|
@ -22,7 +22,7 @@ else()
|
||||||
function(kdeconnect_add_plugin)
|
function(kdeconnect_add_plugin)
|
||||||
kcoreaddons_add_plugin(${ARGN} INSTALL_NAMESPACE kdeconnect)
|
kcoreaddons_add_plugin(${ARGN} INSTALL_NAMESPACE kdeconnect)
|
||||||
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${ARGV0}_config.qml")
|
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()
|
endif()
|
||||||
endfunction()
|
endfunction()
|
||||||
endif()
|
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}
|
ecm_setup_version(${PROJECT_VERSION}
|
||||||
VARIABLE_PREFIX KDE_CONNECT
|
VARIABLE_PREFIX KDE_CONNECT
|
||||||
|
@ -29,7 +34,7 @@ add_executable(kdeconnect-app
|
||||||
${kdeconnect_SRCS}
|
${kdeconnect_SRCS}
|
||||||
${kdeconnect_custom_icons_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(TARGETS kdeconnect-app ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
|
||||||
install(PROGRAMS org.kde.kdeconnect.app.desktop DESTINATION ${KDE_INSTALL_APPDIR})
|
install(PROGRAMS org.kde.kdeconnect.app.desktop DESTINATION ${KDE_INSTALL_APPDIR})
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
import QtQuick 2.15
|
import QtQuick 2.15
|
||||||
import QtQuick.Controls 2.15 as QQC2
|
import QtQuick.Controls 2.15 as QQC2
|
||||||
import QtQuick.Layouts 1.15
|
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.kirigami 2.20 as Kirigami
|
||||||
import org.kde.kdeconnect 1.0
|
import org.kde.kdeconnect 1.0
|
||||||
|
|
||||||
|
@ -16,15 +16,15 @@ Kirigami.ScrollablePage {
|
||||||
property QtObject currentDevice
|
property QtObject currentDevice
|
||||||
title: currentDevice.name
|
title: currentDevice.name
|
||||||
|
|
||||||
actions.contextualActions: [
|
@KIRIGAMI_PAGE_ACTIONS@: [
|
||||||
Kirigami.Action {
|
Kirigami.Action {
|
||||||
iconName:"network-disconnect"
|
@KIRIGAMI_ICON_NAME@:"network-disconnect"
|
||||||
onTriggered: root.currentDevice.unpair()
|
onTriggered: root.currentDevice.unpair()
|
||||||
text: i18nd("kdeconnect-app", "Unpair")
|
text: i18nd("kdeconnect-app", "Unpair")
|
||||||
visible: root.currentDevice.isTrusted
|
visible: root.currentDevice.isTrusted
|
||||||
},
|
},
|
||||||
Kirigami.Action {
|
Kirigami.Action {
|
||||||
iconName:"hands-free"
|
@KIRIGAMI_ICON_NAME@:"hands-free"
|
||||||
text: i18nd("kdeconnect-app", "Send Ping")
|
text: i18nd("kdeconnect-app", "Send Ping")
|
||||||
visible: root.currentDevice.isTrusted && root.currentDevice.isReachable
|
visible: root.currentDevice.isTrusted && root.currentDevice.isReachable
|
||||||
onTriggered: {
|
onTriggered: {
|
||||||
|
@ -32,7 +32,7 @@ Kirigami.ScrollablePage {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
Kirigami.Action {
|
Kirigami.Action {
|
||||||
iconName: "settings-configure"
|
@KIRIGAMI_ICON_NAME@: "settings-configure"
|
||||||
text: i18n("Plugin Settings")
|
text: i18n("Plugin Settings")
|
||||||
visible: root.currentDevice.isTrusted && root.currentDevice.isReachable
|
visible: root.currentDevice.isTrusted && root.currentDevice.isReachable
|
||||||
onTriggered: {
|
onTriggered: {
|
||||||
|
@ -155,7 +155,7 @@ Kirigami.ScrollablePage {
|
||||||
id: fileDialog
|
id: fileDialog
|
||||||
readonly property var shareIface: root.currentDevice ? ShareDbusInterfaceFactory.create(root.currentDevice.id()) : null
|
readonly property var shareIface: root.currentDevice ? ShareDbusInterfaceFactory.create(root.currentDevice.id()) : null
|
||||||
title: i18nd("kdeconnect-app", "Please choose a file")
|
title: i18nd("kdeconnect-app", "Please choose a file")
|
||||||
folder: shortcuts.home
|
@QTQUICK_FILEDIALOG_FOLDER@: shortcuts.home
|
||||||
onAccepted: shareIface.shareUrl(fileDialog.fileUrl)
|
onAccepted: shareIface.shareUrl(fileDialog.fileUrl)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -61,7 +61,7 @@ Kirigami.ScrollablePage
|
||||||
sourceModel: DevicesModel {}
|
sourceModel: DevicesModel {}
|
||||||
}
|
}
|
||||||
delegate: Kirigami.BasicListItem {
|
delegate: Kirigami.BasicListItem {
|
||||||
icon: iconName
|
@KIRIGAMI_ICON@: iconName
|
||||||
iconColor: "transparent"
|
iconColor: "transparent"
|
||||||
label: model.name
|
label: model.name
|
||||||
subtitle: toolTip
|
subtitle: toolTip
|
||||||
|
|
|
@ -74,7 +74,7 @@ Kirigami.ApplicationWindow {
|
||||||
Kirigami.BasicListItem {
|
Kirigami.BasicListItem {
|
||||||
id: findDevicesAction
|
id: findDevicesAction
|
||||||
text: i18nd("kdeconnect-app", "Find devices...")
|
text: i18nd("kdeconnect-app", "Find devices...")
|
||||||
icon: "list-add"
|
@KIRIGAMI_ICON@: "list-add"
|
||||||
checked: pageStack.currentItem && pageStack.currentItem.objectName == "FindDevices"
|
checked: pageStack.currentItem && pageStack.currentItem.objectName == "FindDevices"
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
|
||||||
|
@ -119,7 +119,7 @@ Kirigami.ApplicationWindow {
|
||||||
|
|
||||||
Kirigami.BasicListItem {
|
Kirigami.BasicListItem {
|
||||||
text: i18n("Settings")
|
text: i18n("Settings")
|
||||||
icon: "settings-configure"
|
@KIRIGAMI_ICON@: "settings-configure"
|
||||||
onClicked: pageStack.pushDialogLayer('qrc:/qml/Settings.qml', {}, {
|
onClicked: pageStack.pushDialogLayer('qrc:/qml/Settings.qml', {}, {
|
||||||
title: i18n("Settings"),
|
title: i18n("Settings"),
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
<!DOCTYPE RCC><RCC version="1.0">
|
<!DOCTYPE RCC><RCC version="1.0">
|
||||||
<qresource>
|
<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/mpris.qml</file>
|
||||||
<file>qml/mousepad.qml</file>
|
<file>qml/mousepad.qml</file>
|
||||||
<file>qml/presentationRemote.qml</file>
|
<file>qml/presentationRemote.qml</file>
|
||||||
|
|
||||||
<file>qml/PluginItem.qml</file>
|
<file>qml/PluginItem.qml</file>
|
||||||
<file>qml/DevicePage.qml</file>
|
<file alias="qml/DevicePage.qml">@CMAKE_CURRENT_BINARY_DIR@/qml/DevicePage.qml</file>
|
||||||
<file>qml/FindDevicesPage.qml</file>
|
<file alias="qml/FindDevicesPage.qml">@CMAKE_CURRENT_BINARY_DIR@/qml/FindDevicesPage.qml</file>
|
||||||
<file>qml/runcommand.qml</file>
|
<file>qml/runcommand.qml</file>
|
||||||
<file>qml/volume.qml</file>
|
<file>qml/volume.qml</file>
|
||||||
<file>qml/MprisSlider.qml</file>
|
<file>qml/MprisSlider.qml</file>
|
|
@ -7,8 +7,8 @@ target_link_libraries(kdeconnect-cli
|
||||||
kdeconnectinterfaces
|
kdeconnectinterfaces
|
||||||
kdeconnectcore
|
kdeconnectcore
|
||||||
kdeconnectversion
|
kdeconnectversion
|
||||||
KF5::CoreAddons
|
KF${QT_MAJOR_VERSION}::CoreAddons
|
||||||
KF5::I18n
|
KF${QT_MAJOR_VERSION}::I18n
|
||||||
)
|
)
|
||||||
|
|
||||||
install(TARGETS kdeconnect-cli ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
|
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
|
target_link_libraries(kdeconnectcore
|
||||||
PUBLIC
|
PUBLIC
|
||||||
Qt${QT_MAJOR_VERSION}::Network
|
Qt${QT_MAJOR_VERSION}::Network
|
||||||
KF5::CoreAddons
|
KF${QT_MAJOR_VERSION}::CoreAddons
|
||||||
${Qca_LIBRARY}
|
${Qca_LIBRARY}
|
||||||
PRIVATE
|
PRIVATE
|
||||||
Qt${QT_MAJOR_VERSION}::DBus
|
Qt${QT_MAJOR_VERSION}::DBus
|
||||||
KF5::I18n
|
KF${QT_MAJOR_VERSION}::I18n
|
||||||
KF5::ConfigCore
|
KF${QT_MAJOR_VERSION}::ConfigCore
|
||||||
)
|
)
|
||||||
|
|
||||||
if(${KF5KIO_FOUND})
|
if(KF5KIO_FOUND OR KF6KIO_FOUND)
|
||||||
target_link_libraries(kdeconnectcore PUBLIC KF5::KIOCore KF5::KIOGui)
|
target_link_libraries(kdeconnectcore PUBLIC KF${QT_MAJOR_VERSION}::KIOCore KF${QT_MAJOR_VERSION}::KIOGui)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (BLUETOOTH_ENABLED)
|
if (BLUETOOTH_ENABLED)
|
||||||
|
|
|
@ -98,7 +98,7 @@ void CompositeUploadJob::startNextSubJob()
|
||||||
#ifdef SAILFISHOS
|
#ifdef SAILFISHOS
|
||||||
connect(m_currentJob, SIGNAL(processedAmount(KJob *, KJob::Unit, qulonglong)), this, SLOT(slotProcessedAmount(KJob *, KJob::Unit, qulonglong)));
|
connect(m_currentJob, SIGNAL(processedAmount(KJob *, KJob::Unit, qulonglong)), this, SLOT(slotProcessedAmount(KJob *, KJob::Unit, qulonglong)));
|
||||||
#else
|
#else
|
||||||
connect(m_currentJob, QOverload<KJob *, KJob::Unit, qulonglong>::of(&UploadJob::processedAmount), this, &CompositeUploadJob::slotProcessedAmount);
|
connect(m_currentJob, &UploadJob::processedAmountChanged, this, &CompositeUploadJob::slotProcessedAmount);
|
||||||
#endif
|
#endif
|
||||||
// Already done by KCompositeJob
|
// Already done by KCompositeJob
|
||||||
// connect(m_currentJob, &KJob::result, this, &CompositeUploadJob::slotResult);
|
// connect(m_currentJob, &KJob::result, this, &CompositeUploadJob::slotResult);
|
||||||
|
|
|
@ -13,15 +13,13 @@
|
||||||
#include <netinet/tcp.h>
|
#include <netinet/tcp.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#else
|
#else
|
||||||
#include <winsock2.h>
|
|
||||||
#include <mstcpip.h>
|
#include <mstcpip.h>
|
||||||
|
#include <winsock2.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <QHostInfo>
|
#include <QHostInfo>
|
||||||
#include <QMetaEnum>
|
#include <QMetaEnum>
|
||||||
#include <QNetworkConfigurationManager>
|
|
||||||
#include <QNetworkProxy>
|
#include <QNetworkProxy>
|
||||||
#include <QNetworkSession>
|
|
||||||
#include <QSslCipher>
|
#include <QSslCipher>
|
||||||
#include <QSslConfiguration>
|
#include <QSslConfiguration>
|
||||||
#include <QSslKey>
|
#include <QSslKey>
|
||||||
|
@ -60,17 +58,22 @@ LanLinkProvider::LanLinkProvider(bool testMode, quint16 udpBroadcastPort, quint1
|
||||||
|
|
||||||
m_udpSocket.setProxy(QNetworkProxy::NoProxy);
|
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);
|
QNetworkConfigurationManager *networkManager = new QNetworkConfigurationManager(this);
|
||||||
connect(networkManager, &QNetworkConfigurationManager::configurationChanged, this, &LanLinkProvider::onNetworkConfigurationChanged);
|
connect(networkManager, &QNetworkConfigurationManager::configurationChanged, this, [this](QNetworkConfiguration config) {
|
||||||
}
|
if (m_lastConfig != config && config.state() == QNetworkConfiguration::Active) {
|
||||||
|
m_lastConfig = config;
|
||||||
void LanLinkProvider::onNetworkConfigurationChanged(const QNetworkConfiguration &config)
|
onNetworkChange();
|
||||||
{
|
}
|
||||||
if (m_lastConfig != config && config.state() == QNetworkConfiguration::Active) {
|
});
|
||||||
m_lastConfig = config;
|
#else
|
||||||
onNetworkChange();
|
// 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()
|
LanLinkProvider::~LanLinkProvider()
|
||||||
|
@ -602,7 +605,7 @@ void LanLinkProvider::configureSocket(QSslSocket *socket)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(Q_OS_WIN)
|
#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
|
int interval = 5 * 1000; // 5 seconds interval between probes after 5 minute delay
|
||||||
DWORD nop;
|
DWORD nop;
|
||||||
|
|
||||||
|
@ -610,12 +613,10 @@ void LanLinkProvider::configureSocket(QSslSocket *socket)
|
||||||
struct tcp_keepalive keepalive = {
|
struct tcp_keepalive keepalive = {
|
||||||
1 /* true */,
|
1 /* true */,
|
||||||
maxIdle,
|
maxIdle,
|
||||||
interval
|
interval,
|
||||||
};
|
};
|
||||||
|
|
||||||
int rv = WSAIoctl(socket->socketDescriptor(), SIO_KEEPALIVE_VALS, &keepalive,
|
int rv = WSAIoctl(socket->socketDescriptor(), SIO_KEEPALIVE_VALS, &keepalive, sizeof(keepalive), nullptr, 0, &nop, nullptr, nullptr);
|
||||||
sizeof(keepalive), nullptr, 0, &nop,
|
|
||||||
nullptr, nullptr);
|
|
||||||
if (!rv) {
|
if (!rv) {
|
||||||
int error = WSAGetLastError();
|
int error = WSAGetLastError();
|
||||||
qCDebug(KDECONNECT_CORE) << "Could not enable TCP Keep-Alive: " << error;
|
qCDebug(KDECONNECT_CORE) << "Could not enable TCP Keep-Alive: " << error;
|
||||||
|
|
|
@ -7,12 +7,17 @@
|
||||||
#ifndef LANLINKPROVIDER_H
|
#ifndef LANLINKPROVIDER_H
|
||||||
#define LANLINKPROVIDER_H
|
#define LANLINKPROVIDER_H
|
||||||
|
|
||||||
#include <QNetworkSession>
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QSslSocket>
|
#include <QSslSocket>
|
||||||
#include <QTcpServer>
|
#include <QTcpServer>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
#include <QUdpSocket>
|
#include <QUdpSocket>
|
||||||
|
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||||
|
#include <QNetworkConfigurationManager>
|
||||||
|
#include <QNetworkSession>
|
||||||
|
#else
|
||||||
|
#include <QNetworkInformation>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "backends/linkprovider.h"
|
#include "backends/linkprovider.h"
|
||||||
#include "kdeconnectcore_export.h"
|
#include "kdeconnectcore_export.h"
|
||||||
|
@ -75,7 +80,6 @@ private Q_SLOTS:
|
||||||
private:
|
private:
|
||||||
LanPairingHandler *createPairingHandler(DeviceLink *link);
|
LanPairingHandler *createPairingHandler(DeviceLink *link);
|
||||||
|
|
||||||
void onNetworkConfigurationChanged(const QNetworkConfiguration &config);
|
|
||||||
void addLink(const QString &deviceId, QSslSocket *socket, NetworkPacket *receivedPacket, LanDeviceLink::ConnectionStarted connectionOrigin);
|
void addLink(const QString &deviceId, QSslSocket *socket, NetworkPacket *receivedPacket, LanDeviceLink::ConnectionStarted connectionOrigin);
|
||||||
QList<QHostAddress> getBroadcastAddresses();
|
QList<QHostAddress> getBroadcastAddresses();
|
||||||
void sendBroadcasts(QUdpSocket &socket, const NetworkPacket &np, const QList<QHostAddress> &addresses);
|
void sendBroadcasts(QUdpSocket &socket, const NetworkPacket &np, const QList<QHostAddress> &addresses);
|
||||||
|
@ -95,9 +99,11 @@ private:
|
||||||
QHostAddress sender;
|
QHostAddress sender;
|
||||||
};
|
};
|
||||||
QMap<QSslSocket *, PendingConnect> m_receivedIdentityPackets;
|
QMap<QSslSocket *, PendingConnect> m_receivedIdentityPackets;
|
||||||
QNetworkConfiguration m_lastConfig;
|
|
||||||
const bool m_testMode;
|
const bool m_testMode;
|
||||||
QTimer m_combineBroadcastsTimer;
|
QTimer m_combineBroadcastsTimer;
|
||||||
|
#if QT_VERSION_MAJOR < 6
|
||||||
|
QNetworkConfiguration m_lastConfig;
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -50,10 +50,7 @@ void CompositeFileTransferJob::startNextSubJob()
|
||||||
#ifdef SAILFISHOS
|
#ifdef SAILFISHOS
|
||||||
connect(m_currentJob, SIGNAL(processedAmount(KJob *, KJob::Unit, qulonglong)), this, SLOT(slotProcessedAmount(KJob *, KJob::Unit, qulonglong)));
|
connect(m_currentJob, SIGNAL(processedAmount(KJob *, KJob::Unit, qulonglong)), this, SLOT(slotProcessedAmount(KJob *, KJob::Unit, qulonglong)));
|
||||||
#else
|
#else
|
||||||
connect(m_currentJob,
|
connect(m_currentJob, &FileTransferJob::processedAmountChanged, this, &CompositeFileTransferJob::slotProcessedAmount);
|
||||||
QOverload<KJob *, KJob::Unit, qulonglong>::of(&FileTransferJob::processedAmount),
|
|
||||||
this,
|
|
||||||
&CompositeFileTransferJob::slotProcessedAmount);
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QProcess>
|
#include <QProcess>
|
||||||
#include <QRegExp>
|
#include <QRegularExpression>
|
||||||
#include <QStandardPaths>
|
#include <QStandardPaths>
|
||||||
#include <QUrl>
|
#include <QUrl>
|
||||||
|
|
||||||
|
@ -44,7 +44,7 @@ static DBusInstancePrivate dbusInstance;
|
||||||
|
|
||||||
void filterNonExportableCharacters(QString &s)
|
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("_"));
|
s.replace(regexp, QLatin1String("_"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
#include "networkpacket.h"
|
#include "networkpacket.h"
|
||||||
#include "pluginloader.h"
|
#include "pluginloader.h"
|
||||||
|
|
||||||
// In older Qt released, qAsConst isnt available
|
// In older Qt released, qAsConst isn't available
|
||||||
#include "qtcompat_p.h"
|
#include "qtcompat_p.h"
|
||||||
|
|
||||||
class Device::DevicePrivate
|
class Device::DevicePrivate
|
||||||
|
@ -76,7 +76,7 @@ Device::Device(QObject *parent, const QString &id)
|
||||||
QDBusConnection::sessionBus().registerObject(dbusPath(), this, QDBusConnection::ExportScriptableContents | QDBusConnection::ExportAdaptors);
|
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
|
// 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;
|
d->m_supportedPlugins = d->m_allPlugins;
|
||||||
|
|
||||||
connect(this, &Device::pairingError, this, &warn);
|
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(new Device::DevicePrivate(identityPacket.get<QString>(QStringLiteral("deviceId"))))
|
||||||
{
|
{
|
||||||
d->m_deviceName = identityPacket.get<QString>(QStringLiteral("deviceName"));
|
d->m_deviceName = identityPacket.get<QString>(QStringLiteral("deviceName"));
|
||||||
d->m_allPlugins = PluginLoader::instance()->getPluginList().toSet();
|
d->m_allPlugins = PluginLoader::instance()->getPluginSet();
|
||||||
|
|
||||||
addLink(identityPacket, dl);
|
addLink(identityPacket, dl);
|
||||||
|
|
||||||
|
@ -132,7 +132,7 @@ int Device::protocolVersion()
|
||||||
|
|
||||||
QStringList Device::supportedPlugins() const
|
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
|
bool Device::hasPlugin(const QString &name) const
|
||||||
|
@ -158,8 +158,7 @@ void Device::reloadPlugins()
|
||||||
const KPluginMetaData service = loader->getPluginInfo(pluginName);
|
const KPluginMetaData service = loader->getPluginInfo(pluginName);
|
||||||
|
|
||||||
const bool pluginEnabled = isPluginEnabled(pluginName);
|
const bool pluginEnabled = isPluginEnabled(pluginName);
|
||||||
const QSet<QString> incomingCapabilities =
|
const QStringList incomingCapabilities = service.rawData().value(QStringLiteral("X-KdeConnect-SupportedPacketType")).toVariant().toStringList();
|
||||||
KPluginMetaData::readStringList(service.rawData(), QStringLiteral("X-KdeConnect-SupportedPacketType")).toSet();
|
|
||||||
|
|
||||||
if (pluginEnabled) {
|
if (pluginEnabled) {
|
||||||
KdeConnectPlugin *plugin = d->m_plugins.take(pluginName);
|
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);
|
std::sort(d->m_deviceLinks.begin(), d->m_deviceLinks.end(), lessThan);
|
||||||
|
|
||||||
const bool capabilitiesSupported = identityPacket.has(QStringLiteral("incomingCapabilities")) || identityPacket.has(QStringLiteral("outgoingCapabilities"));
|
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) {
|
if (capabilitiesSupported) {
|
||||||
const QSet<QString> outgoingCapabilities = identityPacket.get<QStringList>(QStringLiteral("outgoingCapabilities")).toSet(),
|
const QSet<QString> outgoingCapabilities = toSet(identityPacket.get<QStringList>(QStringLiteral("outgoingCapabilities"))),
|
||||||
incomingCapabilities = identityPacket.get<QStringList>(QStringLiteral("incomingCapabilities")).toSet();
|
incomingCapabilities = toSet(identityPacket.get<QStringList>(QStringLiteral("incomingCapabilities")));
|
||||||
|
|
||||||
d->m_supportedPlugins = PluginLoader::instance()->pluginsForCapabilities(incomingCapabilities, outgoingCapabilities);
|
d->m_supportedPlugins = PluginLoader::instance()->pluginsForCapabilities(incomingCapabilities, outgoingCapabilities);
|
||||||
// qDebug() << "new plugins for" << m_deviceName << m_supportedPlugins << incomingCapabilities << outgoingCapabilities;
|
// qDebug() << "new plugins for" << m_deviceName << m_supportedPlugins << incomingCapabilities << outgoingCapabilities;
|
||||||
} else {
|
} else {
|
||||||
d->m_supportedPlugins = PluginLoader::instance()->getPluginList().toSet();
|
d->m_supportedPlugins = PluginLoader::instance()->getPluginSet();
|
||||||
}
|
}
|
||||||
|
|
||||||
reloadPlugins();
|
reloadPlugins();
|
||||||
|
|
|
@ -22,7 +22,13 @@ KdeConnectPlugin::KdeConnectPlugin(QObject *parent, const QVariantList &args)
|
||||||
{
|
{
|
||||||
d->m_device = qvariant_cast<Device *>(args.at(0));
|
d->m_device = qvariant_cast<Device *>(args.at(0));
|
||||||
d->m_pluginName = args.at(1).toString();
|
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();
|
d->m_outgoingCapabilties = args.at(2).toStringList().toSet();
|
||||||
|
#endif
|
||||||
d->m_config = nullptr;
|
d->m_config = nullptr;
|
||||||
d->iconName = args.at(3).toString();
|
d->iconName = args.at(3).toString();
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,18 +7,17 @@
|
||||||
#include "pluginloader.h"
|
#include "pluginloader.h"
|
||||||
|
|
||||||
#include <KPluginFactory>
|
#include <KPluginFactory>
|
||||||
#include <KPluginLoader>
|
|
||||||
#include <KPluginMetaData>
|
#include <KPluginMetaData>
|
||||||
#include <QPluginLoader>
|
#include <QPluginLoader>
|
||||||
#include <QStaticPlugin>
|
#include <QStaticPlugin>
|
||||||
#include <QVector>
|
#include <QVector>
|
||||||
|
|
||||||
#include "kdeconnectconfig.h"
|
|
||||||
#include "core_debug.h"
|
#include "core_debug.h"
|
||||||
#include "device.h"
|
#include "device.h"
|
||||||
|
#include "kdeconnectconfig.h"
|
||||||
#include "kdeconnectplugin.h"
|
#include "kdeconnectplugin.h"
|
||||||
|
|
||||||
// In older Qt released, qAsConst isnt available
|
// In older Qt released, qAsConst isn't available
|
||||||
#include "qtcompat_p.h"
|
#include "qtcompat_p.h"
|
||||||
|
|
||||||
PluginLoader *PluginLoader::instance()
|
PluginLoader *PluginLoader::instance()
|
||||||
|
@ -40,7 +39,7 @@ PluginLoader::PluginLoader()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
const QVector<KPluginMetaData> data = KPluginLoader::findPlugins(QStringLiteral("kdeconnect/"));
|
const QVector<KPluginMetaData> data = KPluginMetaData::findPlugins(QStringLiteral("kdeconnect/"));
|
||||||
for (const KPluginMetaData &metadata : data) {
|
for (const KPluginMetaData &metadata : data) {
|
||||||
plugins[metadata.pluginId()] = metadata;
|
plugins[metadata.pluginId()] = metadata;
|
||||||
}
|
}
|
||||||
|
@ -70,15 +69,14 @@ KdeConnectPlugin *PluginLoader::instantiatePluginForDevice(const QString &plugin
|
||||||
#ifdef SAILFISHOS
|
#ifdef SAILFISHOS
|
||||||
KPluginFactory *factory = pluginsFactories.value(pluginName);
|
KPluginFactory *factory = pluginsFactories.value(pluginName);
|
||||||
#else
|
#else
|
||||||
KPluginLoader loader(service.fileName());
|
auto factoryResult = KPluginFactory::loadFactory(service);
|
||||||
KPluginFactory *factory = loader.factory();
|
if (!factoryResult) {
|
||||||
if (!factory) {
|
qCDebug(KDECONNECT_CORE) << "KPluginFactory could not load the plugin:" << service.pluginId() << factoryResult.errorString;
|
||||||
qCDebug(KDECONNECT_CORE) << "KPluginFactory could not load the plugin:" << service.pluginId() << loader.errorString();
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
KPluginFactory *factory = factoryResult.plugin;
|
||||||
#endif
|
#endif
|
||||||
|
const QStringList outgoingInterfaces = service.rawData().value(QStringLiteral("X-KdeConnect-OutgoingPacketType")).toVariant().toStringList();
|
||||||
const QStringList outgoingInterfaces = KPluginMetaData::readStringList(service.rawData(), QStringLiteral("X-KdeConnect-OutgoingPacketType"));
|
|
||||||
|
|
||||||
QVariant deviceVariant = QVariant::fromValue<Device *>(device);
|
QVariant deviceVariant = QVariant::fromValue<Device *>(device);
|
||||||
|
|
||||||
|
@ -119,33 +117,32 @@ QSet<QString> PluginLoader::pluginsForCapabilities(const QSet<QString> &incoming
|
||||||
QString myDeviceType = KdeConnectConfig::instance().deviceType();
|
QString myDeviceType = KdeConnectConfig::instance().deviceType();
|
||||||
|
|
||||||
for (const KPluginMetaData &service : qAsConst(plugins)) {
|
for (const KPluginMetaData &service : qAsConst(plugins)) {
|
||||||
|
|
||||||
// Check if the plugin support this device type
|
// 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.isEmpty()) {
|
||||||
if (!supportedDeviceTypes.contains(myDeviceType)) {
|
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;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if capbilites intersect with the remote device
|
// Check if capbilites intersect with the remote device
|
||||||
const QSet<QString> pluginIncomingCapabilities =
|
const QStringList pluginIncomingCapabilities = service.rawData().value(QStringLiteral("X-KdeConnect-SupportedPacketType")).toVariant().toStringList();
|
||||||
KPluginMetaData::readStringList(service.rawData(), QStringLiteral("X-KdeConnect-SupportedPacketType")).toSet();
|
const QStringList pluginOutgoingCapabilities = service.rawData().value(QStringLiteral("X-KdeConnect-OutgoingPacketType")).toVariant().toStringList();
|
||||||
const QSet<QString> pluginOutgoingCapabilities =
|
|
||||||
KPluginMetaData::readStringList(service.rawData(), QStringLiteral("X-KdeConnect-OutgoingPacketType")).toSet();
|
|
||||||
|
|
||||||
bool capabilitiesEmpty = (pluginIncomingCapabilities.isEmpty() && pluginOutgoingCapabilities.isEmpty());
|
bool capabilitiesEmpty = (pluginIncomingCapabilities.isEmpty() && pluginOutgoingCapabilities.isEmpty());
|
||||||
if (!capabilitiesEmpty) {
|
if (!capabilitiesEmpty) {
|
||||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 6, 0))
|
#if (QT_VERSION >= QT_VERSION_CHECK(5, 6, 0))
|
||||||
bool capabilitiesIntersect = (outgoing.intersects(pluginIncomingCapabilities) || incoming.intersects(pluginOutgoingCapabilities));
|
bool capabilitiesIntersect = (outgoing.intersects(QSet(pluginIncomingCapabilities.begin(), pluginIncomingCapabilities.end()))
|
||||||
#else
|
|| incoming.intersects(QSet(pluginOutgoingCapabilities.begin(), pluginOutgoingCapabilities.end())));
|
||||||
|
#else
|
||||||
QSet<QString> commonIncoming = incoming;
|
QSet<QString> commonIncoming = incoming;
|
||||||
commonIncoming.intersect(pluginOutgoingCapabilities);
|
commonIncoming.intersect(pluginOutgoingCapabilities.toSet());
|
||||||
QSet<QString> commonOutgoing = outgoing;
|
QSet<QString> commonOutgoing = outgoing;
|
||||||
commonOutgoing.intersect(pluginIncomingCapabilities);
|
commonOutgoing.intersect(pluginIncomingCapabilities.toSet());
|
||||||
bool capabilitiesIntersect = (!commonIncoming.isEmpty() || !commonOutgoing.isEmpty());
|
bool capabilitiesIntersect = (!commonIncoming.isEmpty() || !commonOutgoing.isEmpty());
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (!capabilitiesIntersect) {
|
if (!capabilitiesIntersect) {
|
||||||
qCDebug(KDECONNECT_CORE) << "Not loading plugin" << service.pluginId() << "because device doesn't support it";
|
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
|
// If we get here, the plugin can be loaded
|
||||||
ret += service.pluginId();
|
ret += service.pluginId();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
|
@ -25,6 +25,15 @@ public:
|
||||||
static PluginLoader *instance();
|
static PluginLoader *instance();
|
||||||
|
|
||||||
QStringList getPluginList() const;
|
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;
|
KPluginMetaData getPluginInfo(const QString &name) const;
|
||||||
KdeConnectPlugin *instantiatePluginForDevice(const QString &name, Device *device) const;
|
KdeConnectPlugin *instantiatePluginForDevice(const QString &name, Device *device) const;
|
||||||
|
|
||||||
|
|
|
@ -7,16 +7,16 @@ ecm_qt_declare_logging_category(
|
||||||
DEFAULT_SEVERITY Warning
|
DEFAULT_SEVERITY Warning
|
||||||
EXPORT kdeconnect-kde DESCRIPTION "kdeconnect (daemon)")
|
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})
|
add_executable(kdeconnectd kdeconnectd.cpp ${kdeconnect_custom_icons_SRCS} ${debug_file_SRCS})
|
||||||
target_link_libraries(kdeconnectd
|
target_link_libraries(kdeconnectd
|
||||||
kdeconnectcore kdeconnectversion
|
kdeconnectcore kdeconnectversion
|
||||||
KF5::KIOWidgets
|
KF${QT_MAJOR_VERSION}::KIOWidgets
|
||||||
KF5::DBusAddons
|
KF${QT_MAJOR_VERSION}::DBusAddons
|
||||||
KF5::Notifications
|
KF${QT_MAJOR_VERSION}::Notifications
|
||||||
KF5::I18n
|
KF${QT_MAJOR_VERSION}::I18n
|
||||||
KF5::WindowSystem
|
KF${QT_MAJOR_VERSION}::WindowSystem
|
||||||
Qt::Widgets)
|
Qt::Widgets)
|
||||||
|
|
||||||
ecm_mark_nongui_executable(kdeconnectd)
|
ecm_mark_nongui_executable(kdeconnectd)
|
||||||
|
|
|
@ -16,10 +16,10 @@
|
||||||
|
|
||||||
#include <KAboutData>
|
#include <KAboutData>
|
||||||
#include <KDBusService>
|
#include <KDBusService>
|
||||||
|
#include <KIO/Global>
|
||||||
#include <KLocalizedString>
|
#include <KLocalizedString>
|
||||||
#include <KNotification>
|
#include <KNotification>
|
||||||
#include <KWindowSystem>
|
#include <KWindowSystem>
|
||||||
#include <KIO/Global>
|
|
||||||
|
|
||||||
#include <dbushelper.h>
|
#include <dbushelper.h>
|
||||||
|
|
||||||
|
@ -61,7 +61,7 @@ public:
|
||||||
oc.openConfiguration(deviceId);
|
oc.openConfiguration(deviceId);
|
||||||
};
|
};
|
||||||
connect(notification, &KNotification::action3Activated, openSettings);
|
connect(notification, &KNotification::action3Activated, openSettings);
|
||||||
connect(notification, QOverload<>::of(&KNotification::activated), openSettings);
|
connect(notification, QOverload<unsigned int>::of(&KNotification::activated), openSettings);
|
||||||
notification->sendEvent();
|
notification->sendEvent();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -41,10 +41,10 @@ QtObject {
|
||||||
readonly property var v: DBusAsyncResponse {
|
readonly property var v: DBusAsyncResponse {
|
||||||
id: response
|
id: response
|
||||||
autoDelete: false
|
autoDelete: false
|
||||||
onSuccess: {
|
onSuccess: result => {
|
||||||
prop._value = result;
|
prop._value = result;
|
||||||
}
|
}
|
||||||
onError: {
|
onError: message => {
|
||||||
console.warn("failed call", object, read, write, change)
|
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})
|
add_library(kdeconnectfileitemaction MODULE sendfileitemaction.cpp ${debug_file_SRCS})
|
||||||
target_link_libraries(
|
target_link_libraries(
|
||||||
kdeconnectfileitemaction
|
kdeconnectfileitemaction
|
||||||
KF5::KIOWidgets
|
KF${QT_MAJOR_VERSION}::KIOWidgets
|
||||||
KF5::I18n
|
KF${QT_MAJOR_VERSION}::I18n
|
||||||
kdeconnectinterfaces
|
kdeconnectinterfaces
|
||||||
kdeconnectcore
|
kdeconnectcore
|
||||||
)
|
)
|
||||||
|
|
|
@ -7,7 +7,7 @@ ecm_qt_declare_logging_category(
|
||||||
DEFAULT_SEVERITY Warning
|
DEFAULT_SEVERITY Warning
|
||||||
EXPORT kdeconnect-kde DESCRIPTION "kdeconnect (indicator)")
|
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
|
set(indicator_SRCS
|
||||||
main.cpp
|
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_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)
|
if (WIN32)
|
||||||
add_compile_definitions(QSYSTRAY)
|
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/virtualmonitor/virtualmonitorplugin.h virtualmonitorinterface)
|
||||||
geninterface(${PROJECT_SOURCE_DIR}/plugins/photo/photoplugin.h photointerface)
|
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
|
set_target_properties(kdeconnectinterfaces PROPERTIES
|
||||||
VERSION ${KDECONNECT_VERSION}
|
VERSION ${KDECONNECT_VERSION}
|
||||||
SOVERSION ${KDECONNECT_VERSION_MAJOR}
|
SOVERSION ${KDECONNECT_VERSION_MAJOR}
|
||||||
|
@ -71,12 +77,12 @@ target_link_libraries(kdeconnectinterfaces
|
||||||
LINK_PUBLIC
|
LINK_PUBLIC
|
||||||
Qt${QT_MAJOR_VERSION}::Gui
|
Qt${QT_MAJOR_VERSION}::Gui
|
||||||
Qt${QT_MAJOR_VERSION}::DBus
|
Qt${QT_MAJOR_VERSION}::DBus
|
||||||
KF5::ConfigCore
|
KF${QT_MAJOR_VERSION}::ConfigCore
|
||||||
LINK_PRIVATE
|
LINK_PRIVATE
|
||||||
kdeconnectcore
|
kdeconnectcore
|
||||||
KF5::I18n
|
KF${QT_MAJOR_VERSION}::I18n
|
||||||
kdeconnectcore
|
kdeconnectcore
|
||||||
KF5::CoreAddons
|
KF${QT_MAJOR_VERSION}::CoreAddons
|
||||||
)
|
)
|
||||||
|
|
||||||
install(TARGETS kdeconnectinterfaces EXPORT kdeconnectLibraryTargets ${KDE_INSTALL_TARGETS_DEFAULT_ARGS} LIBRARY NAMELINK_SKIP)
|
install(TARGETS kdeconnectinterfaces EXPORT kdeconnectLibraryTargets ${KDE_INSTALL_TARGETS_DEFAULT_ARGS} LIBRARY NAMELINK_SKIP)
|
||||||
|
|
|
@ -8,8 +8,11 @@
|
||||||
|
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
|
||||||
|
#include "kcoreaddons_version.h"
|
||||||
#include <KConfigGroup>
|
#include <KConfigGroup>
|
||||||
|
#if KCOREADDONS_VERSION < QT_VERSION_CHECK(5, 86, 0)
|
||||||
#include <KPluginLoader>
|
#include <KPluginLoader>
|
||||||
|
#endif
|
||||||
|
|
||||||
PluginModel::PluginModel(QObject *parent)
|
PluginModel::PluginModel(QObject *parent)
|
||||||
: QAbstractListModel(parent)
|
: QAbstractListModel(parent)
|
||||||
|
@ -18,7 +21,11 @@ PluginModel::PluginModel(QObject *parent)
|
||||||
connect(this, &QAbstractItemModel::rowsRemoved, this, &PluginModel::rowsChanged);
|
connect(this, &QAbstractItemModel::rowsRemoved, this, &PluginModel::rowsChanged);
|
||||||
|
|
||||||
beginResetModel();
|
beginResetModel();
|
||||||
|
#if KCOREADDONS_VERSION < QT_VERSION_CHECK(5, 84, 0)
|
||||||
m_plugins = KPluginLoader::findPlugins(QStringLiteral("kdeconnect/"));
|
m_plugins = KPluginLoader::findPlugins(QStringLiteral("kdeconnect/"));
|
||||||
|
#else
|
||||||
|
m_plugins = KPluginMetaData::findPlugins(QStringLiteral("kdeconnect/"));
|
||||||
|
#endif
|
||||||
endResetModel();
|
endResetModel();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -9,8 +9,8 @@ ki18n_wrap_ui(kcm_kdeconnect kcm.ui)
|
||||||
target_link_libraries(kcm_kdeconnect
|
target_link_libraries(kcm_kdeconnect
|
||||||
Qt::Core
|
Qt::Core
|
||||||
Qt::Gui
|
Qt::Gui
|
||||||
KF5::I18n
|
KF${QT_MAJOR_VERSION}::I18n
|
||||||
KF5::KCMUtils
|
KF${QT_MAJOR_VERSION}::KCMUtils
|
||||||
kdeconnectinterfaces
|
kdeconnectinterfaces
|
||||||
kdeconnectversion
|
kdeconnectversion
|
||||||
)
|
)
|
||||||
|
|
35
kcm/kcm.cpp
35
kcm/kcm.cpp
|
@ -27,32 +27,19 @@ static QString createId()
|
||||||
return QStringLiteral("kcm") + QString::number(QCoreApplication::applicationPid());
|
return QStringLiteral("kcm") + QString::number(QCoreApplication::applicationPid());
|
||||||
}
|
}
|
||||||
|
|
||||||
KdeConnectKcm::KdeConnectKcm(QWidget *parent, const QVariantList &args)
|
KdeConnectKcm::KdeConnectKcm(QObject *parent, const QVariantList &args)
|
||||||
: KCModule(parent)
|
: KCModule(qobject_cast<QWidget *>(parent))
|
||||||
, kcmUi(new Ui::KdeConnectKcmUi())
|
, kcmUi(new Ui::KdeConnectKcmUi())
|
||||||
, daemon(new DaemonDbusInterface(this))
|
, daemon(new DaemonDbusInterface(this))
|
||||||
, devicesModel(new DevicesModel(this))
|
, devicesModel(new DevicesModel(this))
|
||||||
, currentDevice(nullptr)
|
, 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
|
#ifdef Q_OS_WIN
|
||||||
KColorSchemeManager manager;
|
KColorSchemeManager manager;
|
||||||
QApplication::setStyle(QStringLiteral("breeze"));
|
QApplication::setStyle(QStringLiteral("breeze"));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
kcmUi->setupUi(this);
|
kcmUi->setupUi(widget());
|
||||||
|
|
||||||
sortProxyModel = new DevicesSortProxyModel(devicesModel);
|
sortProxyModel = new DevicesSortProxyModel(devicesModel);
|
||||||
|
|
||||||
|
@ -95,8 +82,6 @@ KdeConnectKcm::KdeConnectKcm(QWidget *parent, const QVariantList &args)
|
||||||
|
|
||||||
daemon->acquireDiscoveryMode(createId());
|
daemon->acquireDiscoveryMode(createId());
|
||||||
|
|
||||||
#if KCMUTILS_VERSION >= QT_VERSION_CHECK(5, 45, 0)
|
|
||||||
|
|
||||||
if (!args.isEmpty() && args.first().type() == QVariant::String) {
|
if (!args.isEmpty() && args.first().type() == QVariant::String) {
|
||||||
const QString input = args.first().toString();
|
const QString input = args.first().toString();
|
||||||
const auto colonIdx = input.indexOf(QLatin1Char(':'));
|
const auto colonIdx = input.indexOf(QLatin1Char(':'));
|
||||||
|
@ -115,8 +100,6 @@ KdeConnectKcm::KdeConnectKcm(QWidget *parent, const QVariantList &args)
|
||||||
disconnect(devicesModel, &DevicesModel::rowsInserted, this, nullptr);
|
disconnect(devicesModel, &DevicesModel::rowsInserted, this, nullptr);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void KdeConnectKcm::renameShow()
|
void KdeConnectKcm::renameShow()
|
||||||
|
@ -251,7 +234,7 @@ void KdeConnectKcm::resetDeviceView()
|
||||||
|
|
||||||
KSharedConfigPtr deviceConfig = KSharedConfig::openConfig(currentDevice->pluginsConfigFile());
|
KSharedConfigPtr deviceConfig = KSharedConfig::openConfig(currentDevice->pluginsConfigFile());
|
||||||
kcmUi->pluginSelector->clear();
|
kcmUi->pluginSelector->clear();
|
||||||
kcmUi->pluginSelector->setConfigurationArguments(QStringList(currentDevice->id()));
|
kcmUi->pluginSelector->setConfigurationArguments({currentDevice->id()});
|
||||||
kcmUi->pluginSelector->addPlugins(availablePluginInfo, i18n("Available plugins"));
|
kcmUi->pluginSelector->addPlugins(availablePluginInfo, i18n("Available plugins"));
|
||||||
kcmUi->pluginSelector->setConfig(deviceConfig->group("Plugins"));
|
kcmUi->pluginSelector->setConfig(deviceConfig->group("Plugins"));
|
||||||
connect(kcmUi->pluginSelector, &KPluginWidget::changed, this, &KdeConnectKcm::pluginsConfigChanged);
|
connect(kcmUi->pluginSelector, &KPluginWidget::changed, this, &KdeConnectKcm::pluginsConfigChanged);
|
||||||
|
@ -362,15 +345,5 @@ void KdeConnectKcm::sendPing()
|
||||||
currentDevice->pluginCall(QStringLiteral("ping"), QStringLiteral("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 "kcm.moc"
|
||||||
#include "moc_kcm.cpp"
|
#include "moc_kcm.cpp"
|
||||||
|
|
12
kcm/kcm.h
12
kcm/kcm.h
|
@ -9,6 +9,7 @@
|
||||||
|
|
||||||
#include <KCModule>
|
#include <KCModule>
|
||||||
#include <QStandardItemModel>
|
#include <QStandardItemModel>
|
||||||
|
#include <kconfigwidgets_version.h>
|
||||||
|
|
||||||
class QModelIndex;
|
class QModelIndex;
|
||||||
class DeviceDbusInterface;
|
class DeviceDbusInterface;
|
||||||
|
@ -25,13 +26,18 @@ class KdeConnectKcm : public KCModule
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
KdeConnectKcm(QWidget *parent, const QVariantList &);
|
KdeConnectKcm(QObject *parent, const QVariantList &);
|
||||||
~KdeConnectKcm() override;
|
~KdeConnectKcm() override;
|
||||||
|
|
||||||
|
#if KCONFIGWIDGETS_VERSION < QT_VERSION_CHECK(5, 105, 0)
|
||||||
|
QWidget *widget()
|
||||||
|
{
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void save() override;
|
void save() override;
|
||||||
QSize sizeHint() const override;
|
|
||||||
QSize minimumSizeHint() const override;
|
|
||||||
|
|
||||||
private Q_SLOTS:
|
private Q_SLOTS:
|
||||||
void deviceSelected(const QModelIndex ¤t);
|
void deviceSelected(const QModelIndex ¤t);
|
||||||
|
|
|
@ -4,12 +4,12 @@ add_library(kdeconnectpluginkcm kdeconnectpluginkcm.cpp)
|
||||||
target_link_libraries(kdeconnectpluginkcm
|
target_link_libraries(kdeconnectpluginkcm
|
||||||
PUBLIC
|
PUBLIC
|
||||||
kdeconnectcore
|
kdeconnectcore
|
||||||
|
KF${QT_MAJOR_VERSION}::KCMUtils
|
||||||
PRIVATE
|
PRIVATE
|
||||||
Qt::DBus
|
Qt::DBus
|
||||||
Qt::Gui
|
Qt::Gui
|
||||||
KF5::I18n
|
KF${QT_MAJOR_VERSION}::I18n
|
||||||
KF5::ConfigCore
|
KF${QT_MAJOR_VERSION}::ConfigCore
|
||||||
KF5::KCMUtils
|
|
||||||
)
|
)
|
||||||
|
|
||||||
set_target_properties(kdeconnectpluginkcm PROPERTIES
|
set_target_properties(kdeconnectpluginkcm PROPERTIES
|
||||||
|
|
|
@ -15,8 +15,8 @@ struct KdeConnectPluginKcmPrivate {
|
||||||
KdeConnectPluginConfig *m_config = nullptr;
|
KdeConnectPluginConfig *m_config = nullptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
KdeConnectPluginKcm::KdeConnectPluginKcm(QWidget *parent, const QVariantList &args, const QString &pluginName)
|
KdeConnectPluginKcm::KdeConnectPluginKcm(QObject *parent, const QVariantList &args, const QString &pluginName)
|
||||||
: KCModule(parent, args)
|
: KCModule(qobject_cast<QWidget *>(parent), args)
|
||||||
, d(new KdeConnectPluginKcmPrivate())
|
, d(new KdeConnectPluginKcmPrivate())
|
||||||
{
|
{
|
||||||
d->m_deviceId = args.at(0).toString();
|
d->m_deviceId = args.at(0).toString();
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
#define KDECONNECTPLUGINKCM_H
|
#define KDECONNECTPLUGINKCM_H
|
||||||
|
|
||||||
#include <KCModule>
|
#include <KCModule>
|
||||||
|
#include <kconfigwidgets_version.h>
|
||||||
|
|
||||||
#include "core/kdeconnectpluginconfig.h"
|
#include "core/kdeconnectpluginconfig.h"
|
||||||
#include "kdeconnectpluginkcm_export.h"
|
#include "kdeconnectpluginkcm_export.h"
|
||||||
|
@ -23,7 +24,7 @@ class KDECONNECTPLUGINKCM_EXPORT KdeConnectPluginKcm : public KCModule
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
KdeConnectPluginKcm(QWidget *parent, const QVariantList &args, const QString &componentName);
|
KdeConnectPluginKcm(QObject *parent, const QVariantList &args, const QString &componentName);
|
||||||
~KdeConnectPluginKcm() override;
|
~KdeConnectPluginKcm() override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -36,6 +37,13 @@ public:
|
||||||
*/
|
*/
|
||||||
KdeConnectPluginConfig *config() const;
|
KdeConnectPluginConfig *config() const;
|
||||||
|
|
||||||
|
#if KCONFIGWIDGETS_VERSION < QT_VERSION_CHECK(5, 105, 0)
|
||||||
|
QWidget *widget()
|
||||||
|
{
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QScopedPointer<KdeConnectPluginKcmPrivate> d;
|
QScopedPointer<KdeConnectPluginKcmPrivate> d;
|
||||||
};
|
};
|
||||||
|
|
|
@ -18,8 +18,8 @@ target_link_libraries(kio_kdeconnect
|
||||||
kdeconnectinterfaces
|
kdeconnectinterfaces
|
||||||
Qt::Core
|
Qt::Core
|
||||||
Qt::Network
|
Qt::Network
|
||||||
KF5::KIOCore
|
KF${QT_MAJOR_VERSION}::KIOCore
|
||||||
KF5::I18n
|
KF${QT_MAJOR_VERSION}::I18n
|
||||||
)
|
)
|
||||||
|
|
||||||
########### install files ###############
|
########### install files ###############
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
kpackage_install_package(package org.kde.kdeconnect plasmoids plasma NO_DEPRECATED_WARNING)
|
kpackage_install_package(package org.kde.kdeconnect plasmoids plasma NO_DEPRECATED_WARNING)
|
||||||
|
|
||||||
install(FILES package/metadata.desktop
|
#install(FILES package/metadata.desktop
|
||||||
DESTINATION ${KDE_INSTALL_KSERVICESDIR}
|
# DESTINATION ${KDE_INSTALL_KSERVICESDIR}
|
||||||
RENAME plasma-kdeconnect.desktop)
|
#RENAME plasma-kdeconnect.desktop)
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
import QtQuick 2.1
|
import QtQuick 2.1
|
||||||
import org.kde.plasma.core 2.0 as PlasmaCore
|
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
|
import org.kde.kdeconnect 1.0
|
||||||
|
|
||||||
QtObject {
|
QtObject {
|
||||||
|
|
|
@ -24,9 +24,13 @@ DropArea {
|
||||||
MouseArea {
|
MouseArea {
|
||||||
id: kdeConnectMouseArea
|
id: kdeConnectMouseArea
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
property bool wasExpanded
|
||||||
|
|
||||||
|
onPressed: {
|
||||||
|
wasExpanded = root.expanded;
|
||||||
|
}
|
||||||
onClicked: {
|
onClicked: {
|
||||||
plasmoid.expanded = !plasmoid.expanded;
|
root.expanded = !wasExpanded;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
import QtQuick 2.1
|
import QtQuick 2.1
|
||||||
import org.kde.plasma.core 2.0 as PlasmaCore
|
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
|
import org.kde.kdeconnect 1.0
|
||||||
|
|
||||||
QtObject {
|
QtObject {
|
||||||
|
|
|
@ -7,13 +7,13 @@
|
||||||
import QtQuick 2.1
|
import QtQuick 2.1
|
||||||
import QtQuick.Layouts 1.1
|
import QtQuick.Layouts 1.1
|
||||||
import org.kde.plasma.core 2.0 as PlasmaCore
|
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.components 3.0 as PlasmaComponents3
|
||||||
|
import org.kde.plasma.extras 2.0 as PlasmaExtras
|
||||||
import org.kde.kdeconnect 1.0
|
import org.kde.kdeconnect 1.0
|
||||||
import QtQuick.Dialogs 1.0
|
import QtQuick.Dialogs
|
||||||
import QtQuick.Controls 2.4
|
import QtQuick.Controls 2.4
|
||||||
|
|
||||||
PlasmaComponents.ListItem
|
PlasmaComponents3.ItemDelegate
|
||||||
{
|
{
|
||||||
id: root
|
id: root
|
||||||
readonly property QtObject device: DeviceDbusInterfaceFactory.create(model.deviceId)
|
readonly property QtObject device: DeviceDbusInterfaceFactory.create(model.deviceId)
|
||||||
|
@ -70,7 +70,7 @@ PlasmaComponents.ListItem
|
||||||
device: root.device
|
device: root.device
|
||||||
}
|
}
|
||||||
|
|
||||||
PlasmaComponents.Label {
|
PlasmaComponents3.Label {
|
||||||
id: deviceName
|
id: deviceName
|
||||||
elide: Text.ElideRight
|
elide: Text.ElideRight
|
||||||
text: model.name
|
text: model.name
|
||||||
|
@ -110,7 +110,7 @@ PlasmaComponents.ListItem
|
||||||
visible: valid
|
visible: valid
|
||||||
}
|
}
|
||||||
|
|
||||||
PlasmaComponents.Label {
|
PlasmaComponents3.Label {
|
||||||
// Fallback plain-text label. Only show this if the icon doesn't work.
|
// Fallback plain-text label. Only show this if the icon doesn't work.
|
||||||
id: connectivityText
|
id: connectivityText
|
||||||
text: connectivity.displayString
|
text: connectivity.displayString
|
||||||
|
@ -133,7 +133,7 @@ PlasmaComponents.ListItem
|
||||||
Layout.alignment: Qt.AlignCenter
|
Layout.alignment: Qt.AlignCenter
|
||||||
}
|
}
|
||||||
|
|
||||||
PlasmaComponents.Label {
|
PlasmaComponents3.Label {
|
||||||
id: batteryPercent
|
id: batteryPercent
|
||||||
text: i18nc("Battery charge percentage", "%1%", battery.charge)
|
text: i18nc("Battery charge percentage", "%1%", battery.charge)
|
||||||
textFormat: Text.PlainText
|
textFormat: Text.PlainText
|
||||||
|
@ -143,23 +143,23 @@ PlasmaComponents.ListItem
|
||||||
PlasmaComponents3.ToolButton {
|
PlasmaComponents3.ToolButton {
|
||||||
id: overflowMenu
|
id: overflowMenu
|
||||||
icon.name: "application-menu"
|
icon.name: "application-menu"
|
||||||
checked: menu.status === PlasmaComponents.DialogStatus.Open
|
checked: menu.status === PlasmaExtras.DialogStatus.Open
|
||||||
|
|
||||||
onPressed: menu.openRelative()
|
onPressed: menu.openRelative()
|
||||||
|
|
||||||
PlasmaComponents.ContextMenu {
|
PlasmaExtras.Menu {
|
||||||
id: menu
|
id: menu
|
||||||
visualParent: overflowMenu
|
visualParent: overflowMenu
|
||||||
placement: PlasmaCore.Types.BottomPosedLeftAlignedPopup
|
placement: PlasmaCore.Types.BottomPosedLeftAlignedPopup
|
||||||
|
|
||||||
//Share
|
//Share
|
||||||
PlasmaComponents.MenuItem
|
PlasmaExtras.MenuItem
|
||||||
{
|
{
|
||||||
FileDialog {
|
FileDialog {
|
||||||
id: fileDialog
|
id: fileDialog
|
||||||
title: i18n("Please choose a file")
|
title: i18n("Please choose a file")
|
||||||
folder: shortcuts.home
|
currentFolder: shortcuts.home
|
||||||
selectMultiple: true
|
fileMode: FileDialog.OpenFiles
|
||||||
onAccepted: fileDialog.fileUrls.forEach(url => share.plugin.shareUrl(url))
|
onAccepted: fileDialog.fileUrls.forEach(url => share.plugin.shareUrl(url))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -171,14 +171,14 @@ PlasmaComponents.ListItem
|
||||||
}
|
}
|
||||||
|
|
||||||
//Photo
|
//Photo
|
||||||
PlasmaComponents.MenuItem
|
PlasmaExtras.MenuItem
|
||||||
{
|
{
|
||||||
FileDialog {
|
FileDialog {
|
||||||
id: photoFileDialog
|
id: photoFileDialog
|
||||||
title: i18n("Save As")
|
title: i18n("Save As")
|
||||||
folder: shortcuts.pictures
|
currentFolder: shortcuts.pictures
|
||||||
selectMultiple: false
|
fileMode: FileDialog.SaveFile
|
||||||
selectExisting: false
|
//selectExisting: false
|
||||||
onAccepted: {
|
onAccepted: {
|
||||||
var path = photoFileDialog.fileUrl.toString();
|
var path = photoFileDialog.fileUrl.toString();
|
||||||
photo.plugin.requestPhoto(path);
|
photo.plugin.requestPhoto(path);
|
||||||
|
@ -193,7 +193,7 @@ PlasmaComponents.ListItem
|
||||||
}
|
}
|
||||||
|
|
||||||
//Find my phone
|
//Find my phone
|
||||||
PlasmaComponents.MenuItem
|
PlasmaExtras.MenuItem
|
||||||
{
|
{
|
||||||
FindMyPhone {
|
FindMyPhone {
|
||||||
id: findmyphone
|
id: findmyphone
|
||||||
|
@ -211,7 +211,7 @@ PlasmaComponents.ListItem
|
||||||
}
|
}
|
||||||
|
|
||||||
//SFTP
|
//SFTP
|
||||||
PlasmaComponents.MenuItem
|
PlasmaExtras.MenuItem
|
||||||
{
|
{
|
||||||
Sftp {
|
Sftp {
|
||||||
id: sftp
|
id: sftp
|
||||||
|
@ -229,7 +229,7 @@ PlasmaComponents.ListItem
|
||||||
}
|
}
|
||||||
|
|
||||||
//SMS
|
//SMS
|
||||||
PlasmaComponents.MenuItem
|
PlasmaExtras.MenuItem
|
||||||
{
|
{
|
||||||
SMS {
|
SMS {
|
||||||
id: sms
|
id: sms
|
||||||
|
@ -249,7 +249,7 @@ PlasmaComponents.ListItem
|
||||||
}
|
}
|
||||||
|
|
||||||
//RemoteKeyboard
|
//RemoteKeyboard
|
||||||
PlasmaComponents.ListItem {
|
PlasmaComponents3.ItemDelegate {
|
||||||
visible: remoteKeyboard.remoteState
|
visible: remoteKeyboard.remoteState
|
||||||
width: parent.width
|
width: parent.width
|
||||||
|
|
||||||
|
@ -257,7 +257,7 @@ PlasmaComponents.ListItem
|
||||||
width: parent.width
|
width: parent.width
|
||||||
spacing: 5
|
spacing: 5
|
||||||
|
|
||||||
PlasmaComponents.Label {
|
PlasmaComponents3.Label {
|
||||||
id: remoteKeyboardLabel
|
id: remoteKeyboardLabel
|
||||||
text: i18n("Remote Keyboard")
|
text: i18n("Remote Keyboard")
|
||||||
}
|
}
|
||||||
|
@ -271,18 +271,20 @@ PlasmaComponents.ListItem
|
||||||
}
|
}
|
||||||
|
|
||||||
//Notifications
|
//Notifications
|
||||||
PlasmaComponents.ListItem {
|
PlasmaComponents3.ItemDelegate {
|
||||||
visible: notificationsModel.count>0
|
visible: notificationsModel.count>0
|
||||||
enabled: true
|
enabled: true
|
||||||
PlasmaComponents.Label {
|
PlasmaComponents3.Label {
|
||||||
text: i18n("Notifications:")
|
text: i18n("Notifications:")
|
||||||
}
|
}
|
||||||
PlasmaComponents.ToolButton {
|
PlasmaComponents3.ToolButton {
|
||||||
enabled: true
|
enabled: true
|
||||||
visible: notificationsModel.isAnyDimissable;
|
visible: notificationsModel.isAnyDimissable;
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
iconSource: "edit-clear-history"
|
icon.name: "edit-clear-history"
|
||||||
tooltip: i18n("Dismiss all notifications")
|
PlasmaComponents3.ToolTip.text: i18n("Dismiss all notifications")
|
||||||
|
PlasmaComponents3.ToolTip.visible: hovered
|
||||||
|
PlasmaComponents3.ToolTip.delay: Kirigami.Units.toolTipDelay
|
||||||
onClicked: notificationsModel.dismissAll();
|
onClicked: notificationsModel.dismissAll();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -292,7 +294,7 @@ PlasmaComponents.ListItem
|
||||||
id: notificationsModel
|
id: notificationsModel
|
||||||
deviceId: root.device.id()
|
deviceId: root.device.id()
|
||||||
}
|
}
|
||||||
delegate: PlasmaComponents.ListItem {
|
delegate: PlasmaComponents3.ItemDelegate {
|
||||||
id: listitem
|
id: listitem
|
||||||
enabled: true
|
enabled: true
|
||||||
onClicked: checked = !checked
|
onClicked: checked = !checked
|
||||||
|
@ -306,7 +308,7 @@ PlasmaComponents.ListItem
|
||||||
height: width
|
height: width
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
}
|
}
|
||||||
PlasmaComponents.Label {
|
PlasmaComponents3.Label {
|
||||||
id: notificationLabel
|
id: notificationLabel
|
||||||
text: appName + ": " + (title.length>0 ? (appName==title?notitext:title+": "+notitext) : model.name)
|
text: appName + ": " + (title.length>0 ? (appName==title?notitext:title+": "+notitext) : model.name)
|
||||||
anchors.right: replyButton.left
|
anchors.right: replyButton.left
|
||||||
|
@ -315,22 +317,26 @@ PlasmaComponents.ListItem
|
||||||
maximumLineCount: listitem.checked ? 0 : 1
|
maximumLineCount: listitem.checked ? 0 : 1
|
||||||
wrapMode: Text.WordWrap
|
wrapMode: Text.WordWrap
|
||||||
}
|
}
|
||||||
PlasmaComponents.ToolButton {
|
PlasmaComponents3.ToolButton {
|
||||||
id: replyButton
|
id: replyButton
|
||||||
visible: repliable
|
visible: repliable
|
||||||
enabled: repliable && !replying
|
enabled: repliable && !replying
|
||||||
anchors.right: dismissButton.left
|
anchors.right: dismissButton.left
|
||||||
iconSource: "mail-reply-sender"
|
icon.name: "mail-reply-sender"
|
||||||
tooltip: i18n("Reply")
|
PlasmaComponents3.ToolTip.text: i18n("Reply")
|
||||||
|
PlasmaComponents3.ToolTip.visible: hovered
|
||||||
|
PlasmaComponents3.ToolTip.delay: Kirigami.Units.toolTipDelay
|
||||||
onClicked: { replying = true; replyTextField.forceActiveFocus(); }
|
onClicked: { replying = true; replyTextField.forceActiveFocus(); }
|
||||||
}
|
}
|
||||||
PlasmaComponents.ToolButton {
|
PlasmaComponents3.ToolButton {
|
||||||
id: dismissButton
|
id: dismissButton
|
||||||
visible: notificationsModel.isAnyDimissable;
|
visible: notificationsModel.isAnyDimissable;
|
||||||
enabled: dismissable
|
enabled: dismissable
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
iconSource: "window-close"
|
icon.name: "window-close"
|
||||||
tooltip: i18n("Dismiss")
|
PlasmaComponents3.ToolTip.text: i18n("Dismiss")
|
||||||
|
PlasmaComponents3.ToolTip.visible: hovered
|
||||||
|
PlasmaComponents3.ToolTip.delay: Kirigami.Units.toolTipDelay
|
||||||
onClicked: dbusInterface.dismiss();
|
onClicked: dbusInterface.dismiss();
|
||||||
}
|
}
|
||||||
RowLayout {
|
RowLayout {
|
||||||
|
@ -393,16 +399,18 @@ PlasmaComponents.ListItem
|
||||||
visible: rc.available
|
visible: rc.available
|
||||||
width: parent.width
|
width: parent.width
|
||||||
|
|
||||||
PlasmaComponents.Label {
|
PlasmaComponents3.Label {
|
||||||
text: i18n("Run command")
|
text: i18n("Run command")
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
}
|
}
|
||||||
|
|
||||||
PlasmaComponents.Button
|
PlasmaComponents3.Button
|
||||||
{
|
{
|
||||||
id: addCommandButton
|
id: addCommandButton
|
||||||
iconSource: "list-add"
|
icon.name: "list-add"
|
||||||
tooltip: i18n("Add command")
|
PlasmaComponents3.ToolTip.text: i18n("Add command")
|
||||||
|
PlasmaComponents3.ToolTip.visible: hovered
|
||||||
|
PlasmaComponents3.ToolTip.delay: Kirigami.Units.toolTipDelay
|
||||||
onClicked: rc.plugin.editCommands()
|
onClicked: rc.plugin.editCommands()
|
||||||
visible: rc.plugin && rc.plugin.canAddCommand
|
visible: rc.plugin && rc.plugin.canAddCommand
|
||||||
}
|
}
|
||||||
|
@ -414,11 +422,11 @@ PlasmaComponents.ListItem
|
||||||
id: commandsModel
|
id: commandsModel
|
||||||
deviceId: rc.device.id()
|
deviceId: rc.device.id()
|
||||||
}
|
}
|
||||||
delegate: PlasmaComponents.ListItem {
|
delegate: PlasmaComponents3.ItemDelegate {
|
||||||
enabled: true
|
enabled: true
|
||||||
onClicked: rc.plugin.triggerCommand(key)
|
onClicked: rc.plugin.triggerCommand(key)
|
||||||
|
|
||||||
PlasmaComponents.Label {
|
PlasmaComponents3.Label {
|
||||||
text: name + "\n" + command
|
text: name + "\n" + command
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
import QtQuick 2.1
|
import QtQuick 2.1
|
||||||
import org.kde.plasma.core 2.0 as PlasmaCore
|
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
|
import org.kde.kdeconnect 1.0
|
||||||
|
|
||||||
QtObject {
|
QtObject {
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
import QtQuick 2.1
|
import QtQuick 2.1
|
||||||
import org.kde.plasma.core 2.0 as PlasmaCore
|
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
|
import org.kde.kdeconnect 1.0
|
||||||
|
|
||||||
QtObject {
|
QtObject {
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
import QtQuick 2.1
|
import QtQuick 2.1
|
||||||
import org.kde.plasma.core 2.0 as PlasmaCore
|
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
|
import org.kde.kdeconnect 1.0
|
||||||
|
|
||||||
QtObject {
|
QtObject {
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
import QtQuick 2.1
|
import QtQuick 2.1
|
||||||
import org.kde.plasma.core 2.0 as PlasmaCore
|
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
|
import org.kde.kdeconnect 1.0
|
||||||
|
|
||||||
QtObject {
|
QtObject {
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
import QtQuick 2.1
|
import QtQuick 2.1
|
||||||
import org.kde.plasma.core 2.0 as PlasmaCore
|
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
|
import org.kde.kdeconnect 1.0
|
||||||
|
|
||||||
QtObject {
|
QtObject {
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
import QtQuick 2.1
|
import QtQuick 2.1
|
||||||
import org.kde.plasma.core 2.0 as PlasmaCore
|
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
|
import org.kde.kdeconnect 1.0
|
||||||
|
|
||||||
QtObject
|
QtObject
|
||||||
|
|
|
@ -10,8 +10,9 @@ import org.kde.plasma.plasmoid 2.0
|
||||||
import org.kde.kquickcontrolsaddons 2.0
|
import org.kde.kquickcontrolsaddons 2.0
|
||||||
import org.kde.kdeconnect 1.0
|
import org.kde.kdeconnect 1.0
|
||||||
|
|
||||||
Item
|
PlasmoidItem
|
||||||
{
|
{
|
||||||
|
id: root
|
||||||
DevicesModel {
|
DevicesModel {
|
||||||
id: connectDeviceModel
|
id: connectDeviceModel
|
||||||
displayFilter: DevicesModel.Paired | DevicesModel.Reachable
|
displayFilter: DevicesModel.Paired | DevicesModel.Reachable
|
||||||
|
@ -28,16 +29,16 @@ Item
|
||||||
value: (connectDeviceModel.count > 0) ? PlasmaCore.Types.ActiveStatus : PlasmaCore.Types.PassiveStatus
|
value: (connectDeviceModel.count > 0) ? PlasmaCore.Types.ActiveStatus : PlasmaCore.Types.PassiveStatus
|
||||||
}
|
}
|
||||||
|
|
||||||
Plasmoid.fullRepresentation: FullRepresentation {
|
fullRepresentation: FullRepresentation {
|
||||||
devicesModel: connectDeviceModel
|
devicesModel: connectDeviceModel
|
||||||
}
|
}
|
||||||
|
|
||||||
Plasmoid.compactRepresentation: CompactRepresentation {
|
compactRepresentation: CompactRepresentation {
|
||||||
}
|
}
|
||||||
|
|
||||||
readonly property bool isConstrained: (plasmoid.formFactor == PlasmaCore.Types.Vertical || plasmoid.formFactor == PlasmaCore.Types.Horizontal)
|
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() {
|
function action_launchkcm() {
|
||||||
OpenConfig.openConfiguration()
|
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)
|
add_subdirectory(virtualmonitor)
|
||||||
|
|
||||||
if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
|
if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
|
||||||
find_package(KF5ModemManagerQt ${KF5_MIN_VERSION})
|
find_package(KF${QT_MAJOR_VERSION}ModemManagerQt ${KF5_MIN_VERSION})
|
||||||
if (TARGET KF5::ModemManagerQt)
|
if (TARGET KF${QT_MAJOR_VERSION}::ModemManagerQt)
|
||||||
add_subdirectory(mmtelephony)
|
add_subdirectory(mmtelephony)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
|
@ -15,6 +15,6 @@ kdeconnect_add_plugin(kdeconnect_battery SOURCES ${kdeconnect_battery_SRCS})
|
||||||
target_link_libraries(kdeconnect_battery
|
target_link_libraries(kdeconnect_battery
|
||||||
kdeconnectcore
|
kdeconnectcore
|
||||||
Qt${QT_MAJOR_VERSION}::DBus
|
Qt${QT_MAJOR_VERSION}::DBus
|
||||||
KF5::Solid
|
KF${QT_MAJOR_VERSION}::Solid
|
||||||
KF5::I18n
|
KF${QT_MAJOR_VERSION}::I18n
|
||||||
)
|
)
|
||||||
|
|
|
@ -4,4 +4,4 @@ set(kdeconnect_bigscreen_SRCS
|
||||||
|
|
||||||
kdeconnect_add_plugin(kdeconnect_bigscreen SOURCES ${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})
|
kdeconnect_add_plugin(kdeconnect_clipboard SOURCES ${kdeconnect_clipboard_SRCS})
|
||||||
|
|
||||||
target_link_libraries(kdeconnect_clipboard kdeconnectcore
|
target_link_libraries(kdeconnect_clipboard kdeconnectcore
|
||||||
KF5::GuiAddons
|
KF${QT_MAJOR_VERSION}::GuiAddons
|
||||||
${kdeconnect_clipboard_WL_LINK_LIBS}
|
${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
|
target_link_libraries( kdeconnect_clipboard_config
|
||||||
kdeconnectcore
|
kdeconnectcore
|
||||||
kdeconnectpluginkcm
|
kdeconnectpluginkcm
|
||||||
KF5::I18n
|
KF${QT_MAJOR_VERSION}::I18n
|
||||||
KF5::KCMUtils
|
KF${QT_MAJOR_VERSION}::KCMUtils
|
||||||
)
|
)
|
||||||
|
|
|
@ -11,11 +11,11 @@
|
||||||
|
|
||||||
K_PLUGIN_FACTORY(ClipboardConfigFactory, registerPlugin<ClipboardConfig>();)
|
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"))
|
: KdeConnectPluginKcm(parent, args, QStringLiteral("kdeconnect_clipboard"))
|
||||||
, m_ui(new Ui::ClipboardConfigUi())
|
, 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_unknown, SIGNAL(toggled(bool)), this, SLOT(changed()));
|
||||||
connect(m_ui->check_password, 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();
|
KCModule::defaults();
|
||||||
m_ui->check_unknown->setChecked(true);
|
m_ui->check_unknown->setChecked(true);
|
||||||
m_ui->check_password->setChecked(true);
|
m_ui->check_password->setChecked(true);
|
||||||
Q_EMIT changed(true);
|
markAsChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ClipboardConfig::load()
|
void ClipboardConfig::load()
|
||||||
|
@ -41,8 +41,6 @@ void ClipboardConfig::load()
|
||||||
bool password = config()->getBool(QStringLiteral("sendPassword"), true);
|
bool password = config()->getBool(QStringLiteral("sendPassword"), true);
|
||||||
m_ui->check_unknown->setChecked(unknown);
|
m_ui->check_unknown->setChecked(unknown);
|
||||||
m_ui->check_password->setChecked(password);
|
m_ui->check_password->setChecked(password);
|
||||||
|
|
||||||
Q_EMIT changed(false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ClipboardConfig::save()
|
void ClipboardConfig::save()
|
||||||
|
@ -50,7 +48,6 @@ void ClipboardConfig::save()
|
||||||
config()->set(QStringLiteral("sendUnknown"), m_ui->check_unknown->isChecked());
|
config()->set(QStringLiteral("sendUnknown"), m_ui->check_unknown->isChecked());
|
||||||
config()->set(QStringLiteral("sendPassword"), m_ui->check_password->isChecked());
|
config()->set(QStringLiteral("sendPassword"), m_ui->check_password->isChecked());
|
||||||
KCModule::save();
|
KCModule::save();
|
||||||
Q_EMIT changed(false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#include "clipboard_config.moc"
|
#include "clipboard_config.moc"
|
||||||
|
|
|
@ -9,16 +9,16 @@
|
||||||
|
|
||||||
#include "kcmplugin/kdeconnectpluginkcm.h"
|
#include "kcmplugin/kdeconnectpluginkcm.h"
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui
|
||||||
class ClipboardConfigUi;
|
{
|
||||||
|
class ClipboardConfigUi;
|
||||||
}
|
}
|
||||||
|
|
||||||
class ClipboardConfig
|
class ClipboardConfig : public KdeConnectPluginKcm
|
||||||
: public KdeConnectPluginKcm
|
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
ClipboardConfig(QWidget *parent, const QVariantList&);
|
ClipboardConfig(QObject *parent, const QVariantList &);
|
||||||
~ClipboardConfig() override;
|
~ClipboardConfig() override;
|
||||||
|
|
||||||
public Q_SLOTS:
|
public Q_SLOTS:
|
||||||
|
@ -28,7 +28,6 @@ public Q_SLOTS:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::ClipboardConfigUi *m_ui;
|
Ui::ClipboardConfigUi *m_ui;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -15,6 +15,6 @@ kdeconnect_add_plugin(kdeconnect_connectivity_report SOURCES ${kdeconnect_connec
|
||||||
target_link_libraries(kdeconnect_connectivity_report
|
target_link_libraries(kdeconnect_connectivity_report
|
||||||
kdeconnectcore
|
kdeconnectcore
|
||||||
Qt${QT_MAJOR_VERSION}::DBus
|
Qt${QT_MAJOR_VERSION}::DBus
|
||||||
KF5::Solid
|
KF${QT_MAJOR_VERSION}::Solid
|
||||||
KF5::I18n
|
KF${QT_MAJOR_VERSION}::I18n
|
||||||
)
|
)
|
||||||
|
|
|
@ -22,7 +22,7 @@ target_link_libraries(kdeconnect_findthisdevice
|
||||||
|
|
||||||
if (NOT WIN32)
|
if (NOT WIN32)
|
||||||
target_link_libraries(kdeconnect_findthisdevice
|
target_link_libraries(kdeconnect_findthisdevice
|
||||||
KF5::PulseAudioQt
|
KF${QT_MAJOR_VERSION}::PulseAudioQt
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
@ -33,8 +33,8 @@ target_sources(kdeconnect_findthisdevice_config PRIVATE findthisdevice_config.cp
|
||||||
target_link_libraries(kdeconnect_findthisdevice_config
|
target_link_libraries(kdeconnect_findthisdevice_config
|
||||||
kdeconnectpluginkcm
|
kdeconnectpluginkcm
|
||||||
Qt::Multimedia
|
Qt::Multimedia
|
||||||
KF5::I18n
|
KF${QT_MAJOR_VERSION}::I18n
|
||||||
KF5::CoreAddons
|
KF${QT_MAJOR_VERSION}::CoreAddons
|
||||||
KF5::ConfigWidgets
|
KF${QT_MAJOR_VERSION}::ConfigWidgets
|
||||||
KF5::KIOWidgets # KUrlRequester
|
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
|
target_link_libraries(kdeconnect_lockdevice
|
||||||
kdeconnectcore
|
kdeconnectcore
|
||||||
Qt::DBus
|
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
|
target_link_libraries(kdeconnect_mmtelephony
|
||||||
kdeconnectcore
|
kdeconnectcore
|
||||||
Qt${QT_MAJOR_VERSION}::DBus
|
Qt${QT_MAJOR_VERSION}::DBus
|
||||||
KF5::ModemManagerQt
|
KF${QT_MAJOR_VERSION}::ModemManagerQt
|
||||||
KF5::I18n
|
KF${QT_MAJOR_VERSION}::I18n
|
||||||
)
|
)
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
kdeconnect_add_plugin(kdeconnect_mousepad SOURCES mousepadplugin.cpp abstractremoteinput.cpp)
|
kdeconnect_add_plugin(kdeconnect_mousepad SOURCES mousepadplugin.cpp abstractremoteinput.cpp)
|
||||||
|
|
||||||
if(UNIX AND NOT APPLE)
|
if(UNIX AND NOT APPLE)
|
||||||
qt5_add_dbus_interface(
|
qt_add_dbus_interface(
|
||||||
SRCS
|
SRCS
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/xdp_dbus_remotedesktop_interface.xml
|
${CMAKE_CURRENT_SOURCE_DIR}/xdp_dbus_remotedesktop_interface.xml
|
||||||
xdp_dbus_remotedesktop_interface
|
xdp_dbus_remotedesktop_interface
|
||||||
|
@ -36,7 +36,7 @@ set(HAVE_X11 ${LibFakeKey_FOUND})
|
||||||
set(HAVE_MACOS ${APPLE})
|
set(HAVE_MACOS ${APPLE})
|
||||||
configure_file(config-mousepad.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-mousepad.h)
|
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)
|
if (HAVE_WINDOWS)
|
||||||
target_sources(kdeconnect_mousepad PUBLIC windowsremoteinput.cpp)
|
target_sources(kdeconnect_mousepad PUBLIC windowsremoteinput.cpp)
|
||||||
|
@ -46,6 +46,8 @@ if(HAVE_X11)
|
||||||
target_sources(kdeconnect_mousepad PUBLIC x11remoteinput.cpp)
|
target_sources(kdeconnect_mousepad PUBLIC x11remoteinput.cpp)
|
||||||
if (QT_MAJOR_VERSION EQUAL "5")
|
if (QT_MAJOR_VERSION EQUAL "5")
|
||||||
target_link_libraries(kdeconnect_mousepad Qt5::X11Extras)
|
target_link_libraries(kdeconnect_mousepad Qt5::X11Extras)
|
||||||
|
elseif(QT_MAJOR_VERSION EQUAL "6")
|
||||||
|
target_link_libraries(kdeconnect_mousepad Qt6::GuiPrivate)
|
||||||
endif()
|
endif()
|
||||||
target_link_libraries(kdeconnect_mousepad ${X11_LIBRARIES} ${XTEST_LIBRARIES} ${LibFakeKey_LIBRARIES})
|
target_link_libraries(kdeconnect_mousepad ${X11_LIBRARIES} ${XTEST_LIBRARIES} ${LibFakeKey_LIBRARIES})
|
||||||
endif()
|
endif()
|
||||||
|
|
|
@ -9,7 +9,11 @@
|
||||||
|
|
||||||
#include <QCursor>
|
#include <QCursor>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||||
#include <QX11Info>
|
#include <QX11Info>
|
||||||
|
#else
|
||||||
|
#include <private/qtx11extras_p.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <X11/extensions/XTest.h>
|
#include <X11/extensions/XTest.h>
|
||||||
#include <X11/keysym.h>
|
#include <X11/keysym.h>
|
||||||
|
|
|
@ -19,13 +19,15 @@ kdeconnect_add_plugin(kdeconnect_notifications SOURCES ${kdeconnect_notification
|
||||||
target_link_libraries(kdeconnect_notifications
|
target_link_libraries(kdeconnect_notifications
|
||||||
kdeconnectcore
|
kdeconnectcore
|
||||||
Qt::DBus
|
Qt::DBus
|
||||||
KF5::Notifications
|
KF${QT_MAJOR_VERSION}::Notifications
|
||||||
KF5::I18n
|
KF${QT_MAJOR_VERSION}::I18n
|
||||||
KF5::WindowSystem
|
KF${QT_MAJOR_VERSION}::WindowSystem
|
||||||
)
|
)
|
||||||
|
|
||||||
if (UNIX AND NOT APPLE AND QT_MAJOR_VERSION EQUAL "5")
|
if (UNIX AND NOT APPLE)
|
||||||
target_link_libraries(kdeconnect_notifications
|
if (QT_MAJOR_VERSION EQUAL "5")
|
||||||
Qt5::X11Extras
|
target_link_libraries(kdeconnect_notifications Qt5::X11Extras)
|
||||||
)
|
else()
|
||||||
|
target_link_libraries(kdeconnect_notifications Qt6::GuiPrivate)
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
|
@ -14,7 +14,11 @@
|
||||||
#include <KStartupInfo>
|
#include <KStartupInfo>
|
||||||
|
|
||||||
#if !defined(Q_OS_WIN) && !defined(Q_OS_MAC)
|
#if !defined(Q_OS_WIN) && !defined(Q_OS_MAC)
|
||||||
|
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||||
#include <QX11Info>
|
#include <QX11Info>
|
||||||
|
#else
|
||||||
|
#include <private/qtx11extras_p.h>
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
K_PLUGIN_CLASS_WITH_JSON(NotificationsPlugin, "kdeconnect_notifications.json")
|
K_PLUGIN_CLASS_WITH_JSON(NotificationsPlugin, "kdeconnect_notifications.json")
|
||||||
|
|
|
@ -26,7 +26,7 @@ target_link_libraries(kdeconnect_pausemusic
|
||||||
)
|
)
|
||||||
if (NOT WIN32)
|
if (NOT WIN32)
|
||||||
target_link_libraries(kdeconnect_pausemusic
|
target_link_libraries(kdeconnect_pausemusic
|
||||||
KF5::PulseAudioQt
|
KF${QT_MAJOR_VERSION}::PulseAudioQt
|
||||||
)
|
)
|
||||||
else()
|
else()
|
||||||
target_link_libraries(kdeconnect_pausemusic
|
target_link_libraries(kdeconnect_pausemusic
|
||||||
|
@ -47,6 +47,6 @@ ki18n_wrap_ui(kdeconnect_pausemusic_config pausemusic_config.ui)
|
||||||
target_link_libraries( kdeconnect_pausemusic_config
|
target_link_libraries( kdeconnect_pausemusic_config
|
||||||
kdeconnectcore
|
kdeconnectcore
|
||||||
kdeconnectpluginkcm
|
kdeconnectpluginkcm
|
||||||
KF5::I18n
|
KF${QT_MAJOR_VERSION}::I18n
|
||||||
KF5::KCMUtils
|
KF${QT_MAJOR_VERSION}::KCMUtils
|
||||||
)
|
)
|
||||||
|
|
|
@ -15,5 +15,5 @@ kdeconnect_add_plugin(kdeconnect_ping SOURCES ${kdeconnect_ping_SRCS})
|
||||||
target_link_libraries(kdeconnect_ping
|
target_link_libraries(kdeconnect_ping
|
||||||
kdeconnectcore
|
kdeconnectcore
|
||||||
Qt${QT_MAJOR_VERSION}::DBus
|
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)
|
set(debug_file_SRCS)
|
||||||
ecm_qt_declare_logging_category(
|
ecm_qt_declare_logging_category(
|
||||||
|
@ -12,5 +12,5 @@ target_link_libraries(kdeconnect_presenter
|
||||||
kdeconnectcore
|
kdeconnectcore
|
||||||
Qt${QT_MAJOR_VERSION}::DBus
|
Qt${QT_MAJOR_VERSION}::DBus
|
||||||
Qt${QT_MAJOR_VERSION}::Quick
|
Qt${QT_MAJOR_VERSION}::Quick
|
||||||
KF5::I18n
|
KF${QT_MAJOR_VERSION}::I18n
|
||||||
)
|
)
|
||||||
|
|
|
@ -34,7 +34,9 @@ public:
|
||||||
windowFlags |= Qt::WindowTransparentForInput;
|
windowFlags |= Qt::WindowTransparentForInput;
|
||||||
#endif
|
#endif
|
||||||
setFlags(windowFlags);
|
setFlags(windowFlags);
|
||||||
|
#if QT_VERSION_MAJOR < 6
|
||||||
setClearBeforeRendering(true);
|
setClearBeforeRendering(true);
|
||||||
|
#endif
|
||||||
setColor(QColor(Qt::transparent));
|
setColor(QColor(Qt::transparent));
|
||||||
|
|
||||||
setResizeMode(QQuickView::SizeViewToRootObject);
|
setResizeMode(QQuickView::SizeViewToRootObject);
|
||||||
|
|
|
@ -10,5 +10,5 @@ kdeconnect_add_plugin(kdeconnect_remotecontrol SOURCES remotecontrolplugin.cpp $
|
||||||
target_link_libraries(kdeconnect_remotecontrol
|
target_link_libraries(kdeconnect_remotecontrol
|
||||||
kdeconnectcore
|
kdeconnectcore
|
||||||
Qt${QT_MAJOR_VERSION}::DBus
|
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
|
target_link_libraries(kdeconnect_remotesystemvolume
|
||||||
kdeconnectcore
|
kdeconnectcore
|
||||||
Qt${QT_MAJOR_VERSION}::DBus
|
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
|
target_link_libraries(kdeconnect_runcommand
|
||||||
kdeconnectcore
|
kdeconnectcore
|
||||||
Qt${QT_MAJOR_VERSION}::DBus
|
Qt${QT_MAJOR_VERSION}::DBus
|
||||||
KF5::KCMUtils
|
KF${QT_MAJOR_VERSION}::KCMUtils
|
||||||
KF5::I18n)
|
KF${QT_MAJOR_VERSION}::I18n)
|
||||||
|
|
||||||
#----------------------
|
#----------------------
|
||||||
if(NOT SAILFISHOS)
|
if(NOT SAILFISHOS)
|
||||||
|
@ -24,9 +24,9 @@ if(NOT SAILFISHOS)
|
||||||
target_link_libraries( kdeconnect_runcommand_config
|
target_link_libraries( kdeconnect_runcommand_config
|
||||||
kdeconnectcore
|
kdeconnectcore
|
||||||
kdeconnectpluginkcm
|
kdeconnectpluginkcm
|
||||||
KF5::I18n
|
KF${QT_MAJOR_VERSION}::I18n
|
||||||
KF5::CoreAddons
|
KF${QT_MAJOR_VERSION}::CoreAddons
|
||||||
KF5::ConfigWidgets
|
KF${QT_MAJOR_VERSION}::ConfigWidgets
|
||||||
|
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
|
@ -7,11 +7,11 @@
|
||||||
#include "runcommand_config.h"
|
#include "runcommand_config.h"
|
||||||
|
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
#include <QFileDialog>
|
||||||
#include <QHBoxLayout>
|
#include <QHBoxLayout>
|
||||||
#include <QHeaderView>
|
#include <QHeaderView>
|
||||||
#include <QJsonDocument>
|
|
||||||
#include <QJsonArray>
|
#include <QJsonArray>
|
||||||
#include <QFileDialog>
|
#include <QJsonDocument>
|
||||||
#include <QMenu>
|
#include <QMenu>
|
||||||
#include <QPushButton>
|
#include <QPushButton>
|
||||||
#include <QStandardItemModel>
|
#include <QStandardItemModel>
|
||||||
|
@ -26,7 +26,7 @@
|
||||||
|
|
||||||
K_PLUGIN_FACTORY(ShareConfigFactory, registerPlugin<RunCommandConfig>();)
|
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"))
|
: KdeConnectPluginKcm(parent, args, QStringLiteral("kdeconnect_runcommand"))
|
||||||
{
|
{
|
||||||
// The qdbus executable name is different on some systems
|
// The qdbus executable name is different on some systems
|
||||||
|
@ -35,7 +35,7 @@ RunCommandConfig::RunCommandConfig(QWidget *parent, const QVariantList &args)
|
||||||
qdbusExe = QStringLiteral("qdbus");
|
qdbusExe = QStringLiteral("qdbus");
|
||||||
}
|
}
|
||||||
|
|
||||||
QMenu *defaultMenu = new QMenu(this);
|
QMenu *defaultMenu = new QMenu(widget());
|
||||||
|
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
addSuggestedCommand(defaultMenu, i18n("Schedule a shutdown"), QStringLiteral("shutdown /s /t 60"));
|
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));
|
QStringLiteral("%0 org.kde.kded5 /modules/plasmavault forceCloseAllVaults").arg(qdbusExe));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
QTableView *table = new QTableView(this);
|
QTableView *table = new QTableView(widget());
|
||||||
table->horizontalHeader()->setStretchLastSection(true);
|
table->horizontalHeader()->setStretchLastSection(true);
|
||||||
table->verticalHeader()->setVisible(false);
|
table->verticalHeader()->setVisible(false);
|
||||||
QVBoxLayout *layout = new QVBoxLayout(this);
|
QPushButton *button = new QPushButton(QIcon::fromTheme(QStringLiteral("list-add")), i18n("Sample commands"), widget());
|
||||||
layout->addWidget(table);
|
|
||||||
QPushButton *button = new QPushButton(QIcon::fromTheme(QStringLiteral("list-add")), i18n("Sample commands"), this);
|
|
||||||
button->setMenu(defaultMenu);
|
button->setMenu(defaultMenu);
|
||||||
layout->addWidget(button);
|
|
||||||
|
|
||||||
QHBoxLayout *importExportLayout = new QHBoxLayout(this);
|
QHBoxLayout *importExportLayout = new QHBoxLayout();
|
||||||
QPushButton *exportButton = new QPushButton(i18n("Export"), this);
|
QPushButton *exportButton = new QPushButton(i18n("Export"), widget());
|
||||||
importExportLayout->addWidget(exportButton);
|
importExportLayout->addWidget(exportButton);
|
||||||
connect(exportButton, &QPushButton::clicked, this, &RunCommandConfig::exportCommands);
|
connect(exportButton, &QPushButton::clicked, this, &RunCommandConfig::exportCommands);
|
||||||
QPushButton *importButton = new QPushButton(i18n("Import"), this);
|
QPushButton *importButton = new QPushButton(i18n("Import"), widget());
|
||||||
importExportLayout->addWidget(importButton);
|
importExportLayout->addWidget(importButton);
|
||||||
connect(importButton, &QPushButton::clicked, this, &RunCommandConfig::importCommands);
|
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);
|
m_entriesModel = new QStandardItemModel(this);
|
||||||
table->setModel(m_entriesModel);
|
table->setModel(m_entriesModel);
|
||||||
|
@ -99,7 +99,7 @@ RunCommandConfig::~RunCommandConfig()
|
||||||
|
|
||||||
void RunCommandConfig::exportCommands()
|
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())
|
if (filePath.isEmpty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -124,7 +124,7 @@ void RunCommandConfig::exportCommands()
|
||||||
|
|
||||||
void RunCommandConfig::importCommands()
|
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())
|
if (filePath.isEmpty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -155,7 +155,7 @@ void RunCommandConfig::importCommands()
|
||||||
insertRow(m_entriesModel->rowCount(), name, command);
|
insertRow(m_entriesModel->rowCount(), name, command);
|
||||||
}
|
}
|
||||||
|
|
||||||
Q_EMIT changed(true);
|
markAsChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
void RunCommandConfig::addSuggestedCommand(QMenu *menu, const QString &name, const QString &command)
|
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);
|
auto action = new QAction(name);
|
||||||
connect(action, &QAction::triggered, action, [this, name, command]() {
|
connect(action, &QAction::triggered, action, [this, name, command]() {
|
||||||
insertRow(0, name, command);
|
insertRow(0, name, command);
|
||||||
Q_EMIT changed(true);
|
markAsChanged();
|
||||||
});
|
});
|
||||||
menu->addAction(action);
|
menu->addAction(action);
|
||||||
}
|
}
|
||||||
|
@ -173,7 +173,7 @@ void RunCommandConfig::defaults()
|
||||||
KCModule::defaults();
|
KCModule::defaults();
|
||||||
m_entriesModel->removeRows(0, m_entriesModel->rowCount());
|
m_entriesModel->removeRows(0, m_entriesModel->rowCount());
|
||||||
|
|
||||||
Q_EMIT changed(true);
|
markAsChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
void RunCommandConfig::load()
|
void RunCommandConfig::load()
|
||||||
|
@ -201,12 +201,11 @@ void RunCommandConfig::load()
|
||||||
|
|
||||||
insertEmptyRow();
|
insertEmptyRow();
|
||||||
connect(m_entriesModel, &QAbstractItemModel::dataChanged, this, &RunCommandConfig::onDataChanged);
|
connect(m_entriesModel, &QAbstractItemModel::dataChanged, this, &RunCommandConfig::onDataChanged);
|
||||||
|
|
||||||
Q_EMIT changed(false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void RunCommandConfig::save()
|
void RunCommandConfig::save()
|
||||||
{
|
{
|
||||||
|
KCModule::save();
|
||||||
QJsonObject jsonConfig;
|
QJsonObject jsonConfig;
|
||||||
for (int i = 0; i < m_entriesModel->rowCount(); i++) {
|
for (int i = 0; i < m_entriesModel->rowCount(); i++) {
|
||||||
QString key = m_entriesModel->item(i, 0)->data().toString();
|
QString key = m_entriesModel->item(i, 0)->data().toString();
|
||||||
|
@ -229,10 +228,6 @@ void RunCommandConfig::save()
|
||||||
QJsonDocument document;
|
QJsonDocument document;
|
||||||
document.setObject(jsonConfig);
|
document.setObject(jsonConfig);
|
||||||
config()->set(QStringLiteral("commands"), document.toJson(QJsonDocument::Compact));
|
config()->set(QStringLiteral("commands"), document.toJson(QJsonDocument::Compact));
|
||||||
|
|
||||||
KCModule::save();
|
|
||||||
|
|
||||||
Q_EMIT changed(false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void RunCommandConfig::insertEmptyRow()
|
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)
|
void RunCommandConfig::onDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight)
|
||||||
{
|
{
|
||||||
Q_EMIT changed(true);
|
markAsChanged();
|
||||||
Q_UNUSED(topLeft);
|
Q_UNUSED(topLeft);
|
||||||
if (bottomRight.row() == m_entriesModel->rowCount() - 1) {
|
if (bottomRight.row() == m_entriesModel->rowCount() - 1) {
|
||||||
// TODO check both entries are still empty
|
// TODO check both entries are still empty
|
||||||
|
|
|
@ -16,7 +16,7 @@ class RunCommandConfig : public KdeConnectPluginKcm
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
RunCommandConfig(QWidget *parent, const QVariantList &);
|
RunCommandConfig(QObject *parent, const QVariantList &);
|
||||||
~RunCommandConfig() override;
|
~RunCommandConfig() override;
|
||||||
|
|
||||||
public Q_SLOTS:
|
public Q_SLOTS:
|
||||||
|
|
|
@ -26,7 +26,7 @@ target_link_libraries(kdeconnect_screensaver_inhibit kdeconnectcore)
|
||||||
if(NOT APPLE AND NOT WIN32)
|
if(NOT APPLE AND NOT WIN32)
|
||||||
target_link_libraries(kdeconnect_screensaver_inhibit
|
target_link_libraries(kdeconnect_screensaver_inhibit
|
||||||
Qt::DBus
|
Qt::DBus
|
||||||
KF5::I18n
|
KF${QT_MAJOR_VERSION}::I18n
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
|
@ -26,10 +26,10 @@ kdeconnect_add_plugin(kdeconnect_sendnotifications SOURCES ${kdeconnect_sendnoti
|
||||||
target_link_libraries(kdeconnect_sendnotifications
|
target_link_libraries(kdeconnect_sendnotifications
|
||||||
kdeconnectcore
|
kdeconnectcore
|
||||||
Qt::DBus
|
Qt::DBus
|
||||||
KF5::I18n
|
KF${QT_MAJOR_VERSION}::I18n
|
||||||
Qt::Gui
|
Qt::Gui
|
||||||
KF5::IconThemes
|
KF${QT_MAJOR_VERSION}::IconThemes
|
||||||
KF5::ConfigCore
|
KF${QT_MAJOR_VERSION}::ConfigCore
|
||||||
PkgConfig::GIO
|
PkgConfig::GIO
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -49,7 +49,7 @@ target_sources(kdeconnect_sendnotifications_config PRIVATE
|
||||||
target_link_libraries( kdeconnect_sendnotifications_config
|
target_link_libraries( kdeconnect_sendnotifications_config
|
||||||
kdeconnectcore
|
kdeconnectcore
|
||||||
kdeconnectpluginkcm
|
kdeconnectpluginkcm
|
||||||
KF5::I18n
|
KF${QT_MAJOR_VERSION}::I18n
|
||||||
KF5::KCMUtils
|
KF${QT_MAJOR_VERSION}::KCMUtils
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
|
@ -35,7 +35,9 @@ NotificationsListener::NotificationsListener(KdeConnectPlugin *aPlugin)
|
||||||
: QObject(aPlugin)
|
: QObject(aPlugin)
|
||||||
, m_plugin(aPlugin)
|
, m_plugin(aPlugin)
|
||||||
{
|
{
|
||||||
|
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||||
qRegisterMetaTypeStreamOperators<NotifyingApplication>("NotifyingApplication");
|
qRegisterMetaTypeStreamOperators<NotifyingApplication>("NotifyingApplication");
|
||||||
|
#endif
|
||||||
|
|
||||||
GError *error = nullptr;
|
GError *error = nullptr;
|
||||||
m_gdbusConnection = g_bus_get_sync(G_BUS_TYPE_SESSION, nullptr, &error);
|
m_gdbusConnection = g_bus_get_sync(G_BUS_TYPE_SESSION, nullptr, &error);
|
||||||
|
|
|
@ -13,14 +13,16 @@
|
||||||
|
|
||||||
K_PLUGIN_FACTORY(SendNotificationsConfigFactory, registerPlugin<SendNotificationsConfig>();)
|
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"))
|
: KdeConnectPluginKcm(parent, args, QStringLiteral("kdeconnect_sendnotifications"))
|
||||||
, m_ui(new Ui::SendNotificationsConfigUi())
|
, m_ui(new Ui::SendNotificationsConfigUi())
|
||||||
, appModel(new NotifyingApplicationModel)
|
, appModel(new NotifyingApplicationModel)
|
||||||
{
|
{
|
||||||
|
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||||
qRegisterMetaTypeStreamOperators<NotifyingApplication>("NotifyingApplication");
|
qRegisterMetaTypeStreamOperators<NotifyingApplication>("NotifyingApplication");
|
||||||
|
#endif
|
||||||
|
|
||||||
m_ui->setupUi(this);
|
m_ui->setupUi(widget());
|
||||||
m_ui->appList->setIconSize(QSize(32, 32));
|
m_ui->appList->setIconSize(QSize(32, 32));
|
||||||
|
|
||||||
m_ui->appList->setModel(appModel);
|
m_ui->appList->setModel(appModel);
|
||||||
|
@ -55,7 +57,7 @@ void SendNotificationsConfig::defaults()
|
||||||
m_ui->spin_urgency->setValue(0);
|
m_ui->spin_urgency->setValue(0);
|
||||||
m_ui->check_body->setChecked(true);
|
m_ui->check_body->setChecked(true);
|
||||||
m_ui->check_icons->setChecked(true);
|
m_ui->check_icons->setChecked(true);
|
||||||
Q_EMIT changed(true);
|
markAsChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
void SendNotificationsConfig::loadApplications()
|
void SendNotificationsConfig::loadApplications()
|
||||||
|
@ -83,11 +85,11 @@ void SendNotificationsConfig::load()
|
||||||
m_ui->spin_urgency->setValue(urgency);
|
m_ui->spin_urgency->setValue(urgency);
|
||||||
|
|
||||||
loadApplications();
|
loadApplications();
|
||||||
Q_EMIT changed(false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SendNotificationsConfig::save()
|
void SendNotificationsConfig::save()
|
||||||
{
|
{
|
||||||
|
KCModule::save();
|
||||||
config()->set(QStringLiteral("generalPersistent"), m_ui->check_persistent->isChecked());
|
config()->set(QStringLiteral("generalPersistent"), m_ui->check_persistent->isChecked());
|
||||||
config()->set(QStringLiteral("generalIncludeBody"), m_ui->check_body->isChecked());
|
config()->set(QStringLiteral("generalIncludeBody"), m_ui->check_body->isChecked());
|
||||||
config()->set(QStringLiteral("generalSynchronizeIcons"), m_ui->check_icons->isChecked());
|
config()->set(QStringLiteral("generalSynchronizeIcons"), m_ui->check_icons->isChecked());
|
||||||
|
@ -100,8 +102,6 @@ void SendNotificationsConfig::save()
|
||||||
list.append(QVariant::fromValue<NotifyingApplication>(a));
|
list.append(QVariant::fromValue<NotifyingApplication>(a));
|
||||||
}
|
}
|
||||||
config()->setList(QStringLiteral("applications"), list);
|
config()->setList(QStringLiteral("applications"), list);
|
||||||
KCModule::save();
|
|
||||||
Q_EMIT changed(false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#include "sendnotifications_config.moc"
|
#include "sendnotifications_config.moc"
|
||||||
|
|
|
@ -20,7 +20,7 @@ class SendNotificationsConfig : public KdeConnectPluginKcm
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
SendNotificationsConfig(QWidget *parent, const QVariantList &);
|
SendNotificationsConfig(QObject *parent, const QVariantList &);
|
||||||
~SendNotificationsConfig() override;
|
~SendNotificationsConfig() override;
|
||||||
|
|
||||||
public Q_SLOTS:
|
public Q_SLOTS:
|
||||||
|
|
|
@ -26,8 +26,8 @@ kdeconnect_add_plugin(kdeconnect_sftp SOURCES ${kdeconnect_sftp_SRCS} ${debug_fi
|
||||||
target_link_libraries(kdeconnect_sftp
|
target_link_libraries(kdeconnect_sftp
|
||||||
kdeconnectcore
|
kdeconnectcore
|
||||||
Qt::DBus
|
Qt::DBus
|
||||||
KF5::I18n
|
KF${QT_MAJOR_VERSION}::I18n
|
||||||
KF5::KIOFileWidgets
|
KF${QT_MAJOR_VERSION}::KIOFileWidgets
|
||||||
KF5::KIOWidgets
|
KF${QT_MAJOR_VERSION}::KIOWidgets
|
||||||
KF5::Notifications
|
KF${QT_MAJOR_VERSION}::Notifications
|
||||||
)
|
)
|
||||||
|
|
|
@ -124,7 +124,13 @@ bool SftpPlugin::startBrowsing()
|
||||||
|
|
||||||
bool SftpPlugin::receivePacket(const NetworkPacket &np)
|
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
|
// packet is invalid
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,11 +15,11 @@ kdeconnect_add_plugin(kdeconnect_share SOURCES ${kdeconnect_share_SRCS})
|
||||||
target_link_libraries(kdeconnect_share
|
target_link_libraries(kdeconnect_share
|
||||||
kdeconnectcore
|
kdeconnectcore
|
||||||
Qt::DBus
|
Qt::DBus
|
||||||
KF5::Notifications
|
KF${QT_MAJOR_VERSION}::Notifications
|
||||||
KF5::I18n
|
KF${QT_MAJOR_VERSION}::I18n
|
||||||
KF5::GuiAddons
|
KF${QT_MAJOR_VERSION}::GuiAddons
|
||||||
KF5::KIOWidgets
|
KF${QT_MAJOR_VERSION}::KIOWidgets
|
||||||
KF5::Service
|
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)
|
ki18n_wrap_ui(kdeconnect_share_config share_config.ui)
|
||||||
target_link_libraries( kdeconnect_share_config
|
target_link_libraries( kdeconnect_share_config
|
||||||
kdeconnectpluginkcm
|
kdeconnectpluginkcm
|
||||||
KF5::I18n
|
KF${QT_MAJOR_VERSION}::I18n
|
||||||
KF5::CoreAddons
|
KF${QT_MAJOR_VERSION}::CoreAddons
|
||||||
KF5::ConfigWidgets
|
KF${QT_MAJOR_VERSION}::ConfigWidgets
|
||||||
KF5::KIOWidgets
|
KF${QT_MAJOR_VERSION}::KIOWidgets
|
||||||
KF5::Notifications
|
KF${QT_MAJOR_VERSION}::Notifications
|
||||||
)
|
)
|
||||||
|
|
|
@ -14,11 +14,11 @@
|
||||||
|
|
||||||
K_PLUGIN_FACTORY(ShareConfigFactory, registerPlugin<ShareConfig>();)
|
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"))
|
: KdeConnectPluginKcm(parent, args, QStringLiteral("kdeconnect_share"))
|
||||||
, m_ui(new Ui::ShareConfigUi())
|
, m_ui(new Ui::ShareConfigUi())
|
||||||
{
|
{
|
||||||
m_ui->setupUi(this);
|
m_ui->setupUi(widget());
|
||||||
// xgettext:no-c-format
|
// xgettext:no-c-format
|
||||||
m_ui->commentLabel->setTextFormat(Qt::RichText);
|
m_ui->commentLabel->setTextFormat(Qt::RichText);
|
||||||
m_ui->commentLabel->setText(i18n("%1 in the path will be replaced with the specific device name."));
|
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));
|
m_ui->kurlrequester->setText(QStandardPaths::writableLocation(QStandardPaths::DownloadLocation));
|
||||||
|
|
||||||
Q_EMIT changed(true);
|
markAsChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ShareConfig::load()
|
void ShareConfig::load()
|
||||||
|
@ -46,17 +46,12 @@ void ShareConfig::load()
|
||||||
|
|
||||||
const auto standardPath = QStandardPaths::writableLocation(QStandardPaths::DownloadLocation);
|
const auto standardPath = QStandardPaths::writableLocation(QStandardPaths::DownloadLocation);
|
||||||
m_ui->kurlrequester->setText(config()->getString(QStringLiteral("incoming_path"), standardPath));
|
m_ui->kurlrequester->setText(config()->getString(QStringLiteral("incoming_path"), standardPath));
|
||||||
|
|
||||||
Q_EMIT changed(false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ShareConfig::save()
|
void ShareConfig::save()
|
||||||
{
|
{
|
||||||
config()->set(QStringLiteral("incoming_path"), m_ui->kurlrequester->text());
|
|
||||||
|
|
||||||
KCModule::save();
|
KCModule::save();
|
||||||
|
config()->set(QStringLiteral("incoming_path"), m_ui->kurlrequester->text());
|
||||||
Q_EMIT changed(false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#include "share_config.moc"
|
#include "share_config.moc"
|
||||||
|
|
|
@ -18,7 +18,7 @@ class ShareConfig : public KdeConnectPluginKcm
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
ShareConfig(QWidget *parent, const QVariantList &);
|
ShareConfig(QObject *parent, const QVariantList &);
|
||||||
~ShareConfig() override;
|
~ShareConfig() override;
|
||||||
|
|
||||||
public Q_SLOTS:
|
public Q_SLOTS:
|
||||||
|
|
|
@ -24,7 +24,12 @@ target_link_libraries(kdeconnect_sms
|
||||||
kdeconnectcore
|
kdeconnectcore
|
||||||
kdeconnectinterfaces
|
kdeconnectinterfaces
|
||||||
Qt::DBus
|
Qt::DBus
|
||||||
KF5::I18n
|
KF${QT_MAJOR_VERSION}::I18n
|
||||||
KF5::Notifications
|
KF${QT_MAJOR_VERSION}::Notifications
|
||||||
Qt::Widgets
|
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
|
target_link_libraries(kdeconnect_systemvolume
|
||||||
kdeconnectcore
|
kdeconnectcore
|
||||||
Qt::Core
|
Qt::Core
|
||||||
KF5::PulseAudioQt
|
KF${QT_MAJOR_VERSION}::PulseAudioQt
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
|
@ -14,7 +14,7 @@ kdeconnect_add_plugin(kdeconnect_telephony SOURCES ${kdeconnect_telephony_SRCS})
|
||||||
|
|
||||||
target_link_libraries(kdeconnect_telephony
|
target_link_libraries(kdeconnect_telephony
|
||||||
kdeconnectcore
|
kdeconnectcore
|
||||||
KF5::I18n
|
KF${QT_MAJOR_VERSION}::I18n
|
||||||
KF5::Notifications
|
KF${QT_MAJOR_VERSION}::Notifications
|
||||||
Qt::DBus
|
Qt::DBus
|
||||||
)
|
)
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
#include <QJsonArray>
|
#include <QJsonArray>
|
||||||
#include <QProcess>
|
#include <QProcess>
|
||||||
#include <QScreen>
|
#include <QScreen>
|
||||||
|
#include <QStandardPaths>
|
||||||
|
|
||||||
K_PLUGIN_CLASS_WITH_JSON(VirtualMonitorPlugin, "kdeconnect_virtualmonitor.json")
|
K_PLUGIN_CLASS_WITH_JSON(VirtualMonitorPlugin, "kdeconnect_virtualmonitor.json")
|
||||||
#define QS QLatin1String
|
#define QS QLatin1String
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
add_definitions(-DTRANSLATION_DOMAIN="kdeconnect-settings")
|
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
|
add_executable(kdeconnect-settings
|
||||||
main.cpp
|
main.cpp
|
||||||
${kdeconnect_custom_icons_SRCS}
|
${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(TARGETS kdeconnect-settings ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
|
||||||
install(FILES org.kde.kdeconnect-settings.desktop DESTINATION ${KDE_INSTALL_APPDIR})
|
install(FILES org.kde.kdeconnect-settings.desktop DESTINATION ${KDE_INSTALL_APPDIR})
|
||||||
|
|
|
@ -30,12 +30,12 @@ target_link_libraries(kdeconnectsmshelper
|
||||||
PUBLIC
|
PUBLIC
|
||||||
Qt::Core
|
Qt::Core
|
||||||
Qt::DBus
|
Qt::DBus
|
||||||
KF5::People
|
KF${QT_MAJOR_VERSION}::People
|
||||||
Qt::Qml
|
Qt::Qml
|
||||||
kdeconnectinterfaces
|
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
|
add_executable(kdeconnect-sms
|
||||||
main.cpp
|
main.cpp
|
||||||
|
@ -55,11 +55,11 @@ target_link_libraries(kdeconnect-sms
|
||||||
Qt::Quick
|
Qt::Quick
|
||||||
Qt::QuickControls2
|
Qt::QuickControls2
|
||||||
Qt::Widgets
|
Qt::Widgets
|
||||||
KF5::CoreAddons
|
KF${QT_MAJOR_VERSION}::CoreAddons
|
||||||
KF5::DBusAddons
|
KF${QT_MAJOR_VERSION}::DBusAddons
|
||||||
KF5::I18n
|
KF${QT_MAJOR_VERSION}::I18n
|
||||||
KF5::People
|
KF${QT_MAJOR_VERSION}::People
|
||||||
KF5::KCMUtils
|
KF${QT_MAJOR_VERSION}::KCMUtils
|
||||||
)
|
)
|
||||||
|
|
||||||
install(TARGETS kdeconnect-sms ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
|
install(TARGETS kdeconnect-sms ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
|
||||||
|
|
|
@ -50,7 +50,7 @@ bool ConversationsSortFilterProxyModel::filterAcceptsRow(int sourceRow, const QM
|
||||||
if (filterRole() == ConversationListModel::ConversationIdRole) {
|
if (filterRole() == ConversationListModel::ConversationIdRole) {
|
||||||
return sourceModel()->data(index, ConversationListModel::ConversationIdRole) != INVALID_THREAD_ID;
|
return sourceModel()->data(index, ConversationListModel::ConversationIdRole) != INVALID_THREAD_ID;
|
||||||
} else {
|
} else {
|
||||||
if (sourceModel()->data(index, Qt::DisplayRole).toString().contains(filterRegExp())) {
|
if (sourceModel()->data(index, Qt::DisplayRole).toString().contains(filterRegularExpression())) {
|
||||||
return true;
|
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>>();
|
const QList<ConversationAddress> addressList = sourceModel()->data(index, ConversationListModel::AddressesRole).value<QList<ConversationAddress>>();
|
||||||
for (const ConversationAddress &address : addressList) {
|
for (const ConversationAddress &address : addressList) {
|
||||||
QString canonicalAddress = SmsHelper::canonicalizePhoneNumber(address.address());
|
QString canonicalAddress = SmsHelper::canonicalizePhoneNumber(address.address());
|
||||||
|
#if QT_VERSION_MAJOR < 6
|
||||||
if (canonicalAddress.contains(filterRegExp())) {
|
if (canonicalAddress.contains(filterRegExp())) {
|
||||||
|
#else
|
||||||
|
if (canonicalAddress.contains(filterRegularExpression())) {
|
||||||
|
#endif
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,14 +3,14 @@ find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} REQUIRED COMPONENTS Test)
|
||||||
set(kdeconnect_libraries
|
set(kdeconnect_libraries
|
||||||
kdeconnectcore
|
kdeconnectcore
|
||||||
kdeconnectversion
|
kdeconnectversion
|
||||||
KF5::I18n
|
KF${QT_MAJOR_VERSION}::I18n
|
||||||
Qt::DBus
|
Qt::DBus
|
||||||
Qt::Network
|
Qt::Network
|
||||||
Qt::Test
|
Qt::Test
|
||||||
)
|
)
|
||||||
|
|
||||||
if(${KF5KIO_FOUND})
|
if(KF5KIO_FOUND OR KF6KIO_FOUND)
|
||||||
list(APPEND kdeconnect_libraries KF5::KIOWidgets)
|
list(APPEND kdeconnect_libraries KF${QT_MAJOR_VERSION}::KIOWidgets)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
ecm_add_test(pluginloadtest.cpp LINK_LIBRARIES ${kdeconnect_libraries})
|
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)
|
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})
|
add_executable(kdeconnect-handler kdeconnect-handler.cpp ${telhandler_SRCS} ${kdeconnect_custom_icons_SRCS})
|
||||||
|
|
||||||
|
@ -12,10 +12,11 @@ target_link_libraries(kdeconnect-handler
|
||||||
kdeconnectcore
|
kdeconnectcore
|
||||||
kdeconnectversion
|
kdeconnectversion
|
||||||
Qt::Widgets
|
Qt::Widgets
|
||||||
KF5::CoreAddons
|
KF${QT_MAJOR_VERSION}::CoreAddons
|
||||||
KF5::DBusAddons
|
KF${QT_MAJOR_VERSION}::ConfigWidgets
|
||||||
KF5::I18n
|
KF${QT_MAJOR_VERSION}::DBusAddons
|
||||||
KF5::KIOCore KF5::KIOFileWidgets KF5::KIOWidgets
|
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})
|
install(TARGETS kdeconnect-handler ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
|
||||||
|
|
Loading…
Reference in a new issue