From 43e6fed43d0279d7b52d7cfdca3ec29b67c2e11f Mon Sep 17 00:00:00 2001 From: Bart Ribbers Date: Sat, 9 Jun 2018 22:35:51 +0200 Subject: [PATCH 1/3] Fix build failure on musl based systems Summary: Musl lacks backtrace support, so this patch fixes the build by making sure it only gets compiled when using a glibc system. Bug: 395161 Reviewers: #kde_connect Subscribers: kdeconnect Tags: #kde_connect Differential Revision: https://phabricator.kde.org/D13446 --- core/core_debug.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/core_debug.cpp b/core/core_debug.cpp index 8d1fd92fb..4afe7d081 100644 --- a/core/core_debug.cpp +++ b/core/core_debug.cpp @@ -22,7 +22,7 @@ Q_LOGGING_CATEGORY(KDECONNECT_CORE, "kdeconnect.core") -#ifdef Q_OS_LINUX +#if defined(__GNU_LIBRARY__) #include #include #include @@ -30,7 +30,7 @@ Q_LOGGING_CATEGORY(KDECONNECT_CORE, "kdeconnect.core") void logBacktrace() { -#ifdef Q_OS_LINUX +#if defined(__GNU_LIBRARY__) void* array[32]; size_t size = backtrace (array, 32); char** strings = backtrace_symbols (array, size); From 8388ed0603f0d04d7adde2152b077dbd29275ee3 Mon Sep 17 00:00:00 2001 From: Erik Duisters Date: Tue, 6 Nov 2018 14:19:44 +0100 Subject: [PATCH 2/3] A QApplication object needs to be instantiated for kio-kdeconnect to work on KDE Neon Summary: kio-kdeconnect fails to start on KDE Neon because it does not instantiate a QApplication object BUG: 400178 Test Plan: Install on a KDE Neon 5.14 system or VM Pair an android phone Browse the phone's filesystem using dolphin Reviewers: #kde_connect, #frameworks, albertvaka Reviewed By: #kde_connect, albertvaka Subscribers: sredman, apol, jriddell, nicolasfella, albertvaka, kdeconnect Tags: #kde_connect Differential Revision: https://phabricator.kde.org/D16692 --- kio/CMakeLists.txt | 5 +++-- kio/kdeconnect.json | 26 ++++++++++++++++++++++++++ kio/kdeconnect.protocol | 16 ---------------- kio/kiokdeconnect.cpp | 12 ++++++++++++ 4 files changed, 41 insertions(+), 18 deletions(-) create mode 100644 kio/kdeconnect.json delete mode 100644 kio/kdeconnect.protocol diff --git a/kio/CMakeLists.txt b/kio/CMakeLists.txt index 024140262..b381eaec1 100644 --- a/kio/CMakeLists.txt +++ b/kio/CMakeLists.txt @@ -17,5 +17,6 @@ target_link_libraries(kio_kdeconnect ) ########### install files ############### -install(TARGETS kio_kdeconnect DESTINATION ${PLUGIN_INSTALL_DIR}) -install(FILES kdeconnect.protocol DESTINATION ${SERVICES_INSTALL_DIR}) +set_target_properties(kio_kdeconnect PROPERTIES OUTPUT_NAME "kdeconnect") +set_target_properties(kio_kdeconnect PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin/kf5/kio") +install(TARGETS kio_kdeconnect DESTINATION ${KDE_INSTALL_PLUGINDIR}/kf5/kio) diff --git a/kio/kdeconnect.json b/kio/kdeconnect.json new file mode 100644 index 000000000..d37269e03 --- /dev/null +++ b/kio/kdeconnect.json @@ -0,0 +1,26 @@ +{ + "KDE-KIO-Protocols": { + "kdeconnect": { + "Class": ":internet", + "Icon": "kdeconnect", + "copyFromFile": false, + "copyToFile": false, + "deleting": false, + "exec": "kdeconnect", + "input": "none", + "listing": [ + "Name", + "Type", + "Access", + "" + ], + "makedir": false, + "maxInstances": 2, + "moving": false, + "output": "filesystem", + "protocol": "kdeconnect", + "reading": true, + "writing": false + } + } +} diff --git a/kio/kdeconnect.protocol b/kio/kdeconnect.protocol deleted file mode 100644 index 73708447e..000000000 --- a/kio/kdeconnect.protocol +++ /dev/null @@ -1,16 +0,0 @@ -[Protocol] -exec=kio_kdeconnect -protocol=kdeconnect -input=none -output=filesystem -copyToFile=false -copyFromFile=false -listing=Name,Type,Access -reading=true -writing=false -makedir=false -deleting=false -moving=false -Icon=kdeconnect -maxInstances=2 - diff --git a/kio/kiokdeconnect.cpp b/kio/kiokdeconnect.cpp index 02243d09a..93b086e8c 100644 --- a/kio/kiokdeconnect.cpp +++ b/kio/kiokdeconnect.cpp @@ -27,11 +27,21 @@ #include #include +#include Q_LOGGING_CATEGORY(KDECONNECT_KIO, "kdeconnect.kio") +class KIOPluginForMetaData : public QObject +{ + Q_OBJECT + Q_PLUGIN_METADATA(IID "org.kde.kio.slave.kdeconnect" FILE "kdeconnect.json") +}; + extern "C" int Q_DECL_EXPORT kdemain(int argc, char** argv) { + QCoreApplication app(argc, argv); + app.setApplicationName(QStringLiteral("kio_kdeconnect")); + if (argc != 4) { fprintf(stderr, "Usage: kio_kdeconnect protocol pool app\n"); exit(-1); @@ -232,3 +242,5 @@ void KioKdeconnect::setHost(const QString& hostName, quint16 port, const QString } +//needed for JSON file embedding +#include "kiokdeconnect.moc" From 14e6ed8d607b2088177cc1679f11ebd7f53da55d Mon Sep 17 00:00:00 2001 From: Albert Vaca Date: Tue, 6 Nov 2018 14:29:07 +0100 Subject: [PATCH 3/3] Bump patch version to release --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 180d2c423..0c759d11d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,7 +4,7 @@ project(kdeconnect) set(KDECONNECT_VERSION_MAJOR 1) set(KDECONNECT_VERSION_MINOR 3) -set(KDECONNECT_VERSION_PATCH 2) +set(KDECONNECT_VERSION_PATCH 3) set(KDECONNECT_VERSION "${KDECONNECT_VERSION_MAJOR}.${KDECONNECT_VERSION_MINOR}.${KDECONNECT_VERSION_PATCH}") set(QT_MIN_VERSION "5.7.0")