]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/views/versioncontrol/versioncontrolobserver.h
For VCS-plugin interface added pure virtual function outOfVersionControlActions()
[dolphin.git] / src / views / versioncontrol / versioncontrolobserver.h
index 2c2fe2940c3ebf793f33be689ef18ad08dde9f6d..648c9d6fdfd126b9fce238f8cd8302f9ae3a9483 100644 (file)
 
 #include <KFileItem>
 
-#include <QUrl>
 #include <QList>
 #include <QObject>
 #include <QString>
+#include <QUrl>
 
 class KFileItemList;
 class KFileItemModel;
+class KItemRangeList;
 class QAction;
 class QTimer;
 class UpdateItemStatesThread;
 
+class DolphinView;
+
 /**
  * @brief Observes all version control plugins.
  *
@@ -55,6 +58,8 @@ public:
 
     void setModel(KFileItemModel* model);
     KFileItemModel* model() const;
+    void setView(DolphinView* view);
+    DolphinView* view() const;
 
     QList<QAction*> actions(const KFileItemList& items) const;
 
@@ -93,6 +98,12 @@ private slots:
      */
     void silentDirectoryVerification();
 
+    /**
+     * Invokes delayedDirectoryVerification() only if the itemsChanged() signal has not
+     * been triggered by the VCS plugin itself.
+     */
+    void slotItemsChanged(const KItemRangeList& itemRanges, const QSet<QByteArray>& roles);
+
     void verifyDirectory();
 
     /**
@@ -103,6 +114,7 @@ private slots:
 
 private:
     typedef QPair<KFileItem, KVersionControlPlugin::ItemVersion> ItemState;
+    typedef QPair<KVersionControlPlugin*, QString> VCSPlugin;
 
     void updateItemStates();
 
@@ -126,12 +138,12 @@ private:
      * Returns a matching plugin for the given directory.
      * 0 is returned, if no matching plugin has been found.
      */
-    KVersionControlPlugin* searchPlugin(const QUrl& directory) const;
+    KVersionControlPlugin* searchPlugin(const QUrl& directory);
 
     /**
      * Returns true, if the directory contains a version control information.
      */
-    bool isVersioned() const;
+    bool isVersionControlled() const;
 
 private:
     bool m_pendingItemStatesUpdate;
@@ -139,11 +151,14 @@ private:
     bool m_silentUpdate; // if true, no messages will be send during the update
                          // of version states
 
+    DolphinView* m_view;
     KFileItemModel* m_model;
 
     QTimer* m_dirVerificationTimer;
 
+    bool m_pluginsInitialized;
     KVersionControlPlugin* m_plugin;
+    QList<VCSPlugin> m_plugins;
     UpdateItemStatesThread* m_updateItemStatesThread;
 
     friend class UpdateItemStatesThread;