]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Move the KVersionControlPlugin2 interface from konqlib to Dolphin and remove the...
authorEmmanuel Pescosta <emmanuelpescosta099@gmail.com>
Wed, 25 Feb 2015 11:12:55 +0000 (12:12 +0100)
committerEmmanuel Pescosta <emmanuelpescosta099@gmail.com>
Wed, 25 Feb 2015 16:21:10 +0000 (17:21 +0100)
REVIEW: 122687

58 files changed:
CMakeLists.txt
DolphinVcsConfig.cmake.in [new file with mode: 0644]
src/CMakeLists.txt
src/dolphinnewfilemenu.h
src/dolphinremoveaction.h
src/kitemviews/kfileitemlistview.h
src/kitemviews/kfileitemlistwidget.h
src/kitemviews/kfileitemmodel.h
src/kitemviews/kfileitemmodelrolesupdater.cpp
src/kitemviews/kfileitemmodelrolesupdater.h
src/kitemviews/kitemlistcontainer.h
src/kitemviews/kitemlistcontroller.h
src/kitemviews/kitemlistgroupheader.h
src/kitemviews/kitemlistheader.h
src/kitemviews/kitemlistselectionmanager.h
src/kitemviews/kitemliststyleoption.h
src/kitemviews/kitemlistview.h
src/kitemviews/kitemlistviewaccessible.h
src/kitemviews/kitemlistwidget.h
src/kitemviews/kitemmodelbase.h
src/kitemviews/kstandarditem.h
src/kitemviews/kstandarditemlistgroupheader.h
src/kitemviews/kstandarditemlistview.h
src/kitemviews/kstandarditemlistwidget.h
src/kitemviews/kstandarditemmodel.h
src/kitemviews/private/kbaloorolesprovider.h
src/kitemviews/private/kfileitemclipboard.h
src/kitemviews/private/kfileitemmodeldirlister.h
src/kitemviews/private/kfileitemmodelfilter.h
src/kitemviews/private/kitemlistheaderwidget.h
src/kitemviews/private/kitemlistkeyboardsearchmanager.h
src/kitemviews/private/kitemlistroleeditor.h
src/kitemviews/private/kitemlistrubberband.h
src/kitemviews/private/kitemlistselectiontoggle.h
src/kitemviews/private/kitemlistsizehintresolver.h
src/kitemviews/private/kitemlistsmoothscroller.h
src/kitemviews/private/kitemlistviewanimation.h
src/kitemviews/private/kitemlistviewlayouter.h
src/kitemviews/private/kpixmapmodifier.h
src/settings/viewpropertiesdialog.h
src/tests/CMakeLists.txt
src/views/dolphinfileitemlistwidget.cpp
src/views/dolphinfileitemlistwidget.h
src/views/dolphinitemlistview.h
src/views/dolphinnewfilemenuobserver.h
src/views/dolphinremoteencoding.h
src/views/dolphinview.h
src/views/dolphinviewactionhandler.h
src/views/draganddrophelper.h
src/views/renamedialog.h
src/views/versioncontrol/kversioncontrolplugin.cpp [new file with mode: 0644]
src/views/versioncontrol/kversioncontrolplugin.h [new file with mode: 0644]
src/views/versioncontrol/updateitemstatesthread.cpp
src/views/versioncontrol/updateitemstatesthread.h
src/views/versioncontrol/versioncontrolobserver.cpp
src/views/versioncontrol/versioncontrolobserver.h
src/views/viewmodecontroller.h
src/views/viewproperties.h

index 570910497e8938bc9537ab6a6cfc75f172f2d35a..3a3ab6d4c3d98f1c97af0e08ce34605b3ae1b434 100644 (file)
@@ -3,18 +3,25 @@ cmake_minimum_required(VERSION 2.8.12)
 project(Dolphin)
 
 # ECM setup
-find_package(ECM 1.2.0 CONFIG REQUIRED)
+find_package(ECM 1.6.0 CONFIG REQUIRED)
 set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
 
 set(DOLPHIN_VERSION "4.97.0")
 
 include(ECMSetupVersion)
+include(ECMGenerateHeaders)
 include(GenerateExportHeader)
 include(FeatureSummary)
 include(KDEInstallDirs)
 include(KDECMakeSettings)
 include(KDEFrameworkCompilerSettings)
 
+ecm_setup_version(${DOLPHIN_VERSION} VARIABLE_PREFIX DOLPHINVCS
+                  VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/dolphinvcs_version.h"
+                  PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/DolphinVcsConfigVersion.cmake"
+                  SOVERSION 5
+)
+
 ecm_setup_version(${DOLPHIN_VERSION} VARIABLE_PREFIX DOLPHINPRIVATE
                   SOVERSION 5
 )
@@ -24,12 +31,6 @@ find_package(KF5 COMPONENTS Activities)
 
 find_package(Phonon4Qt5 CONFIG REQUIRED)
 
