[Pkg-owncloud-commits] [owncloud-client] 28/484: Dolphin shell integration: Make it work with dolphin master

Sandro Knauß hefee-guest at moszumanska.debian.org
Wed Dec 16 00:37:07 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 a159dfc7ec812dd7268fca8106deb1a9202ce47c
Author: Olivier Goffart <ogoffart at woboq.com>
Date:   Mon Sep 7 20:59:30 2015 +0200

    Dolphin shell integration:  Make it work with dolphin master
---
 .../dolphin_kf5/0001-KOverlayIconPlugin.patch      | 166 ++++++++++-----------
 shell_integration/dolphin_kf5/CMakeLists.txt       |  33 ++--
 .../dolphin_kf5/ownclouddolphinplugin.cpp          |  12 +-
 3 files changed, 102 insertions(+), 109 deletions(-)

diff --git a/shell_integration/dolphin_kf5/0001-KOverlayIconPlugin.patch b/shell_integration/dolphin_kf5/0001-KOverlayIconPlugin.patch
index 1230714..96a2f5d 100644
--- a/shell_integration/dolphin_kf5/0001-KOverlayIconPlugin.patch
+++ b/shell_integration/dolphin_kf5/0001-KOverlayIconPlugin.patch
@@ -1,28 +1,54 @@
-From d452ed613a9e02ed81eec2f3226f28babff240c8 Mon Sep 17 00:00:00 2001
+From 47d99986d97a69582485e6b23c8c0b9018e8f2d5 Mon Sep 17 00:00:00 2001
 From: Olivier Goffart <ogoffart at woboq.com>
-Date: Thu, 17 Jul 2014 13:26:56 +0200
-Subject: [PATCH] WIP: add KOverlayIconPlugin
+Date: Mon, 7 Sep 2015 17:47:53 +0200
+Subject: [PATCH] WIP: KOverlayIconPlugin
 
-Conflicts:
-	dolphin/src/kitemviews/kfileitemmodelrolesupdater.cpp
-	lib/konq/CMakeLists.txt
 ---
- .../src/kitemviews/kfileitemmodelrolesupdater.cpp  | 38 ++++++++++++++-
- .../src/kitemviews/kfileitemmodelrolesupdater.h    |  9 ++++
- lib/konq/src/CMakeLists.txt                        |  4 +-
- lib/konq/src/koverlayiconplugin.cpp                | 30 ++++++++++++
- lib/konq/src/koverlayiconplugin.desktop            |  4 ++
- lib/konq/src/koverlayiconplugin.h                  | 57 ++++++++++++++++++++++
- 6 files changed, 140 insertions(+), 2 deletions(-)
- create mode 100644 lib/konq/src/koverlayiconplugin.cpp
- create mode 100644 lib/konq/src/koverlayiconplugin.desktop
- create mode 100644 lib/konq/src/koverlayiconplugin.h
+ src/CMakeLists.txt                                 |  4 +-
+ src/kitemviews/kfileitemmodelrolesupdater.cpp      | 35 ++++++++++++-
+ src/kitemviews/kfileitemmodelrolesupdater.h        |  8 +++
+ src/views/versioncontrol/koverlayiconplugin.cpp    | 29 +++++++++++
+ .../versioncontrol/koverlayiconplugin.desktop      |  4 ++
+ src/views/versioncontrol/koverlayiconplugin.h      | 57 ++++++++++++++++++++++
+ 6 files changed, 135 insertions(+), 2 deletions(-)
+ create mode 100644 src/views/versioncontrol/koverlayiconplugin.cpp
+ create mode 100644 src/views/versioncontrol/koverlayiconplugin.desktop
+ create mode 100644 src/views/versioncontrol/koverlayiconplugin.h
 
