┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/views/versioncontrol/versioncontrolobserver.h
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2011-09-06 23:42:42 +0200
committerPeter Penz <[email protected]>2011-09-06 23:45:41 +0200
commitb8c718a6fd9810f9e91303ed50402de4ab417a49 (patch)
treef6e22b028cb0932c44dc29ea6c494f121c6f8dc9 /src/views/versioncontrol/versioncontrolobserver.h
parent7a91492cff931c0c4e0d38dd0aee77d9dcb29373 (diff)
First step to reactivate version control plugin functionality
- Add a DolphinFileItemListWidget that provides icon-overlays and colored text for the version state (implementation is missing yet) - Allow KFileItemListWidget to have custom text colors - Update interface of VersionControlObserver to work with KFileItemModel instead of the old model-interface.
Diffstat (limited to 'src/views/versioncontrol/versioncontrolobserver.h')
-rw-r--r--src/views/versioncontrol/versioncontrolobserver.h22
1 files changed, 10 insertions, 12 deletions
diff --git a/src/views/versioncontrol/versioncontrolobserver.h b/src/views/versioncontrol/versioncontrolobserver.h
index 71405fabd..88c764baf 100644
--- a/src/views/versioncontrol/versioncontrolobserver.h
+++ b/src/views/versioncontrol/versioncontrolobserver.h
@@ -27,13 +27,10 @@
#include <QList>
#include <QMutex>
#include <QObject>
-#include <QPersistentModelIndex>
#include <QString>
-class DolphinModel;
-class KDirLister;
class KFileItemList;
-class QAbstractItemView;
+class KFileItemModel;
class QAction;
class QTimer;
class UpdateItemStatesThread;
@@ -41,8 +38,8 @@ class UpdateItemStatesThread;
/**
* @brief Observes all version control plugins.
*
- * The item view gets updated automatically if the currently shown
- * directory is under version control.
+ * The items of the directory-model get updated automatically if the currently
+ * shown directory is under version control.
*
* @see VersionControlPlugin
*/
@@ -51,9 +48,12 @@ class LIBDOLPHINPRIVATE_EXPORT VersionControlObserver : public QObject
Q_OBJECT
public:
- VersionControlObserver(QWidget* parent);
+ explicit VersionControlObserver(QObject* parent = 0);
virtual ~VersionControlObserver();
+ void setModel(KFileItemModel* model);
+ KFileItemModel* model() const;
+
QList<QAction*> contextMenuActions(const KFileItemList& items) const;
QList<QAction*> contextMenuActions(const QString& directory) const;
@@ -103,7 +103,7 @@ private slots:
private:
struct ItemState
{
- QPersistentModelIndex index;
+ int index;
KFileItem item;
KVersionControlPlugin::VersionState version;
};
@@ -114,7 +114,7 @@ private:
* Adds recursively all items from the directory \p parentIndex into
* the list \p itemStates.
*/
- void addDirectory(const QModelIndex& parentIndex, QList<ItemState>& itemStates);
+ //void addDirectory(const QModelIndex& parentIndex, QList<ItemState>& itemStates);
/**
* Returns a matching plugin for the given directory.
@@ -133,9 +133,7 @@ private:
bool m_silentUpdate; // if true, no messages will be send during the update
// of version states
- QWidget* m_view;
- //KDirLister* m_dirLister;
- //DolphinModel* m_dolphinModel;
+ KFileItemModel* m_model;
QTimer* m_dirVerificationTimer;