-if ("${CMAKE_SOURCE_DIR}" STREQUAL "${Dolphin_SOURCE_DIR}")
-    find_package(KF5Konq CONFIG REQUIRED)
-else()
-    include_directories(${LibKonq_SOURCE_DIR}/src)
-endif()
-
 find_package(KF5Baloo 4.97)
 set_package_properties(KF5Baloo PROPERTIES DESCRIPTION "Baloo Core libraries"
                        URL "http://www.kde.org"
@@ -58,6 +59,33 @@ endif()
 add_subdirectory(src)
 add_subdirectory(docs)
 
+# CMake files
+set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/Dolphin")
+
+ecm_configure_package_config_file(
+    "${CMAKE_CURRENT_SOURCE_DIR}/DolphinVcsConfig.cmake.in"
+    "${CMAKE_CURRENT_BINARY_DIR}/DolphinVcsConfig.cmake"
+    INSTALL_DESTINATION ${CMAKECONFIG_INSTALL_DIR}
+)
+
+install(FILES
+    "${CMAKE_CURRENT_BINARY_DIR}/DolphinVcsConfig.cmake"
+    "${CMAKE_CURRENT_BINARY_DIR}/DolphinVcsConfigVersion.cmake"
+    DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
+    COMPONENT Devel
+)
+
+install(EXPORT DolphinVcsTargets
+    DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
+    FILE DolphinVcsTargets.cmake
+)
+
+install(FILES
+    "${CMAKE_CURRENT_BINARY_DIR}/dolphinvcs_version.h"
+    DESTINATION "${KDE_INSTALL_INCLUDEDIR}/Dolphin"
+    COMPONENT Devel
+)
+
 # TODO Remove the if/endif lines if Dolphin is split.
 if ("${CMAKE_SOURCE_DIR}" STREQUAL "${Dolphin_SOURCE_DIR}")
   feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
diff --git a/DolphinVcsConfig.cmake.in b/DolphinVcsConfig.cmake.in
new file mode 100644 (file)
index 0000000..7e7a229
--- /dev/null
@@ -0,0 +1,6 @@
+@PACKAGE_INIT@
+
+find_dependency(Qt5Widgets)
+find_dependency(KF5KIO)
+
+include("${CMAKE_CURRENT_LIST_DIR}/DolphinVcsTargets.cmake")
index ea21f1af251d02294c2f0251e8cc0c71f32322af..2b65671da5b464584a97ba84930743a91cfb1385 100644 (file)
@@ -12,6 +12,42 @@ endif()
 
 configure_file(config-X11.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-X11.h)
 
+##########################################
+
+set(dolphinvcs_LIB_SRCS
+    views/versioncontrol/kversioncontrolplugin.cpp
+)
+
+add_library(dolphinvcs ${dolphinvcs_LIB_SRCS})
+
+generate_export_header(dolphinvcs BASE_NAME dolphin)
+
+target_link_libraries(
+    dolphinvcs PUBLIC
+    Qt5::Widgets
+    KF5::KIOCore
+)
+
+set_target_properties(dolphinvcs PROPERTIES
+    VERSION ${DOLPHINVCS_VERSION_STRING}
+    SOVERSION ${DOLPHINVCS_SOVERSION}
+    EXPORT_NAME DolphinVcs
+)
+
+ecm_generate_headers(dolphinvcs_LIB_HEADERS
+    HEADER_NAMES
+    KVersionControlPlugin
+
+    RELATIVE "views/versioncontrol"
+    REQUIRED_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 ${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)
+
 ########### next target ###############
 
 set(dolphinprivate_LIB_SRCS
@@ -93,13 +129,10 @@ kconfig_add_kcfg_files(dolphinprivate_LIB_SRCS GENERATE_MOC
 
 add_library(dolphinprivate ${dolphinprivate_LIB_SRCS})
 
-generate_export_header(dolphinprivate BASE_NAME libdolphinprivate
-  EXPORT_FILE_NAME libdolphin_export.h)
-
 target_link_libraries(
     dolphinprivate PUBLIC
+    dolphinvcs
     KF5::KDELibs4Support
-    KF5::Konq
     KF5::NewStuff
 )
 
@@ -122,7 +155,7 @@ set_target_properties(dolphinprivate PROPERTIES
     SOVERSION ${DOLPHINPRIVATE_SOVERSION}
 )
 
-install(TARGETS dolphinprivate ${KF5_INSTALL_TARGETS_DEFAULT_ARGS})
+install(TARGETS dolphinprivate ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
 
 ##########################################
 
@@ -136,7 +169,6 @@ add_library(dolphinpart MODULE ${dolphinpart_SRCS})
 
 target_link_libraries(dolphinpart
     dolphinprivate
-    KF5::Konq
     KF5::KDELibs4Support
 )
 
@@ -144,7 +176,6 @@ install(TARGETS dolphinpart DESTINATION ${PLUGIN_INSTALL_DIR})
 
 install(FILES dolphinpart.rc DESTINATION ${CMAKE_INSTALL_KXMLGUI5DIR}/dolphinpart)
 install(FILES dolphinpart.desktop DESTINATION ${SERVICES_INSTALL_DIR})
-install(FILES views/versioncontrol/fileviewversioncontrolplugin.desktop DESTINATION ${SERVICETYPES_INSTALL_DIR})
 
 ##########################################
 
@@ -230,7 +261,6 @@ kf5_add_kdeinit_executable(dolphin ${dolphin_SRCS})
 target_include_directories(kdeinit_dolphin PRIVATE ${PHONON_INCLUDES})
 
 target_link_libraries(kdeinit_dolphin
-    KF5::Konq
     dolphinprivate
     KF5::NewStuff
     KF5::Parts
@@ -251,8 +281,8 @@ if (KF5Activities_FOUND)
     )
 endif()
 
-install(TARGETS kdeinit_dolphin ${KF5_INSTALL_TARGETS_DEFAULT_ARGS})
-install(TARGETS dolphin ${KF5_INSTALL_TARGETS_DEFAULT_ARGS})
+install(TARGETS kdeinit_dolphin ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
+install(TARGETS dolphin ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
 
 ##########################################
 
index 254571eb9e7ec47792ce2205536c19d5e3e505b3..9f1cb55991f780058ed5add533161e35c3287f97 100644 (file)
@@ -23,7 +23,7 @@
 
 #include <KNewFileMenu>
 
-#include "libdolphin_export.h"
+#include "dolphin_export.h"
 
 class KJob;
 
@@ -35,7 +35,7 @@ class KJob;
  * All errors are shown in the status bar of Dolphin
  * instead as modal error dialog with an OK button.
  */
-class LIBDOLPHINPRIVATE_EXPORT DolphinNewFileMenu : public KNewFileMenu
+class DOLPHIN_EXPORT DolphinNewFileMenu : public KNewFileMenu
 {
     Q_OBJECT
 
index 1a123ace54637a20347359c27134cf42bc2de879..85f404318b74da575ba954d5110c5f7e9b7107b7 100644 (file)
@@ -20,7 +20,7 @@
 #ifndef DOLPHINREMOVEACTION_H
 #define DOLPHINREMOVEACTION_H
 
-#include "libdolphin_export.h"
+#include "dolphin_export.h"
 
 #include <QAction>
 #include <QPointer>
@@ -34,7 +34,7 @@
  * This class expects the presence of both the "move_to_trash" and "delete"
  * actions in @ref collection.
  */
-class LIBDOLPHINPRIVATE_EXPORT DolphinRemoveAction : public QAction
+class DOLPHIN_EXPORT DolphinRemoveAction : public QAction
 {
   Q_OBJECT
 public:
index 72688893e861147db20da42c33d586a17c5332fe..84aa17d89baec0ed1a2148d7c1e5c62f20e86278 100644 (file)
@@ -20,7 +20,7 @@
 #ifndef KFILEITEMLISTVIEW_H
 #define KFILEITEMLISTVIEW_H
 
-#include "libdolphin_export.h"
+#include "dolphin_export.h"
 
 #include <kitemviews/kstandarditemlistview.h>
 
@@ -36,7 +36,7 @@ class QTimer;
  * KItemListView::setWidgetCreator() and KItemListView::setGroupHeaderCreator()
  * to apply customized generators.
  */
-class LIBDOLPHINPRIVATE_EXPORT KFileItemListView : public KStandardItemListView
+class DOLPHIN_EXPORT KFileItemListView : public KStandardItemListView
 {
     Q_OBJECT
 
index 32959e4f6259ea45662a045b3680da6e96fc13f0..07ca59b44455bf1fd0559518742480d80378d642 100644 (file)
 #ifndef KFILEITEMLISTWIDGET_H
 #define KFILEITEMLISTWIDGET_H
 
-#include "libdolphin_export.h"
+#include "dolphin_export.h"
 
 #include <kitemviews/kstandarditemlistwidget.h>
 
-class LIBDOLPHINPRIVATE_EXPORT KFileItemListWidgetInformant : public KStandardItemListWidgetInformant
+class DOLPHIN_EXPORT KFileItemListWidgetInformant : public KStandardItemListWidgetInformant
 {
 public:
     KFileItemListWidgetInformant();
@@ -37,7 +37,7 @@ protected:
     virtual QFont customizedFontForLinks(const QFont& baseFont) const Q_DECL_OVERRIDE;
 };
 
-class LIBDOLPHINPRIVATE_EXPORT KFileItemListWidget : public KStandardItemListWidget
+class DOLPHIN_EXPORT KFileItemListWidget : public KStandardItemListWidget
 {
     Q_OBJECT
 
index 8e36294e901e127a604ac90c30801d3bd35c4b2f..167f508cfffea39aadba366ef8fb3bf344b27157 100644 (file)
@@ -20,7 +20,7 @@
 #ifndef KFILEITEMMODEL_H
 #define KFILEITEMMODEL_H
 
-#include "libdolphin_export.h"
+#include "dolphin_export.h"
 #include <KFileItem>
 #include <QUrl>
 #include <kitemviews/kitemmodelbase.h>
@@ -43,7 +43,7 @@ class QTimer;
  * Recursive expansion of sub-directories is supported by
  * KFileItemModel::setExpanded().
  */
-class LIBDOLPHINPRIVATE_EXPORT KFileItemModel : public KItemModelBase
+class DOLPHIN_EXPORT KFileItemModel : public KItemModelBase
 {
     Q_OBJECT
 
index f17a77e0aee172fd91c6259c79a7ff8c8e126c7b..c18d6589233344412a9449cee2d3f86d297dfff9 100644 (file)
@@ -23,6 +23,7 @@
 
 #include <KConfig>
 #include <KConfigGroup>
+#include <KSharedConfig>
 #include <KFileItem>
 #include <KIconLoader>
 #include <KJobWidgets>
index 6c82dbe4ae552f9b85055a29711f78b755dfc114..216b0a501aa9b4a21fd962515e6a9da8abf130a6 100644 (file)
@@ -25,7 +25,7 @@
 #include <KFileItem>
 #include <kitemviews/kitemmodelbase.h>
 
-#include "libdolphin_export.h"
+#include "dolphin_export.h"
 
 #include <QObject>
 #include <QSet>
@@ -87,7 +87,7 @@ namespace KIO {
  * 3.   Finally, the entire process is repeated for any items that might have
  *      changed in the mean time.
  */
-class LIBDOLPHINPRIVATE_EXPORT KFileItemModelRolesUpdater : public QObject
+class DOLPHIN_EXPORT KFileItemModelRolesUpdater : public QObject
 {
     Q_OBJECT
 
index 6f2851b3e7814b5ba987fdfd706897577432772f..9fc3d4957ee0e2df38525990f6df925d6ab69ee0 100644 (file)
@@ -23,7 +23,7 @@
 #ifndef KITEMLISTCONTAINER_H
 #define KITEMLISTCONTAINER_H
 
-#include "libdolphin_export.h"
+#include "dolphin_export.h"
 
 #include <QAbstractScrollArea>
 
@@ -39,7 +39,7 @@ class KItemModelBase;
  *
  * @see KItemListController
  */
-class LIBDOLPHINPRIVATE_EXPORT KItemListContainer : public QAbstractScrollArea
+class DOLPHIN_EXPORT KItemListContainer : public QAbstractScrollArea
 {
     Q_OBJECT
 
index 2824a1fc9aebe625f85e82279111735bbec4bdb9..b8a93edacbaeaccf382971dc17d299bcda8c6dc8 100644 (file)
@@ -23,7 +23,7 @@
 #ifndef KITEMLISTCONTROLLER_H
 #define KITEMLISTCONTROLLER_H
 
-#include "libdolphin_export.h"
+#include "dolphin_export.h"
 
 #include "kitemset.h"
 
@@ -56,7 +56,7 @@ class QTransform;
  * @see KItemModelBase
  * @see KItemListSelectionManager
  */
-class LIBDOLPHINPRIVATE_EXPORT KItemListController : public QObject
+class DOLPHIN_EXPORT KItemListController : public QObject
 {
     Q_OBJECT
     Q_ENUMS(SelectionBehavior)
index c89da50274aade92fef0e7f2405acd37cbb61781..4612bc4da839fba143f626536e631c5eb1262de8 100644 (file)
@@ -20,7 +20,7 @@
 #ifndef KITEMLISTGROUPHEADER_H
 #define KITEMLISTGROUPHEADER_H
 
-#include "libdolphin_export.h"
+#include "dolphin_export.h"
 
 #include <kitemviews/kitemliststyleoption.h>
 
@@ -37,7 +37,7 @@ class KItemListView;
  * the method paint() and draw the role within the given roleBounds() with
  * the color roleColor().
  */
-class LIBDOLPHINPRIVATE_EXPORT KItemListGroupHeader : public QGraphicsWidget
+class DOLPHIN_EXPORT KItemListGroupHeader : public QGraphicsWidget
 {
     Q_OBJECT
 
index b361b912bacbe5b474a2047383966e529ab06936..cc2b747939d66b1ce921250df07788373e57dda2 100644 (file)
@@ -20,7 +20,7 @@
 #ifndef KITEMLISTHEADER_H
 #define KITEMLISTHEADER_H
 
-#include "libdolphin_export.h"
+#include "dolphin_export.h"
 #include <QHash>
 #include <QObject>
 
@@ -33,7 +33,7 @@ class KItemListView;
  * Each column of the header represents a visible role
  * accessible by KItemListView::visibleRoles().
  */
-class LIBDOLPHINPRIVATE_EXPORT KItemListHeader : public QObject
+class DOLPHIN_EXPORT KItemListHeader : public QObject
 {
     Q_OBJECT
 
index a8318388ca65f781037d435657da5f26ac946801..16761428bb632608234a285a4667ac60f99ba6ec 100644 (file)
@@ -23,7 +23,7 @@
 #ifndef KITEMLISTSELECTIONMANAGER_H
 #define KITEMLISTSELECTIONMANAGER_H
 
-#include "libdolphin_export.h"
+#include "dolphin_export.h"
 
 #include <kitemviews/kitemmodelbase.h>
 #include <kitemviews/kitemset.h>
@@ -35,7 +35,7 @@ class KItemModelBase;
 /**
  * @brief Allows to select and deselect items of a KItemListView.
  */
-class LIBDOLPHINPRIVATE_EXPORT KItemListSelectionManager : public QObject
+class DOLPHIN_EXPORT KItemListSelectionManager : public QObject
 {
     Q_OBJECT
 
index 9290dc34196426a5c17b05ebd0ec3681fb46493b..09b787c27d272d71b70f7d3b7d3b3e8c77dbdfcb 100644 (file)
 #ifndef KITEMLISTSTYLEOPTION_H
 #define KITEMLISTSTYLEOPTION_H
 
-#include "libdolphin_export.h"
+#include "dolphin_export.h"
 
 #include <QFont>
 #include <QFontMetrics>
 #include <QPalette>
 #include <QRect>
 
-class LIBDOLPHINPRIVATE_EXPORT KItemListStyleOption
+class DOLPHIN_EXPORT KItemListStyleOption
 {
 public:
     KItemListStyleOption();
index 8130e45ed008a858bca2388c860a54b1c1b0ae93..f201802893db75b50598e211f1a9902936b9ce35 100644 (file)
@@ -23,7 +23,7 @@
 #ifndef KITEMLISTVIEW_H
 #define KITEMLISTVIEW_H
 
-#include "libdolphin_export.h"
+#include "dolphin_export.h"
 
 #include <kitemviews/kstandarditemlistgroupheader.h>
 #include <kitemviews/kitemliststyleoption.h>
@@ -59,7 +59,7 @@ class QTimer;
  * @see KItemListWidget
  * @see KItemModelBase
  */
-class LIBDOLPHINPRIVATE_EXPORT KItemListView : public QGraphicsWidget
+class DOLPHIN_EXPORT KItemListView : public QGraphicsWidget
 {
     Q_OBJECT
 
@@ -769,7 +769,7 @@ private:
  * KItemListWidgetCreatorBase and KItemListGroupHeaderCreatorBase.
  * @internal
  */
-class LIBDOLPHINPRIVATE_EXPORT KItemListCreatorBase
+class DOLPHIN_EXPORT KItemListCreatorBase
 {
 public:
     virtual ~KItemListCreatorBase();
@@ -793,7 +793,7 @@ private:
  * expensive instantiations and deletions of KItemListWidgets by recycling existing widget
  * instances.
  */
-class LIBDOLPHINPRIVATE_EXPORT KItemListWidgetCreatorBase : public KItemListCreatorBase
+class DOLPHIN_EXPORT KItemListWidgetCreatorBase : public KItemListCreatorBase
 {
 public:
     virtual ~KItemListWidgetCreatorBase();
@@ -875,7 +875,7 @@ qreal KItemListWidgetCreator<T>::preferredRoleColumnWidth(const QByteArray& role
  * The intention of the group-header creator is to prevent repetitive and expensive instantiations and
  * deletions of KItemListGroupHeaders by recycling existing header instances.
  */
-class LIBDOLPHINPRIVATE_EXPORT KItemListGroupHeaderCreatorBase : public KItemListCreatorBase
+class DOLPHIN_EXPORT KItemListGroupHeaderCreatorBase : public KItemListCreatorBase
 {
 public:
     virtual ~KItemListGroupHeaderCreatorBase();
index 28b0be4e6c7da916f3576094d8d6ce1de5dce115..afef2d5fe9488cc11ae9b4d98106724e6533633c 100644 (file)
@@ -22,7 +22,7 @@
 
 #ifndef QT_NO_ACCESSIBILITY
 
-#include "libdolphin_export.h"
+#include "dolphin_export.h"
 
 #include <QtCore/qpointer.h>
 #include <qaccessible.h>
@@ -32,7 +32,7 @@
 class KItemListView;
 class KItemListContainer;
 
-class LIBDOLPHINPRIVATE_EXPORT KItemListViewAccessible: public QAccessibleObject, public QAccessibleTableInterface
+class DOLPHIN_EXPORT KItemListViewAccessible: public QAccessibleObject, public QAccessibleTableInterface
 {
 public:
     explicit KItemListViewAccessible(KItemListView* view);
@@ -89,7 +89,7 @@ private:
     mutable QVector<QAccessibleInterface*> m_cells;
 };
 
-class LIBDOLPHINPRIVATE_EXPORT KItemListAccessibleCell: public QAccessibleInterface, public QAccessibleTableCellInterface
+class DOLPHIN_EXPORT KItemListAccessibleCell: public QAccessibleInterface, public QAccessibleTableCellInterface
 {
 public:
     KItemListAccessibleCell(KItemListView* view, int m_index);
@@ -128,7 +128,7 @@ private:
     int m_index;
 };
 
-class LIBDOLPHINPRIVATE_EXPORT KItemListContainerAccessible : public QAccessibleWidget
+class DOLPHIN_EXPORT KItemListContainerAccessible : public QAccessibleWidget
 {
 public:
     explicit KItemListContainerAccessible(KItemListContainer* container);
index 723847c43a06966523332fe1dceb98e7be80b380..ae99a1f29992910c1f8cdec11132b46207790ecc 100644 (file)
@@ -23,7 +23,7 @@
 #ifndef KITEMLISTWIDGET_H
 #define KITEMLISTWIDGET_H
 
-#include "libdolphin_export.h"
+#include "dolphin_export.h"
 
 #include <kitemviews/kitemliststyleoption.h>
 
@@ -43,7 +43,7 @@ class QPropertyAnimation;
  * size for the invisible items must be accessible. KItemListWidgetInformant
  * provides this information.
  */
-class LIBDOLPHINPRIVATE_EXPORT KItemListWidgetInformant
+class DOLPHIN_EXPORT KItemListWidgetInformant
 {
 public:
     KItemListWidgetInformant();
@@ -63,7 +63,7 @@ public:
  * All properties are set by KItemListView, for each property there is a corresponding
  * virtual protected method that allows to react on property changes.
  */
-class LIBDOLPHINPRIVATE_EXPORT KItemListWidget : public QGraphicsWidget
+class DOLPHIN_EXPORT KItemListWidget : public QGraphicsWidget
 {
     Q_OBJECT
 
index e46d761fc63fcb9a91dc1add69a632d07c796d9b..bd5ca1d652cfb8f7b9bad39704f9d03395a08887 100644 (file)
@@ -23,7 +23,7 @@
 #ifndef KITEMMODELBASE_H
 #define KITEMMODELBASE_H
 
-#include "libdolphin_export.h"
+#include "dolphin_export.h"
 
 #include <kitemviews/kitemrange.h>
 #include <kitemviews/kitemset.h>
@@ -49,7 +49,7 @@ class QMimeData;
  * Also optionally it is possible to provide a tree of items by implementing the methods
  * setExpanded(), isExpanded(), isExpandable() and expandedParentsCount().
  */
-class LIBDOLPHINPRIVATE_EXPORT KItemModelBase : public QObject
+class DOLPHIN_EXPORT KItemModelBase : public QObject
 {
     Q_OBJECT
 
index b1d5edf2e055e21f774330e263673636076a330c..5bb2bb36f7bb5826c3d879e75531641ec6dac1b8 100644 (file)
@@ -20,7 +20,7 @@
 #ifndef KSTANDARDITEM_H
 #define KSTANDARDITEM_H
 
-#include "libdolphin_export.h"
+#include "dolphin_export.h"
 
 #include <QByteArray>
 #include <QHash>
@@ -36,7 +36,7 @@ class KStandardItemModel;
  * used roles. It is possible to assign values for custom
  * roles by using setDataValue().
  */
-class LIBDOLPHINPRIVATE_EXPORT KStandardItem
+class DOLPHIN_EXPORT KStandardItem
 {
 
 public:
index caf906ddf4c31c3a290555f5ea91932583d83092..f0eacfd49ab604d35013459b18a6c5f6b7ef4b86 100644 (file)
 #ifndef KSTANDARDITEMLISTGROUPHEADER_H
 #define KSTANDARDITEMLISTGROUPHEADER_H
 
-#include "libdolphin_export.h"
+#include "dolphin_export.h"
 
 #include <kitemviews/kitemlistgroupheader.h>
 
 #include <QPixmap>
 #include <QStaticText>
 
-class LIBDOLPHINPRIVATE_EXPORT KStandardItemListGroupHeader : public KItemListGroupHeader
+class DOLPHIN_EXPORT KStandardItemListGroupHeader : public KItemListGroupHeader
 {
     Q_OBJECT
 
index 9fc43a940e6b34ebf83a0950911bb7442dc95278..2e4c7a0a0a05ab3cc0a112bad25b779e60414a79 100644 (file)
@@ -20,7 +20,7 @@
 #ifndef KSTANDARDITEMLISTVIEW_H
 #define KSTANDARDITEMLISTVIEW_H
 
-#include "libdolphin_export.h"
+#include "dolphin_export.h"
 
 #include <kitemviews/kitemlistview.h>
 
@@ -40,7 +40,7 @@
  * KItemListContainer* container = new KItemListContainer(controller, parentWidget);
  * </code>
  */
-class LIBDOLPHINPRIVATE_EXPORT KStandardItemListView : public KItemListView
+class DOLPHIN_EXPORT KStandardItemListView : public KItemListView
 {
     Q_OBJECT
 
index 8e61d06b414c307f33296e6a97d6dd5c44f426d2..826452255d73784b3a7f0443fe7a2a676d2f553b 100644 (file)
@@ -20,7 +20,7 @@
 #ifndef KSTANDARDITEMLISTWIDGET_H
 #define KSTANDARDITEMLISTWIDGET_H
 
-#include "libdolphin_export.h"
+#include "dolphin_export.h"
 
 #include <kitemviews/kitemlistwidget.h>
 
@@ -32,7 +32,7 @@ class KItemListRoleEditor;
 class KItemListStyleOption;
 class KItemListView;
 
-class LIBDOLPHINPRIVATE_EXPORT KStandardItemListWidgetInformant : public KItemListWidgetInformant
+class DOLPHIN_EXPORT KStandardItemListWidgetInformant : public KItemListWidgetInformant
 {
 public:
     KStandardItemListWidgetInformant();
@@ -83,7 +83,7 @@ protected:
 /**
  * @brief Itemlist widget implementation for KStandardItemView and KStandardItemModel.
  */
-class LIBDOLPHINPRIVATE_EXPORT KStandardItemListWidget : public KItemListWidget
+class DOLPHIN_EXPORT KStandardItemListWidget : public KItemListWidget
 {
     Q_OBJECT
 
index 3b5f5bd393d6316aaf905f3b639f53ea09bb454c..58c5a5d88dafcc932d00f790a478668542795eea 100644 (file)
@@ -20,7 +20,7 @@
 #ifndef KSTANDARDITEMMODEL_H
 #define KSTANDARDITEMMODEL_H
 
-#include "libdolphin_export.h"
+#include "dolphin_export.h"
 #include <kitemviews/kitemmodelbase.h>
 #include <QHash>
 #include <QList>
@@ -35,7 +35,7 @@ class KStandardItem;
  *
  * @see KStandardItem
  */
-class LIBDOLPHINPRIVATE_EXPORT KStandardItemModel : public KItemModelBase
+class DOLPHIN_EXPORT KStandardItemModel : public KItemModelBase
 {
     Q_OBJECT
 
index ef073a367e65e74b0beccda2a6ba51b9094540f9..9673bff4fa9a8a759d9a736a21c8a90435393e2f 100644 (file)
@@ -21,7 +21,7 @@
 #ifndef KBALOO_ROLESPROVIDER_H
 #define KBALOO_ROLESPROVIDER_H
 
-#include "libdolphin_export.h"
+#include "dolphin_export.h"
 
 #include <QHash>
 #include <QSet>
@@ -36,7 +36,7 @@ namespace Baloo {
  * Is a helper class for KFileItemModelRolesUpdater to retrieve roles that
  * are only accessible with Baloo.
  */
-class LIBDOLPHINPRIVATE_EXPORT KBalooRolesProvider
+class DOLPHIN_EXPORT KBalooRolesProvider
 {
 public:
     static KBalooRolesProvider& instance();
index d02fc0d4787ebdf655e719d6cb789549599e651f..3ee50d6610d3ee2acd9d152c641c182827bc1135 100644 (file)
 #include <QSet>
 #include <QObject>
 
-#include "libdolphin_export.h"
+#include "dolphin_export.h"
 
 /**
  * @brief Wrapper for QClipboard to provide fast access for checking
  *        whether a KFileItem has been clipped.
  */
-class LIBDOLPHINPRIVATE_EXPORT KFileItemClipboard : public QObject
+class DOLPHIN_EXPORT KFileItemClipboard : public QObject
 {
     Q_OBJECT
 
index a9c8c845a07179070f850a26f67d1511367bd862..c2c621aed1c24ac19921eea851c280f5209b67ae 100644 (file)
@@ -20,7 +20,7 @@
 #ifndef KFILEITEMMODELDIRLISTER_H
 #define KFILEITEMMODELDIRLISTER_H
 
-#include "libdolphin_export.h"
+#include "dolphin_export.h"
 #include <KDirLister>
 #include <QUrl>
 
@@ -29,7 +29,7 @@
  *        error occurred instead of showing an error dialog.
  *        KDirLister::autoErrorHandlingEnabled() is set to false.
  */
-class LIBDOLPHINPRIVATE_EXPORT KFileItemModelDirLister : public KDirLister
+class DOLPHIN_EXPORT KFileItemModelDirLister : public KDirLister
 {
     Q_OBJECT
 
index b26e31a00582f9108c3b056df8da1da341621552..67c1c280cdeca4c95399b3d86d826da3c413968a 100644 (file)
@@ -21,7 +21,7 @@
 #ifndef KFILEITEMMODELFILTER_H
 #define KFILEITEMMODELFILTER_H
 
-#include "libdolphin_export.h"
+#include "dolphin_export.h"
 #include <QStringList>
 
 class KFileItem;
@@ -35,7 +35,7 @@ class QRegExp;
  * property of the KFileItem, but this might get extended in
  * future.
  */
-class LIBDOLPHINPRIVATE_EXPORT KFileItemModelFilter
+class DOLPHIN_EXPORT KFileItemModelFilter
 {
 
 public:
index 74c9ac5182c1fb2d68532cdf6453310505187793..307def74d0a0e4be808e6053c09081c09add215a 100644 (file)
@@ -20,7 +20,7 @@
 #ifndef KITEMLISTHEADERWIDGET_H
 #define KITEMLISTHEADERWIDGET_H
 
-#include "libdolphin_export.h"
+#include "dolphin_export.h"
 #include <QGraphicsWidget>
 #include <QHash>
 #include <QList>
@@ -33,7 +33,7 @@ class KItemModelBase;
  * The widget is an internal API, the user of KItemListView may only access the
  * class KItemListHeader.
  */
-class LIBDOLPHINPRIVATE_EXPORT KItemListHeaderWidget : public QGraphicsWidget
+class DOLPHIN_EXPORT KItemListHeaderWidget : public QGraphicsWidget
 {
     Q_OBJECT
 
index 1f315dabd3c2f7df792db78a4c6cb153c4b4cc43..2a14ca470456fffc48e6537671f12f1514d7afea 100644 (file)
@@ -23,7 +23,7 @@
 #ifndef KITEMLISTKEYBOARDSEARCHMANAGER_H
 #define KITEMLISTKEYBOARDSEARCHMANAGER_H
 
-#include "libdolphin_export.h"
+#include "dolphin_export.h"
 
 #include <QObject>
 #include <QString>
@@ -35,7 +35,7 @@
  * @see KItemListController
  * @see KItemModelBase
  */
-class LIBDOLPHINPRIVATE_EXPORT KItemListKeyboardSearchManager : public QObject
+class DOLPHIN_EXPORT KItemListKeyboardSearchManager : public QObject
 {
     Q_OBJECT
 
index 7c2b61e2d7dc2d2b415fec60526501db8398f817..3b8f96865838e33ef0945816c62fa20ced70c76c 100644 (file)
@@ -20,7 +20,7 @@
 #ifndef KITEMLISTROLEEDITOR_H
 #define KITEMLISTROLEEDITOR_H
 
-#include "libdolphin_export.h"
+#include "dolphin_export.h"
 
 #include <KTextEdit>
 
@@ -33,7 +33,7 @@
  *
  * The size automatically gets increased if the text does not fit.
  */
-class LIBDOLPHINPRIVATE_EXPORT KItemListRoleEditor : public KTextEdit
+class DOLPHIN_EXPORT KItemListRoleEditor : public KTextEdit
 {
     Q_OBJECT
 
index 39c7573aea6ab4cb9b65f8bb795cd2ab294cd6c7..b47c30c1fab00bb856b80710319a11986629c282 100644 (file)
 #ifndef KITEMLISTRUBBERBAND_H
 #define KITEMLISTRUBBERBAND_H
 
-#include "libdolphin_export.h"
+#include "dolphin_export.h"
 #include <QObject>
 #include <QPointF>
 
 /**
  * @brief Manages the rubberband when selecting items.
  */
-class LIBDOLPHINPRIVATE_EXPORT KItemListRubberBand : public QObject
+class DOLPHIN_EXPORT KItemListRubberBand : public QObject
 {
     Q_OBJECT
 
index bd64879afcf67bc2c6978560ac24d89a3b48505a..d058ee988d5db97e7aa9e982a75ab7c4e3309b19 100644 (file)
@@ -20,7 +20,7 @@
 #ifndef KITEMLISTSELECTIONTOGGLE_H
 #define KITEMLISTSELECTIONTOGGLE_H
 
-#include "libdolphin_export.h"
+#include "dolphin_export.h"
 
 #include <QGraphicsWidget>
 #include <QPixmap>
@@ -29,7 +29,7 @@
 /**
  * @brief Allows to toggle between the selected and unselected state of an item.
  */
-class LIBDOLPHINPRIVATE_EXPORT KItemListSelectionToggle : public QGraphicsWidget
+class DOLPHIN_EXPORT KItemListSelectionToggle : public QGraphicsWidget
 {
     Q_OBJECT
 
index 3bd2319dd0f7f82158a04179dfebd8159b46b679..ff17f2de20ebcc7d51132fd154da921c365e3efe 100644 (file)
@@ -20,7 +20,7 @@
 #ifndef KITEMLISTSIZEHINTRESOLVER_H
 #define KITEMLISTSIZEHINTRESOLVER_H
 
-#include "libdolphin_export.h"
+#include "dolphin_export.h"
 
 #include <kitemviews/kitemmodelbase.h>
 #include <QSizeF>
@@ -31,7 +31,7 @@ class KItemListView;
 /**
  * @brief Calculates and caches the sizehints of items in KItemListView.
  */
-class LIBDOLPHINPRIVATE_EXPORT KItemListSizeHintResolver
+class DOLPHIN_EXPORT KItemListSizeHintResolver
 {
 public:
     KItemListSizeHintResolver(const KItemListView* itemListView);
index 963cf7b249a11a77e59e773cce7d6bad525ff4f5..fca4b0c53be2d976369d0145d86d2f204af454ea 100644 (file)
@@ -20,7 +20,7 @@
 #ifndef KITEMLISTSMOOTHSCROLLER_H
 #define KITEMLISTSMOOTHSCROLLER_H
 
-#include "libdolphin_export.h"
+#include "dolphin_export.h"
 
 #include <QAbstractAnimation>
 #include <QObject>
@@ -33,7 +33,7 @@ class QWheelEvent;
  * @brief Helper class for KItemListContainer to have a smooth
  *        scrolling when adjusting the scrollbars.
  */
-class LIBDOLPHINPRIVATE_EXPORT KItemListSmoothScroller : public QObject
+class DOLPHIN_EXPORT KItemListSmoothScroller : public QObject
 {
     Q_OBJECT
 
index ed4ec49024630248d8412db28cab22e3d2cad0ee..06c81c9b873d7d3f1bf9fa88bb9de87070371733 100644 (file)
@@ -20,7 +20,7 @@
 #ifndef KITEMLISTVIEWANIMATION_H
 #define KITEMLISTVIEWANIMATION_H
 
-#include "libdolphin_export.h"
+#include "dolphin_export.h"
 
 #include <QHash>
 #include <QObject>
@@ -36,7 +36,7 @@ class QPropertyAnimation;
  * Supports item animations for moving, creating, deleting and resizing
  * an item. Several applications can be applied to one item in parallel.
  */
-class LIBDOLPHINPRIVATE_EXPORT KItemListViewAnimation : public QObject
+class DOLPHIN_EXPORT KItemListViewAnimation : public QObject
 {
     Q_OBJECT
 
index fc82d6061ddf737fe2e435ca272c3e85941f7c13..3f1cf68d45d7436101403133f66bfaecf97789d0 100644 (file)
@@ -20,7 +20,7 @@
 #ifndef KITEMLISTVIEWLAYOUTER_H
 #define KITEMLISTVIEWLAYOUTER_H
 
-#include "libdolphin_export.h"
+#include "dolphin_export.h"
 
 #include <QObject>
 #include <QRectF>
@@ -45,7 +45,7 @@ class KItemListSizeHintResolver;
  * changing properties of the layouter is not expensive, only the
  * first read of a property can get expensive.
  */
-class LIBDOLPHINPRIVATE_EXPORT KItemListViewLayouter : public QObject
+class DOLPHIN_EXPORT KItemListViewLayouter : public QObject
 {
     Q_OBJECT
 
index b5eec65426abab34b439caca8288e6722150f045..e8ca11ac1bf03ca2f3cd5adbbb8014be8d84e8cf 100644 (file)
 #ifndef KPIXMAPMODIFIER_H
 #define KPIXMAPMODIFIER_H
 
-#include "libdolphin_export.h"
+#include "dolphin_export.h"
 
 class QPixmap;
 class QSize;
 
-class LIBDOLPHINPRIVATE_EXPORT KPixmapModifier
+class DOLPHIN_EXPORT KPixmapModifier
 {
 public:
     static void scale(QPixmap& pixmap, const QSize& scaledSize);
index 63c534b30cc17e781a42115b41e9b65ab226b2e7..5490be85bfa555d4d1cb42df77d8b0ac29d35c66 100644 (file)
@@ -21,7 +21,7 @@
 #ifndef VIEWPROPERTIESDIALOG_H
 #define VIEWPROPERTIESDIALOG_H
 
-#include "libdolphin_export.h"
+#include "dolphin_export.h"
 
 #include <QDialog>
 
@@ -39,7 +39,7 @@ class DolphinView;
  * and previews should be shown. The properties can be assigned to the current folder,
  * or recursively to all sub folders.
  */
-class LIBDOLPHINPRIVATE_EXPORT ViewPropertiesDialog : public QDialog
+class DOLPHIN_EXPORT ViewPropertiesDialog : public QDialog
 {
     Q_OBJECT
 
index 1c6c5b40c33d701d3f6e40b0fb2e0541b51f5988..22a8b48491fa7ac88ce1b29aecb20192837dd7ea 100644 (file)
@@ -4,7 +4,7 @@ find_package(Qt5Test CONFIG REQUIRED)
 include(ECMMarkAsTest)
 
 # needed on windows to correctly use the files from dolphinprivate
-add_definitions(-DLIBDOLPHINPRIVATE_EXPORT=)
+add_definitions(-DDOLPHIN_EXPORT=)
 
 # KItemSetTest
 set(kitemsettest_SRCS
index e8345435eb126db62c92b6d5ff03661089e4c43f..f152308410ceeaf1769a2e780ad3ecffc7b4d57d 100644 (file)
@@ -21,7 +21,6 @@
 
 #include <QIcon>
 #include <KIconLoader>
-#include <kversioncontrolplugin2.h>
 #include <QColor>
 
 #include "dolphindebug.h"
@@ -43,7 +42,7 @@ void DolphinFileItemListWidget::refreshCache()
     if (values.contains("version")) {
         // The item is under version control. Apply the text color corresponding
         // to its version state.
-        const KVersionControlPlugin2::ItemVersion version = static_cast<KVersionControlPlugin2::ItemVersion>(values.value("version").toInt());
+        const KVersionControlPlugin::ItemVersion version = static_cast<KVersionControlPlugin::ItemVersion>(values.value("version").toInt());
         const QColor textColor = styleOption().palette.text().color();
         QColor tintColor = textColor;
 
@@ -51,16 +50,16 @@ void DolphinFileItemListWidget::refreshCache()
         // as tint colors and are mixed with the current set text color. The tint colors
         // have been optimized for the base colors of the corresponding Oxygen emblems.
         switch (version) {
-        case KVersionControlPlugin2::UpdateRequiredVersion:          tintColor = Qt::yellow; break;
-        case KVersionControlPlugin2::LocallyModifiedUnstagedVersion: tintColor = Qt::green; break;
-        case KVersionControlPlugin2::LocallyModifiedVersion:         tintColor = Qt::green; break;
-        case KVersionControlPlugin2::AddedVersion:                   tintColor = Qt::green; break;
-        case KVersionControlPlugin2::RemovedVersion:                 tintColor = Qt::darkRed; break;
-        case KVersionControlPlugin2::ConflictingVersion:             tintColor = Qt::red; break;
-        case KVersionControlPlugin2::IgnoredVersion:                 tintColor = Qt::white; break;
-        case KVersionControlPlugin2::MissingVersion:                 tintColor = Qt::red; break;
-        case KVersionControlPlugin2::NormalVersion:
-        case KVersionControlPlugin2::UnversionedVersion:
+        case KVersionControlPlugin::UpdateRequiredVersion:          tintColor = Qt::yellow; break;
+        case KVersionControlPlugin::LocallyModifiedUnstagedVersion: tintColor = Qt::green; break;
+        case KVersionControlPlugin::LocallyModifiedVersion:         tintColor = Qt::green; break;
+        case KVersionControlPlugin::AddedVersion:                   tintColor = Qt::green; break;
+        case KVersionControlPlugin::RemovedVersion:                 tintColor = Qt::darkRed; break;
+        case KVersionControlPlugin::ConflictingVersion:             tintColor = Qt::red; break;
+        case KVersionControlPlugin::IgnoredVersion:                 tintColor = Qt::white; break;
+        case KVersionControlPlugin::MissingVersion:                 tintColor = Qt::red; break;
+        case KVersionControlPlugin::NormalVersion:
+        case KVersionControlPlugin::UnversionedVersion:
         default:
             break;
         }
@@ -78,7 +77,7 @@ void DolphinFileItemListWidget::refreshCache()
     setTextColor(color);
 }
 
-QPixmap DolphinFileItemListWidget::overlayForState(KVersionControlPlugin2::ItemVersion version, int size)
+QPixmap DolphinFileItemListWidget::overlayForState(KVersionControlPlugin::ItemVersion version, int size)
 {
     int overlayHeight = KIconLoader::SizeSmall;
     if (size >= KIconLoader::SizeEnormous) {
@@ -115,8 +114,8 @@ QPixmap DolphinFileItemListWidget::overlayForState(KVersionControlPlugin2::ItemV
         iconName = "vcs-conflicting";
         break;
     case KVersionControlPlugin::UnversionedVersion:
-    case KVersionControlPlugin2::IgnoredVersion:
-    case KVersionControlPlugin2::MissingVersion:
+    case KVersionControlPlugin::IgnoredVersion:
+    case KVersionControlPlugin::MissingVersion:
         break;
     default:
         Q_ASSERT(false);
index 5f9cc3a5ab42d7cc406426c9cf76ca8eb64d7ed8..af73ac9377de712fd3ec0c8572fb536fc51d8ff9 100644 (file)
 #ifndef DOLPHINFILEITEMLISTWIDGET_H
 #define DOLPHINFILEITEMLISTWIDGET_H
 
-#include "libdolphin_export.h"
+#include "dolphin_export.h"
 
 #include <kitemviews/kfileitemlistwidget.h>
-#include <kversioncontrolplugin2.h>
+#include "versioncontrol/kversioncontrolplugin.h"
 
 /**
  * @brief Extends KFileItemListWidget to handle the "version" role.
@@ -31,7 +31,7 @@
  * The "version" role is set if version-control-plugins have been enabled.
  * @see KVersionControlPlugin
  */
-class LIBDOLPHINPRIVATE_EXPORT DolphinFileItemListWidget : public KFileItemListWidget
+class DOLPHIN_EXPORT DolphinFileItemListWidget : public KFileItemListWidget
 {
     Q_OBJECT
 
@@ -43,7 +43,7 @@ protected:
     virtual void refreshCache() Q_DECL_OVERRIDE;
 
 private:
-    static QPixmap overlayForState(KVersionControlPlugin2::ItemVersion version, int size);
+    static QPixmap overlayForState(KVersionControlPlugin::ItemVersion version, int size);
 
 };
 
index 2b16825f4f244bd29f110a9f500857a99e123d4a..7eec6f17afbc1e4ed900e30f79db6ed52116fb8a 100644 (file)
@@ -23,7 +23,7 @@
 #include <kitemviews/kfileitemlistview.h>
 #include <settings/viewmodes/viewmodesettings.h>
 
-#include "libdolphin_export.h"
+#include "dolphin_export.h"
 
 class KFileItemListView;
 
@@ -34,7 +34,7 @@ class KFileItemListView;
  * the view-properties into the corresponding KItemListView
  * properties.
  */
-class LIBDOLPHINPRIVATE_EXPORT DolphinItemListView : public KFileItemListView
+class DOLPHIN_EXPORT DolphinItemListView : public KFileItemListView
 {
     Q_OBJECT
 
index b9b18e2298fa732d2b318c0d8bc3d11ae199f9ba..df4621f171bf91d65c2c5a9cc2895316f2c96219 100644 (file)
@@ -22,7 +22,7 @@
 
 #include <QObject>
 
-#include "libdolphin_export.h"
+#include "dolphin_export.h"
 
 class DolphinNewFileMenu;
 
@@ -33,7 +33,7 @@ class DolphinNewFileMenu;
  * As soon as a DolphinNewFileMenu instance created a new item,
  * the observer will emit the signal itemCreated().
  */
-class LIBDOLPHINPRIVATE_EXPORT DolphinNewFileMenuObserver : public QObject
+class DOLPHIN_EXPORT DolphinNewFileMenuObserver : public QObject
 {
     Q_OBJECT
 
index 0351abad7f468fc90c7b2a51a06e216295df0baf..28ff52cb3ff7ab3c8d2a29af11896611cf9318d2 100644 (file)
@@ -23,7 +23,7 @@
 #include <QStringList>
 #include <QAction>
 #include <QUrl>
-#include "libdolphin_export.h"
+#include "dolphin_export.h"
 
 
 class KActionMenu;
@@ -35,7 +35,7 @@ class DolphinViewActionHandler;
  * When browsing remote url, its possible to change encoding from Tools Menu.
  */
 
-class LIBDOLPHINPRIVATE_EXPORT DolphinRemoteEncoding: public QObject
+class DOLPHIN_EXPORT DolphinRemoteEncoding: public QObject
 {
   Q_OBJECT
 public:
index aa4492bc35fbc8b37b0fc82291a2545017bcc706..24b560f1005c74941cc23951d00622cf65c8f973 100644 (file)
@@ -23,7 +23,7 @@
 
 #include <config-baloo.h>
 
-#include "libdolphin_export.h"
+#include "dolphin_export.h"
 
 #include <kparts/part.h>
 #include <KFileItem>
@@ -57,7 +57,7 @@ class QRegExp;
  * - show previews
  * - enable grouping
  */
-class LIBDOLPHINPRIVATE_EXPORT DolphinView : public QWidget
+class DOLPHIN_EXPORT DolphinView : public QWidget
 {
     Q_OBJECT
 
index bf664f73172a3cf408c596f89d91732b2b8b5f86..eb375b5c9d460223864d66bf3244e202f206f6ea 100644 (file)
@@ -22,7 +22,7 @@
 #ifndef DOLPHINVIEWACTIONHANDLER_H
 #define DOLPHINVIEWACTIONHANDLER_H
 
-#include "libdolphin_export.h"
+#include "dolphin_export.h"
 #include "views/dolphinview.h"
 #include <QObject>
 
@@ -46,7 +46,7 @@ class KActionCollection;
  * @see DolphinMainWindow
  * @see DolphinPart
  */
-class LIBDOLPHINPRIVATE_EXPORT DolphinViewActionHandler : public QObject
+class DOLPHIN_EXPORT DolphinViewActionHandler : public QObject
 {
     Q_OBJECT
 
index 0fbe3a128223f2fecdca4572011ab1193f054bd7..fe77b1e6ee9bc017613bbdf77e074c9daea064c9 100644 (file)
@@ -21,7 +21,7 @@
 #ifndef DRAGANDDROPHELPER_H
 #define DRAGANDDROPHELPER_H
 
-#include "libdolphin_export.h"
+#include "dolphin_export.h"
 
 
 class QUrl;
@@ -29,7 +29,7 @@ class QDropEvent;
 class QWidget;
 namespace KIO { class DropJob; }
 
-class LIBDOLPHINPRIVATE_EXPORT DragAndDropHelper
+class DOLPHIN_EXPORT DragAndDropHelper
 {
 public:
     /**
index 7c02d1b8730df63a0f582ac526de4230ecb2bc15..a1953e8b35e6afdb7379586493f76ea854b0a71a 100644 (file)
@@ -20,7 +20,7 @@
 #ifndef RENAMEDIALOG_H
 #define RENAMEDIALOG_H
 
-#include "libdolphin_export.h"
+#include "dolphin_export.h"
 
 #include <QDialog>
 #include <KFileItem>
@@ -33,7 +33,7 @@ class QPushButton;
 /**
  * @brief Dialog for renaming a variable number of files.
  */
-class LIBDOLPHINPRIVATE_EXPORT RenameDialog : public QDialog
+class DOLPHIN_EXPORT RenameDialog : public QDialog
 {
     Q_OBJECT
 
diff --git a/src/views/versioncontrol/kversioncontrolplugin.cpp b/src/views/versioncontrol/kversioncontrolplugin.cpp
new file mode 100644 (file)
index 0000000..2c06328
--- /dev/null
@@ -0,0 +1,29 @@
+/*****************************************************************************
+ * Copyright (C) 2011 by Vishesh Yadav <vishesh3y@gmail.com>                 *
+ * Copyright (C) 2011 by Peter Penz <peter.penz19@gmail.com>                 *
+ *                                                                           *
+ * This library is free software; you can redistribute it and/or             *
+ * modify it under the terms of the GNU Library General Public               *
+ * License version 2 as published by the Free Software Foundation.           *
+ *                                                                           *
+ * This library is distributed in the hope that it will be useful,           *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU         *
+ * Library General Public License for more details.                          *
+ *                                                                           *
+ * You should have received a copy of the GNU Library General Public License *
+ * along with this library; see the file COPYING.LIB.  If not, write to      *
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,      *
+ * Boston, MA 02110-1301, USA.                                               *
+ *****************************************************************************/
+
+#include "kversioncontrolplugin.h"
+
+KVersionControlPlugin::KVersionControlPlugin(QObject* parent) :
+    QObject(parent)
+{
+}
+
+KVersionControlPlugin::~KVersionControlPlugin()
+{
+}
diff --git a/src/views/versioncontrol/kversioncontrolplugin.h b/src/views/versioncontrol/kversioncontrolplugin.h
new file mode 100644 (file)
index 0000000..e5a2678
--- /dev/null
@@ -0,0 +1,223 @@
+/*****************************************************************************
+ * Copyright (C) 2011 by Vishesh Yadav <vishesh3y@gmail.com>                 *
+ * Copyright (C) 2011 by Peter Penz <peter.penz19@gmail.com>                 *
+ *                                                                           *
+ * This library is free software; you can redistribute it and/or             *
+ * modify it under the terms of the GNU Library General Public               *
+ * License version 2 as published by the Free Software Foundation.           *
+ *                                                                           *
+ * This library is distributed in the hope that it will be useful,           *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU         *
+ * Library General Public License for more details.                          *
+ *                                                                           *
+ * You should have received a copy of the GNU Library General Public License *
+ * along with this library; see the file COPYING.LIB.  If not, write to      *
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,      *
+ * Boston, MA 02110-1301, USA.                                               *
+ *****************************************************************************/
+
+#ifndef KVERSIONCONTROLPLUGIN_H
+#define KVERSIONCONTROLPLUGIN_H
+
+#include <dolphin_export.h>
+
+#include <QObject>
+#include <KFileItem>
+#include <QAction>
+
+/**
+ * @brief Base class for version control plugins.
+ *
+ * Enables the file manager to show the version state
+ * of a versioned file. To write a custom plugin, the following
+ * steps are required (in the example below it is assumed that a plugin for
+ * Subversion will be written):
+ *
+ * - Create a fileviewsvnplugin.desktop file with the following content:
+ *   <code>
+ *   [Desktop Entry]
+ *   Type=Service
+ *   Name=Subversion
+ *   X-KDE-ServiceTypes=FileViewVersionControlPlugin
+ *   MimeType=text/plain;
+ *   X-KDE-Library=fileviewsvnplugin
+ *   </code>
+ *
+ * - Create a class FileViewSvnPlugin derived from KVersionControlPlugin and
+ *   implement all abstract interfaces (fileviewsvnplugin.h, fileviewsvnplugin.cpp).
+ *
+ * - Take care that the constructor has the following signature:
+ *   <code>
+ *   FileViewSvnPlugin(QObject* parent, const QList<QVariant>& args);
+ *   </code>
+ *
+ * - Add the following lines at the top of fileviewsvnplugin.cpp:
+ *   <code>
+ *   #include <KPluginFactory>
+ *   #include <KPluginLoader>
+ *   K_PLUGIN_FACTORY(FileViewSvnPluginFactory, registerPlugin<FileViewSvnPlugin>();)
+ *   K_EXPORT_PLUGIN(FileViewSvnPluginFactory("fileviewsvnplugin"))
+ *   </code>
+ *
+ * - Add the following lines to your CMakeLists.txt file:
+ *   <code>
+ *   kde4_add_plugin(fileviewsvnplugin fileviewsvnplugin.cpp)
+ *   target_link_libraries(fileviewsvnplugin konq)
+ *   install(FILES fileviewsvnplugin.desktop DESTINATION ${SERVICES_INSTALL_DIR})
+ *   </code>
+ *
+ * General implementation notes:
+ *
+ *  - The implementations of beginRetrieval(), endRetrieval() and versionState()
+ *    can contain blocking operations, as Dolphin will execute
+ *    those methods in a separate thread. It is assured that
+ *    all other methods are invoked in a serialized way, so that it is not necessary for
+ *    the plugin to use any mutex.
+ *
+ * -  Dolphin keeps only one instance of the plugin, which is instantiated shortly after
+ *    starting Dolphin. Take care that the constructor does no expensive and time
+ *    consuming operations.
+ *
+ * @since 4.8
+ */
+class DOLPHIN_EXPORT KVersionControlPlugin : public QObject
+{
+    Q_OBJECT
+
+public:
+    enum ItemVersion
+    {
+        /** The file is not under version control. */
+        UnversionedVersion,
+        /**
+         * The file is under version control and represents
+         * the latest version.
+         */
+        NormalVersion,
+        /**
+         * The file is under version control and a newer
+         * version exists on the main branch.
+         */
+        UpdateRequiredVersion,
+        /**
+         * The file is under version control and has been
+         * modified locally. All modifications will be part
+         * of the next commit.
+         */
+        LocallyModifiedVersion,
+        /**
+         * The file has not been under version control but
+         * has been marked to get added with the next commit.
+         */
+        AddedVersion,
+        /**
+         * The file is under version control but has been marked
+         * for getting removed with the next commit.
+         */
+        RemovedVersion,
+        /**
+         * The file is under version control and has been locally
+         * modified. A modification has also been done on the main
+         * branch.
+         */
+        ConflictingVersion,
+        /**
+         * The file is under version control and has local
+         * modifications, which will not be part of the next
+         * commit (or are "unstaged" in git jargon).
+         * @since 4.6
+         */
+        LocallyModifiedUnstagedVersion,
+        /**
+         * The file is not under version control and is listed
+         * in the ignore list of the version control system.
+         * @since 4.8
+         */
+        IgnoredVersion,
+        /**
+         * The file is is tracked by the version control system, but
+         * is missing in the directory (e.g. by deleted without using
+         * a version control command).
+         * @since 4.8
+         */
+        MissingVersion
+    };
+
+    KVersionControlPlugin(QObject* parent = 0);
+    virtual ~KVersionControlPlugin();
+
+    /**
+     * Returns the name of the file which stores
+     * the version controls information.
+     * (e. g. .svn, .cvs, .git).
+     */
+    virtual QString fileName() const = 0;
+
+    /**
+     * Is invoked whenever the version control
+     * information will get retrieved for the directory
+     * \p directory. It is assured that the directory
+     * contains a trailing slash.
+     */
+    virtual bool beginRetrieval(const QString& directory) = 0;
+
+    /**
+     * Is invoked after the version control information has been
+     * received. It is assured that
+     * KVersionControlPluginV2::beginInfoRetrieval() has been
+     * invoked before.
+     */
+    virtual void endRetrieval() = 0;
+
+    /**
+     * @return The version for the item \p item.
+     *         It is assured that KVersionControlPlugin::beginInfoRetrieval() has been
+     *         invoked before and that the file is part of the directory specified
+     *         in beginInfoRetrieval().
+     */
+    virtual ItemVersion itemVersion(const KFileItem& item) const = 0;
+
+    /**
+     * @return List of actions that are available for the items \p items.
+     *         It is recommended to keep the number of returned actions small
+     *         in case if an item is an unversioned directory that is not
+     *         inside the hierarchy tree of the version control system. This
+     *         prevents having a cluttered context menu for directories
+     *         outside the version control system.
+     */
+    virtual QList<QAction*> actions(const KFileItemList& items) const = 0;
+
+Q_SIGNALS:
+    /**
+     * Should be emitted when the version state of items might have been changed
+     * after the last retrieval (e. g. by executing a context menu action
+     * of the version control plugin). The file manager will be triggered to
+     * update the version states of the directory \p directory by invoking
+     * KVersionControlPlugin::beginRetrieval(),
+     * KVersionControlPlugin::itemVersion() and
+     * KVersionControlPlugin::endRetrieval().
+     */
+    void itemVersionsChanged();
+
+    /**
+     * Is emitted if an information message with the content \a msg
+     * should be shown.
+     */
+    void infoMessage(const QString& msg);
+
+    /**
+     * Is emitted if an error message with the content \a msg
+     * should be shown.
+     */
+    void errorMessage(const QString& msg);
+
+    /**
+     * Is emitted if an "operation completed" message with the content \a msg
+     * should be shown.
+     */
+    void operationCompletedMessage(const QString& msg);
+};
+
+#endif // KVERSIONCONTROLPLUGIN_H
+
index 4f0122e0f1db1431391dbca0e85c88bc19dcf74c..e4413fabfb4752e69da51a3879a15427f2a00500 100644 (file)
@@ -19,9 +19,7 @@
 
 #include "updateitemstatesthread.h"
 
-#include <kversioncontrolplugin2.h>
 #include <QVector>
-
 #include <QMutexLocker>
 
 UpdateItemStatesThread::UpdateItemStatesThread(KVersionControlPlugin* plugin,
@@ -53,20 +51,10 @@ void UpdateItemStatesThread::run()
         if (m_plugin->beginRetrieval(it.key())) {
             QVector<VersionControlObserver::ItemState>& items = it.value();
             const int count = items.count();
-
-            KVersionControlPlugin2* pluginV2 = qobject_cast<KVersionControlPlugin2*>(m_plugin);
-            if (pluginV2) {
-                for (int i = 0; i < count; ++i) {
-                    const KFileItem& item = items.at(i).first;
-                    const KVersionControlPlugin2::ItemVersion version = pluginV2->itemVersion(item);
-                    items[i].second = version;
-                }
-            } else {
-                for (int i = 0; i < count; ++i) {
-                    const KFileItem& item = items.at(i).first;
-                    const KVersionControlPlugin::VersionState state = m_plugin->versionState(item);
-                    items[i].second = static_cast<KVersionControlPlugin2::ItemVersion>(state);
-                }
+            for (int i = 0; i < count; ++i) {
+                const KFileItem& item = items.at(i).first;
+                const KVersionControlPlugin::ItemVersion version = m_plugin->itemVersion(item);
+                items[i].second = version;
             }
         }
 
index 92a9d59c9d5c92219839220c6fc80b6ba1a4033b..3dc03fc75bdfb7884e3f451064254a7644b16488 100644 (file)
 #ifndef UPDATEITEMSTATESTHREAD_H
 #define UPDATEITEMSTATESTHREAD_H
 
-#include "libdolphin_export.h"
+#include "dolphin_export.h"
 #include <views/versioncontrol/versioncontrolobserver.h>
 
 #include <QMutex>
 #include <QThread>
 
-class KVersionControlPlugin;
-
 /**
  * The performance of updating the version state of items depends
  * on the used plugin. To prevent that Dolphin gets blocked by a
  * slow plugin, the updating is delegated to a thread.
  */
-class LIBDOLPHINPRIVATE_EXPORT UpdateItemStatesThread : public QThread
+class DOLPHIN_EXPORT UpdateItemStatesThread : public QThread
 {
     Q_OBJECT
 
index 47e3da357a01a6329bacdb1f0fe45bad64f940e7..13481cc7a82a7b7bfcfae1b92c2e7b798cdc38a2 100644 (file)
@@ -26,7 +26,6 @@
 #include "dolphindebug.h"
 #include <KServiceTypeTrader>
 #include <kitemviews/kfileitemmodel.h>
-#include <kversioncontrolplugin2.h>
 
 #include "updateitemstatesthread.h"
 
@@ -89,8 +88,6 @@ KFileItemModel* VersionControlObserver::model() const
 
 QList<QAction*> VersionControlObserver::actions(const KFileItemList& items) const
 {
-    QList<QAction*> actions;
-
     bool hasNullItems = false;
     foreach (const KFileItem& item, items) {
         if (item.isNull()) {
@@ -101,30 +98,10 @@ QList<QAction*> VersionControlObserver::actions(const KFileItemList& items) cons
     }
 
     if (!m_model || hasNullItems) {
-        return actions;
-    }
-
-    KVersionControlPlugin2* pluginV2 = qobject_cast<KVersionControlPlugin2*>(m_plugin);
-    if (pluginV2) {
-        // Use version 2 of the KVersionControlPlugin which allows providing actions
-        // also for non-versioned directories.
-        actions = pluginV2->actions(items);
-    } else if (isVersioned()) {
-        // Support deprecated interfaces from KVersionControlPlugin version 1.
-        // Context menu actions where only available for versioned directories.
-        QString directory;
-        if (items.count() == 1) {
-            const KFileItem rootItem = m_model->rootItem();
-            if (!rootItem.isNull() && items.first().url() == rootItem.url()) {
-                directory = rootItem.url().path();
-            }
-        }
-
-        actions = directory.isEmpty() ? m_plugin->contextMenuActions(items)
-                                      : m_plugin->contextMenuActions(directory);
+        return {};
     }
 
-    return actions;
+    return m_plugin->actions(items);
 }
 
 void VersionControlObserver::delayedDirectoryVerification()
@@ -156,14 +133,8 @@ void VersionControlObserver::verifyDirectory()
 
     m_plugin = searchPlugin(rootItem.url());
     if (m_plugin) {
-        KVersionControlPlugin2* pluginV2 = qobject_cast<KVersionControlPlugin2*>(m_plugin);
-        if (pluginV2) {
-            connect(pluginV2, &KVersionControlPlugin2::itemVersionsChanged,
-                    this, &VersionControlObserver::silentDirectoryVerification);
-        } else {
-            connect(m_plugin, &KVersionControlPlugin::versionStatesChanged,
-                    this, &VersionControlObserver::silentDirectoryVerification);
-        }
+        connect(m_plugin, &KVersionControlPlugin::itemVersionsChanged,
+                this, &VersionControlObserver::silentDirectoryVerification);
         connect(m_plugin, &KVersionControlPlugin::infoMessage,
                 this, &VersionControlObserver::infoMessage);
         connect(m_plugin, &KVersionControlPlugin::errorMessage,
@@ -205,7 +176,7 @@ void VersionControlObserver::slotThreadFinished()
 
         foreach (const ItemState& item, items) {
             const KFileItem& fileItem = item.first;
-            const KVersionControlPlugin2::ItemVersion version = item.second;
+            const KVersionControlPlugin::ItemVersion version = item.second;
             QHash<QByteArray, QVariant> values;
             values.insert("version", QVariant(version));
             m_model->setData(m_model->index(fileItem), values);
@@ -268,7 +239,7 @@ int VersionControlObserver::createItemStatesList(QMap<QString, QVector<ItemState
         if (expansionLevel == currentExpansionLevel) {
             ItemState itemState;
             itemState.first = m_model->fileItem(index);
-            itemState.second = KVersionControlPlugin2::UnversionedVersion;
+            itemState.second = KVersionControlPlugin::UnversionedVersion;
 
             items.append(itemState);
         } else if (expansionLevel > currentExpansionLevel) {
index a43dc3415e313dac5eb24344624ecdbcbff454de..c817c21879c3dd38bbdb733302560f2ce4fa6eb9 100644 (file)
 #ifndef VERSIONCONTROLOBSERVER_H
 #define VERSIONCONTROLOBSERVER_H
 
-#include "libdolphin_export.h"
+#include "dolphin_export.h"
+
+#include "kversioncontrolplugin.h"
 
 #include <KFileItem>
+
 #include <QUrl>
-#include <kversioncontrolplugin2.h>
 #include <QList>
 #include <QObject>
 #include <QString>
@@ -43,7 +45,7 @@ class UpdateItemStatesThread;
  *
  * @see VersionControlPlugin
  */
-class LIBDOLPHINPRIVATE_EXPORT VersionControlObserver : public QObject
+class DOLPHIN_EXPORT VersionControlObserver : public QObject
 {
     Q_OBJECT
 
@@ -100,7 +102,7 @@ private slots:
     void slotThreadFinished();
 
 private:
-    typedef QPair<KFileItem, KVersionControlPlugin2::ItemVersion> ItemState;
+    typedef QPair<KFileItem, KVersionControlPlugin::ItemVersion> ItemState;
 
     void updateItemStates();
 
index 89f1020b556da69c6a761c2390b751ff5075683d..4b1ff2083e7335960b8a307ad33e5b446119872d 100644 (file)
@@ -22,7 +22,7 @@
 
 #include <QUrl>
 #include <QObject>
-#include "libdolphin_export.h"
+#include "dolphin_export.h"
 #include <views/dolphinview.h>
 
 /**
@@ -33,7 +33,7 @@
  * connect to signals of the ViewModeController to react on changes. The view
  * implementations get only read-access to the ViewModeController.
  */
-class LIBDOLPHINPRIVATE_EXPORT ViewModeController : public QObject
+class DOLPHIN_EXPORT ViewModeController : public QObject
 {
     Q_OBJECT
 
index b9c2fa546737378af587d63264c903e15c367cf3..dc118e2d761f16d8c8b7069b8e8216a9855ee9ef 100644 (file)
@@ -23,7 +23,7 @@
 
 #include <views/dolphinview.h>
 #include <QUrl>
-#include "libdolphin_export.h"
+#include "dolphin_export.h"
 
 class ViewPropertySettings;
 /**
@@ -47,7 +47,7 @@ class ViewPropertySettings;
  * (see GeneralSettings::globalViewMode()), the values from the global .directory file
  * are used for initialization.
  */
-class LIBDOLPHINPRIVATE_EXPORT ViewProperties
+class DOLPHIN_EXPORT ViewProperties
 {
 public:
     explicit ViewProperties(const QUrl& url);