X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/c7ef72de5563ae33e9342526cb33d67498de0759..c8d8556950005dfd96ebdb41d2f43ad90356367c:/src/views/versioncontrol/versioncontrolobserver.h diff --git a/src/views/versioncontrol/versioncontrolobserver.h b/src/views/versioncontrol/versioncontrolobserver.h index 214c072cd..501af7d6f 100644 --- a/src/views/versioncontrol/versioncontrolobserver.h +++ b/src/views/versioncontrol/versioncontrolobserver.h @@ -23,17 +23,14 @@ #include #include -#include +#include #include #include #include -#include #include -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,11 +48,13 @@ class LIBDOLPHINPRIVATE_EXPORT VersionControlObserver : public QObject Q_OBJECT public: - VersionControlObserver(QAbstractItemView* view); + explicit VersionControlObserver(QObject* parent = 0); virtual ~VersionControlObserver(); - QList contextMenuActions(const KFileItemList& items) const; - QList contextMenuActions(const QString& directory) const; + void setModel(KFileItemModel* model); + KFileItemModel* model() const; + + QList actions(const KFileItemList& items) const; signals: /** @@ -103,19 +102,13 @@ private slots: private: struct ItemState { - QPersistentModelIndex index; + int index; KFileItem item; - KVersionControlPlugin::VersionState version; + KVersionControlPlugin2::ItemVersion version; }; void updateItemStates(); - /** - * Adds recursively all items from the directory \p parentIndex into - * the list \p itemStates. - */ - void addDirectory(const QModelIndex& parentIndex, QList& itemStates); - /** * Returns a matching plugin for the given directory. * 0 is returned, if no matching plugin has been found. @@ -133,9 +126,7 @@ private: bool m_silentUpdate; // if true, no messages will be send during the update // of version states - QAbstractItemView* m_view; - KDirLister* m_dirLister; - DolphinModel* m_dolphinModel; + KFileItemModel* m_model; QTimer* m_dirVerificationTimer;