[Pkg-owncloud-commits] [owncloud-client] 93/484: Dolphin shell extention: adapt to the change in KDE Frameworks

Sandro Knauß hefee-guest at moszumanska.debian.org
Wed Dec 16 00:37:19 UTC 2015


This is an automated email from the git hooks/post-receive script.

hefee-guest pushed a commit to branch master
in repository owncloud-client.

commit 731d4b3d4dc95868f4916978faa62d8448ea4952
Author: Olivier Goffart <ogoffart at woboq.com>
Date:   Mon Oct 19 08:57:25 2015 +0200

    Dolphin shell extention: adapt to the change in KDE Frameworks
---
 shell_integration/dolphin_kf5/CMakeLists.txt             | 10 ++++------
 shell_integration/dolphin_kf5/ownclouddolphinplugin.cpp  | 14 +++++---------
 shell_integration/dolphin_kf5/ownclouddolphinplugin.json |  8 ++++++++
 3 files changed, 17 insertions(+), 15 deletions(-)

diff --git a/shell_integration/dolphin_kf5/CMakeLists.txt b/shell_integration/dolphin_kf5/CMakeLists.txt
index b896d4d..0a22cbe 100644
--- a/shell_integration/dolphin_kf5/CMakeLists.txt
+++ b/shell_integration/dolphin_kf5/CMakeLists.txt
@@ -13,7 +13,8 @@ set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR} "${CMAKE_CURRENT_
 
 find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS CoreAddons KIO)
 
-find_package(DolphinVcs REQUIRED)
+
+
 set_package_properties(DolphinVcs PROPERTIES
     DESCRIPTION "the Dolphin plugin library"
     URL "http://dolphin.kde.org/"
@@ -31,11 +32,8 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR})
 
 add_definitions(-DQT_USE_FAST_CONCATENATION -DQT_USE_FAST_OPERATOR_PLUS)
 
-add_library(ownclouddolphinplugin MODULE ownclouddolphinplugin.cpp)
-target_link_libraries(ownclouddolphinplugin DolphinVcs Qt5::Network KF5::CoreAddons KF5::KIOCore)
-install(FILES ownclouddolphinplugin.desktop DESTINATION ${KDE_INSTALL_KSERVICES5DIR})
-install(TARGETS ownclouddolphinplugin DESTINATION ${KDE_INSTALL_PLUGINDIR})
-
+kcoreaddons_add_plugin(ownclouddolphinplugin INSTALL_NAMESPACE "kf5/overlayicon" JSON ownclouddolphinplugin.json SOURCES ownclouddolphinplugin.cpp)
+target_link_libraries(ownclouddolphinplugin Qt5::Network KF5::CoreAddons KF5::KIOCore KF5::KIOWidgets)
 
 add_library(ownclouddolphinpluginaction MODULE ownclouddolphinpluginaction.cpp)
 target_link_libraries(ownclouddolphinpluginaction Qt5::Network KF5::CoreAddons KF5::KIOCore KF5::KIOWidgets)
diff --git a/shell_integration/dolphin_kf5/ownclouddolphinplugin.cpp b/shell_integration/dolphin_kf5/ownclouddolphinplugin.cpp
index c542e7b..c039bd4 100644
--- a/shell_integration/dolphin_kf5/ownclouddolphinplugin.cpp
+++ b/shell_integration/dolphin_kf5/ownclouddolphinplugin.cpp
@@ -17,30 +17,29 @@
  *   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA               *
  ******************************************************************************/
 
-#include <Dolphin/KOverlayIconPlugin>
+#include <KOverlayIconPlugin>
 #include <KPluginFactory>
-#include <KPluginLoader>
 #include <QtNetwork/QLocalSocket>
 #include <KIOCore/kfileitem.h>
 
 
-
 class OwncloudDolphinPlugin : public KOverlayIconPlugin
 {
+    Q_PLUGIN_METADATA(IID "com.owncloud.ovarlayiconplugin" FILE "ownclouddolphinplugin.json");
     Q_OBJECT
+
     QLocalSocket m_socket;
     typedef QHash<QByteArray, QByteArray> StatusMap;
     StatusMap m_status;
     QByteArray m_line;
 
 public:
-    explicit OwncloudDolphinPlugin(QObject* parent, const QList<QVariant>&) : KOverlayIconPlugin(parent) {
+    explicit OwncloudDolphinPlugin(QObject* parent = 0) : KOverlayIconPlugin(parent) {
         connect(&m_socket, SIGNAL(readyRead()), this, SLOT(readyRead()));
         tryConnect();
     }
 
-    virtual QStringList getOverlays(const KFileItem& item) {
-        auto url = item.url();
+    virtual QStringList getOverlays(const QUrl& url) override {
         if (!url.isLocalFile())
             return QStringList();
         const QByteArray localFile = url.toLocalFile().toUtf8();
@@ -122,7 +121,4 @@ private slots:
     }
 };
 
-K_PLUGIN_FACTORY(OwncloudDolphinPluginFactory, registerPlugin<OwncloudDolphinPlugin>();)
-K_EXPORT_PLUGIN(OwncloudDolphinPluginFactory("ownclouddolhpinplugin"))
-
 #include "ownclouddolphinplugin.moc"
diff --git a/shell_integration/dolphin_kf5/ownclouddolphinplugin.json b/shell_integration/dolphin_kf5/ownclouddolphinplugin.json
new file mode 100644
index 0000000..a0e25f8
--- /dev/null
+++ b/shell_integration/dolphin_kf5/ownclouddolphinplugin.json
@@ -0,0 +1,8 @@
+{
+    "KPlugin": {
+        "Description": "Overlay icon for owncloud",
+        "ServiceTypes": [
+            "KOverlayIconPlugin"
+        ]
+    }
+}
\ No newline at end of file

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git



More information about the Pkg-owncloud-commits mailing list