-diff --git a/dolphin/src/kitemviews/kfileitemmodelrolesupdater.cpp b/dolphin/src/kitemviews/kfileitemmodelrolesupdater.cpp
-index df521e2..4d94836 100644
---- a/dolphin/src/kitemviews/kfileitemmodelrolesupdater.cpp
-+++ b/dolphin/src/kitemviews/kfileitemmodelrolesupdater.cpp
-@@ -29,9 +29,11 @@
+diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
+index e0f91de..69f3d50 100644
+--- a/src/CMakeLists.txt
++++ b/src/CMakeLists.txt
+@@ -20,6 +20,7 @@ remove_definitions(
+ 
+ set(dolphinvcs_LIB_SRCS
+     views/versioncontrol/kversioncontrolplugin.cpp
++    views/versioncontrol/koverlayiconplugin.cpp
+ )
+ 
+ add_library(dolphinvcs ${dolphinvcs_LIB_SRCS})
+@@ -40,6 +41,7 @@ set_target_properties(dolphinvcs PROPERTIES
+ ecm_generate_headers(dolphinvcs_LIB_HEADERS
+     HEADER_NAMES
+     KVersionControlPlugin
++    KOverlayIconPlugin
+ 
+     RELATIVE "views/versioncontrol"
+     REQUIRED_HEADERS dolphinvcs_LIB_HEADERS
+@@ -47,7 +49,7 @@ ecm_generate_headers(dolphinvcs_LIB_HEADERS
+ 
+ install(TARGETS dolphinvcs EXPORT DolphinVcsTargets ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
+ 
+-install(FILES views/versioncontrol/fileviewversioncontrolplugin.desktop DESTINATION ${KDE_INSTALL_KSERVICETYPES5DIR})
++install(FILES views/versioncontrol/fileviewversioncontrolplugin.desktop views/versioncontrol/koverlayiconplugin.desktop DESTINATION ${KDE_INSTALL_KSERVICETYPES5DIR})
+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/dolphin_export.h DESTINATION ${KDE_INSTALL_INCLUDEDIR} COMPONENT Devel)
+ install(FILES ${dolphinvcs_LIB_HEADERS} DESTINATION "${KDE_INSTALL_INCLUDEDIR}/Dolphin" COMPONENT Devel)
+ 
+diff --git a/src/kitemviews/kfileitemmodelrolesupdater.cpp b/src/kitemviews/kfileitemmodelrolesupdater.cpp
+index b03fd9c..ed24587 100644
+--- a/src/kitemviews/kfileitemmodelrolesupdater.cpp
++++ b/src/kitemviews/kfileitemmodelrolesupdater.cpp
+@@ -29,6 +29,7 @@
  #include <KJobWidgets>
  #include <KIO/JobUiDelegate>
  #include <KIO/PreviewJob>
@@ -30,16 +56,11 @@ index df521e2..4d94836 100644
  
  #include "private/kpixmapmodifier.h"
  #include "private/kdirectorycontentscounter.h"
-+#include <koverlayiconplugin.h>
- 
- #include <QApplication>
- #include <QPainter>
-@@ -129,6 +131,20 @@ KFileItemModelRolesUpdater::KFileItemModelRolesUpdater(KFileItemModel* model, QO
+@@ -129,6 +130,19 @@ KFileItemModelRolesUpdater::KFileItemModelRolesUpdater(KFileItemModel* model, QO
      m_directoryContentsCounter = new KDirectoryContentsCounter(m_model, this);
      connect(m_directoryContentsCounter, &KDirectoryContentsCounter::result,
              this,                       &KFileItemModelRolesUpdater::slotDirectoryContentsCountReceived);
 +
-+
 +    const KService::List pluginServices = KServiceTypeTrader::self()->query("KOverlayIconPlugin");
 +
 +    for (KService::List::ConstIterator it = pluginServices.constBegin(); it != pluginServices.constEnd(); ++it) {
@@ -48,14 +69,14 @@ index df521e2..4d94836 100644
 +        if (plugin) {
 +            m_overlayIconsPlugin.append(plugin);
 +            connect(plugin, &KOverlayIconPlugin::overlaysChanged, this, &KFileItemModelRolesUpdater::slotOverlaysChanged);
-+        } else {
++        } /*else {
 +            qWarning() << "Could not load plugin " << (*it)->name() << ":" << error;
-+        }
++        }*/
 +    }
  }
  
  KFileItemModelRolesUpdater::~KFileItemModelRolesUpdater()
-@@ -1065,7 +1081,11 @@ QHash<QByteArray, QVariant> KFileItemModelRolesUpdater::rolesData(const KFileIte
+@@ -1065,7 +1079,11 @@ QHash<QByteArray, QVariant> KFileItemModelRolesUpdater::rolesData(const KFileIte
          data.insert("type", item.mimeComment());
      }
  
@@ -68,7 +89,7 @@ index df521e2..4d94836 100644
  
  #ifdef HAVE_BALOO
      if (m_balooFileMonitor) {
-@@ -1076,6 +1096,22 @@ QHash<QByteArray, QVariant> KFileItemModelRolesUpdater::rolesData(const KFileIte
+@@ -1076,6 +1094,21 @@ QHash<QByteArray, QVariant> KFileItemModelRolesUpdater::rolesData(const KFileIte
      return data;
  }
  
@@ -80,30 +101,29 @@ index df521e2..4d94836 100644
 +    int index = m_model->index(item);
 +    QHash <QByteArray, QVariant> data =  m_model->data(index);
 +    QStringList overlays = item.overlays();
-+    foreach(KOverlayIconPlugin *it, m_overlayIconsPlugin) {
++    foreach (KOverlayIconPlugin *it, m_overlayIconsPlugin) {
 +        overlays.append(it->getOverlays(item));
 +    }
 +    data.insert("iconOverlays", overlays);
 +    m_model->setData(index, data);
 +}
 +
-+
  void KFileItemModelRolesUpdater::updateAllPreviews()
  {
      if (m_state == Paused) {
-diff --git a/dolphin/src/kitemviews/kfileitemmodelrolesupdater.h b/dolphin/src/kitemviews/kfileitemmodelrolesupdater.h
-index 6c82dbe..1e5b98e 100644
---- a/dolphin/src/kitemviews/kfileitemmodelrolesupdater.h
-+++ b/dolphin/src/kitemviews/kfileitemmodelrolesupdater.h
-@@ -32,6 +32,7 @@
- #include <QSize>
- #include <QStringList>
+diff --git a/src/kitemviews/kfileitemmodelrolesupdater.h b/src/kitemviews/kfileitemmodelrolesupdater.h
+index 216b0a5..98fb305 100644
+--- a/src/kitemviews/kfileitemmodelrolesupdater.h
++++ b/src/kitemviews/kfileitemmodelrolesupdater.h
+@@ -24,6 +24,7 @@
  
-+class KOverlayIconPlugin;
- class KDirectoryContentsCounter;
- class KFileItemModel;
- class QPixmap;
-@@ -183,6 +184,12 @@ private slots:
+ #include <KFileItem>
+ #include <kitemviews/kitemmodelbase.h>
++#include "views/versioncontrol/koverlayiconplugin.h"
+ 
+ #include "dolphin_export.h"
+ 
+@@ -183,6 +184,11 @@ private slots:
      void slotPreviewJobFinished();
  
      /**
@@ -111,12 +131,11 @@ index 6c82dbe..1e5b98e 100644
 +     */
 +    void slotOverlaysChanged(const QUrl& url, const QStringList&);
 +
-+
 +    /**
       * Resolves the sort role of the next item in m_pendingSortRole, applies it
       * to the model, and invokes itself if there are any pending items left. If
       * that is not the case, \a startUpdating() is called.
-@@ -333,6 +340,8 @@ private:
+@@ -333,6 +339,8 @@ private:
  
      KDirectoryContentsCounter* m_directoryContentsCounter;
  
@@ -125,40 +144,12 @@ index 6c82dbe..1e5b98e 100644
  #ifdef HAVE_BALOO
      Baloo::FileMonitor* m_balooFileMonitor;
  #endif
-diff --git a/lib/konq/src/CMakeLists.txt b/lib/konq/src/CMakeLists.txt
-index 9c05b9f..0ac0526 100644
---- a/lib/konq/src/CMakeLists.txt
-+++ b/lib/konq/src/CMakeLists.txt
-@@ -15,6 +15,7 @@ set(konq_LIB_SRCS
-    konq_historyprovider.cpp   # konqueror and konqueror/sidebar
-    kversioncontrolplugin.cpp  # used by dolphin and its version control plugins (deprecated)
-    kversioncontrolplugin2.cpp # used by dolphin and its version control plugins
-+   koverlayiconplugin.cpp
- )
- 
- add_library(KF5Konq ${konq_LIB_SRCS})
-@@ -64,13 +65,14 @@ install(FILES
-     konq_popupmenuplugin.h
-     kversioncontrolplugin.h
-     kversioncontrolplugin2.h
-+    koverlayiconplugin.h
-     ${LibKonq_BINARY_DIR}/src/libkonq_export.h
- 
-     DESTINATION ${KF5_INCLUDE_INSTALL_DIR}
-     COMPONENT Devel
- )
- 
--install(FILES konqpopupmenuplugin.desktop konqdndpopupmenuplugin.desktop
-+install(FILES konqpopupmenuplugin.desktop konqdndpopupmenuplugin.desktop koverlayiconplugin.desktop
-     DESTINATION ${SERVICETYPES_INSTALL_DIR}
- )
- 
-diff --git a/lib/konq/src/koverlayiconplugin.cpp b/lib/konq/src/koverlayiconplugin.cpp
+diff --git a/src/views/versioncontrol/koverlayiconplugin.cpp b/src/views/versioncontrol/koverlayiconplugin.cpp
 new file mode 100644
-index 0000000..6125040
+index 0000000..1ff7914
 --- /dev/null
-+++ b/lib/konq/src/koverlayiconplugin.cpp
-@@ -0,0 +1,30 @@
++++ b/src/views/versioncontrol/koverlayiconplugin.cpp
+@@ -0,0 +1,29 @@
 +/*****************************************************************************
 + * Copyright (C) 2014 by Olivier Goffart <ogoffart at woboq.com>                *
 + *                                                                           *
@@ -178,7 +169,6 @@ index 0000000..6125040
 + *****************************************************************************/
 +
 +#include "koverlayiconplugin.h"
-+#include <KFileItem>
 +
 +KOverlayIconPlugin::KOverlayIconPlugin(QObject* parent) : QObject(parent)
 +{
@@ -189,21 +179,21 @@ index 0000000..6125040
 +}
 +
 +#include "koverlayiconplugin.moc"
-diff --git a/lib/konq/src/koverlayiconplugin.desktop b/lib/konq/src/koverlayiconplugin.desktop
+diff --git a/src/views/versioncontrol/koverlayiconplugin.desktop b/src/views/versioncontrol/koverlayiconplugin.desktop
 new file mode 100644
 index 0000000..65a1170
 --- /dev/null
-+++ b/lib/konq/src/koverlayiconplugin.desktop
++++ b/src/views/versioncontrol/koverlayiconplugin.desktop
 @@ -0,0 +1,4 @@
 +[Desktop Entry]
 +Type=ServiceType
 +X-KDE-ServiceType=KOverlayIconPlugin
 +Comment=Plugin to add overlay icons in Dolphin
-diff --git a/lib/konq/src/koverlayiconplugin.h b/lib/konq/src/koverlayiconplugin.h
+diff --git a/src/views/versioncontrol/koverlayiconplugin.h b/src/views/versioncontrol/koverlayiconplugin.h
 new file mode 100644
-index 0000000..bfdaa2f
+index 0000000..889bf30
 --- /dev/null
-+++ b/lib/konq/src/koverlayiconplugin.h
++++ b/src/views/versioncontrol/koverlayiconplugin.h
 @@ -0,0 +1,57 @@
 +/*****************************************************************************
 + * Copyright (C) 2014 by Olivier Goffart <ogoffart at woboq.com>                *
@@ -227,8 +217,8 @@ index 0000000..bfdaa2f
 +#ifndef OverlayIconPlugin_H
 +#define OverlayIconPlugin_H
 +
++#include <dolphin_export.h>
 +#include <QtCore/QObject>
-+#include <libkonq_export.h>
 +
 +class KUrl;
 +class KFileItem;
@@ -241,7 +231,7 @@ index 0000000..bfdaa2f
 + * To write a custom plugin you need to create a .desktop file for your plugin with
 + * KDE-ServiceTypes=KOverlayIconPlugin
 + */
-+class LIBKONQ_EXPORT KOverlayIconPlugin : public QObject {
++class DOLPHIN_EXPORT KOverlayIconPlugin : public QObject {
 +    Q_OBJECT
 +    void *d;
 +public:
@@ -263,5 +253,5 @@ index 0000000..bfdaa2f
 +
 +#endif
 -- 
-2.2.1
+2.5.1
 
diff --git a/shell_integration/dolphin_kf5/CMakeLists.txt b/shell_integration/dolphin_kf5/CMakeLists.txt
index d0375ac..1dfe9be 100644
--- a/shell_integration/dolphin_kf5/CMakeLists.txt
+++ b/shell_integration/dolphin_kf5/CMakeLists.txt
@@ -1,30 +1,37 @@
 project(dolphin-owncloud)
 
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 2.8.12)
+include(FeatureSummary)
 set(QT_MIN_VERSION "5.3.0")
+set(KF5_MIN_VERSION "5.0.0")
+
+find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS Core Network)
 
 find_package(ECM 1.2.0 REQUIRED CONFIG)
+set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR} "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
 
-include(FeatureSummary)
 
-# where to look first for cmake modules, before ${CMAKE_ROOT}/Modules/ is checked
-set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH})
+find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS CoreAddons)
+
+find_package(DolphinVcs REQUIRED)
+set_package_properties(DolphinVcs PROPERTIES
+    DESCRIPTION "the Dolphin plugin library"
+    URL "http://dolphin.kde.org/"
+    TYPE REQUIRED
+    PURPOSE "Provides plugin interfaces for Dolphin."
+)
 
 include(KDEInstallDirs)
 include(KDECMakeSettings)
 include(KDECompilerSettings)
-include(ECMInstallIcons)
-include(ECMSetupVersion)
-
-find_package(Qt5 CONFIG REQUIRED Core DBus Test Widgets)
-find_package(KF5 REQUIRED Archive Bookmarks CoreAddons Config ConfigWidgets DBusAddons KIO KDELibs4Support Parts Activities)
+include(ECMMarkNonGuiExecutable)
 
+include_directories(${CMAKE_CURRENT_BINARY_DIR})
 
-find_package(KF5Konq  REQUIRED)
 
 add_definitions(-DQT_USE_FAST_CONCATENATION -DQT_USE_FAST_OPERATOR_PLUS)
 
 add_library(ownclouddolphinplugin MODULE ownclouddolphinplugin.cpp)
-target_link_libraries(ownclouddolphinplugin KF5::Konq)
-install(FILES ownclouddolphinplugin.desktop DESTINATION ${SERVICES_INSTALL_DIR})
-install(TARGETS ownclouddolphinplugin DESTINATION ${PLUGIN_INSTALL_DIR})
+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})
diff --git a/shell_integration/dolphin_kf5/ownclouddolphinplugin.cpp b/shell_integration/dolphin_kf5/ownclouddolphinplugin.cpp
index 24b4571..116858d 100644
--- a/shell_integration/dolphin_kf5/ownclouddolphinplugin.cpp
+++ b/shell_integration/dolphin_kf5/ownclouddolphinplugin.cpp
@@ -17,12 +17,11 @@
  *   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA               *
  ******************************************************************************/
 
-#include <koverlayiconplugin.h>
+#include <Dolphin/KOverlayIconPlugin>
 #include <KPluginFactory>
 #include <KPluginLoader>
-#include <kdebug.h>
-#include <kfileitem.h>
 #include <QtNetwork/QLocalSocket>
+#include <KIOCore/kfileitem.h>
 
 
 class OwncloudDolphinPlugin : public KOverlayIconPlugin
@@ -44,12 +43,12 @@ public:
         if (!url.isLocalFile())
             return QStringList();
         const QByteArray localFile = url.toLocalFile().toUtf8();
-        kDebug() << localFile;
+//         kDebug() << localFile;
 
         tryConnect();
         if (m_socket.state() == QLocalSocket::ConnectingState) {
             if (!m_socket.waitForConnected(100)) {
-                kWarning() << "not connected" << m_socket.errorString();
+//                kWarning() << "not connected" << m_socket.errorString();
             }
         }
         if (m_socket.state() == QLocalSocket::ConnectedState) {
@@ -89,7 +88,6 @@ private:
         if (status.contains("+SWM"))
             r << "document-share";
 
-        kDebug() << status << r;
         return r;
     }
 
@@ -102,7 +100,6 @@ private slots:
             QByteArray line;
             qSwap(line, m_line);
             line.chop(1);
-            kDebug() << "got line " << line;
             if (line.isEmpty())
                 continue;
             QList<QByteArray> tokens = line.split(':');
@@ -127,5 +124,4 @@ private slots:
 K_PLUGIN_FACTORY(OwncloudDolphinPluginFactory, registerPlugin<OwncloudDolphinPlugin>();)
 K_EXPORT_PLUGIN(OwncloudDolphinPluginFactory("ownclouddolhpinplugin"))
 
-
 #include "ownclouddolphinplugin.moc"

-- 
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