diff options
| author | Peter Penz <[email protected]> | 2009-07-12 14:00:45 +0000 |
|---|---|---|
| committer | Peter Penz <[email protected]> | 2009-07-12 14:00:45 +0000 |
| commit | fa4680cb38028aceb68d41e1937d27c71d1f121b (patch) | |
| tree | da709625c38a42bf448077d985c75b0365a58252 /src/dolphinmodel.h | |
| parent | 2df2d4ea7ee63a43a327b4ffb1c5cddd176aff91 (diff) | |
Enable Dolphin to show the revision states of files that are under revision control systems like SVN, Git, CVS, ... The current code is an early draft and it is planned that all plugins (SVN, Git, CVS, ...) are maintained outside Dolphin. If the API is stable enough, a discussion will be done at [email protected] regarding the location of the plugins (the current implementation of SubversionPlugin is only temporary located in Dolphin for testing purposes).
RevisionControlObserver is implemented in a way that no recognizable slowdown is given for directories that are not under revision control.
CCBUG: 192158
svn path=/trunk/KDE/kdebase/apps/; revision=995351
Diffstat (limited to 'src/dolphinmodel.h')
| -rw-r--r-- | src/dolphinmodel.h | 38 |
1 files changed, 20 insertions, 18 deletions
diff --git a/src/dolphinmodel.h b/src/dolphinmodel.h index 44067f5a5..b03507dc5 100644 --- a/src/dolphinmodel.h +++ b/src/dolphinmodel.h @@ -22,43 +22,45 @@ #define DOLPHINMODEL_H #include <kdirmodel.h> - #include <libdolphin_export.h> -class LIBDOLPHINPRIVATE_EXPORT DolphinModel - : public KDirModel +#include <QHash> +#include <QPersistentModelIndex> + +class LIBDOLPHINPRIVATE_EXPORT DolphinModel : public KDirModel { + Q_OBJECT + public: enum AdditionalColumns { - Rating = ColumnCount, // ColumnCount defined at KDirModel - Tags, + Revision = KDirModel::ColumnCount, ExtraColumnCount }; + enum RevisionState { + LocalRevision, + LatestRevision + // TODO... + }; + DolphinModel(QObject* parent = 0); virtual ~DolphinModel(); - virtual QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const; - + virtual bool setData(const QModelIndex& index, const QVariant& value, int role = Qt::EditRole); + virtual QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const; + virtual QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const; virtual int columnCount(const QModelIndex& parent = QModelIndex()) const; - /** - * Returns the rating for the item with the index \a index. 0 is - * returned if no item could be found. - */ - static quint32 ratingForIndex(const QModelIndex& index); - - /** - * Returns the tags for the item with the index \a index. If no - * tag is applied, a predefined string will be returned. - */ - static QString tagsForIndex(const QModelIndex& index); + bool hasRevisionData() const; private: QVariant displayRoleData(const QModelIndex& index) const; QVariant sortRoleData(const QModelIndex& index) const; private: + bool m_hasRevisionData; + QHash<QPersistentModelIndex, RevisionState> m_revisionHash; + static const char* m_others; }; |
