diff options
| author | Peter Penz <[email protected]> | 2009-07-22 07:07:43 +0000 |
|---|---|---|
| committer | Peter Penz <[email protected]> | 2009-07-22 07:07:43 +0000 |
| commit | ebf78d6ac26467560e66beeb106d0650aafd60f3 (patch) | |
| tree | d314cc3d95e7ae933109935023479c8907b81f99 /src/revisioncontrolplugin.h | |
| parent | c92c5cada0bb687d29f4af1eb1230f28cc2bdf6c (diff) | |
- Documentation updates.
- Allow the revision plugin to emit a signal which indicates a changed revision state.
- Update the revision state if the state of file items has been changed.
- Check also the content of a file if the size of a local and revisioned file is equal.
svn path=/trunk/KDE/kdebase/apps/; revision=1000831
Diffstat (limited to 'src/revisioncontrolplugin.h')
| -rw-r--r-- | src/revisioncontrolplugin.h | 42 |
1 files changed, 40 insertions, 2 deletions
diff --git a/src/revisioncontrolplugin.h b/src/revisioncontrolplugin.h index a4ad69571..95751253a 100644 --- a/src/revisioncontrolplugin.h +++ b/src/revisioncontrolplugin.h @@ -24,17 +24,28 @@ #include <QDateTime> #include <QString> +#include <QObject> class KFileItem; +class KFileItemList; +class QAction; /** * @brief Base class for revision control plugins. * * Enables the file manager to show the revision state - * of a revisioned file. + * of a revisioned file. The methods + * RevisionControlPlugin::beginRetrieval(), + * RevisionControlPlugin::endRetrieval() and + * RevisionControlPlugin::revisionState() are invoked + * from a separate thread to assure that the GUI thread + * won't be blocked. All other methods are invoked in the + * scope of the GUI thread. */ -class LIBDOLPHINPRIVATE_EXPORT RevisionControlPlugin +class LIBDOLPHINPRIVATE_EXPORT RevisionControlPlugin : public QObject { + Q_OBJECT + public: enum RevisionState { @@ -79,7 +90,26 @@ public: * in beginInfoRetrieval(). */ virtual RevisionState revisionState(const KFileItem& item) = 0; + + /** + * Returns the list of actions that should be shown in the context menu + * for the files \p items. If an action cannot be applied to the list + * of files, it is recommended to disable the action instead of removing it + * from the returned list. If an action triggers a change of the revisions, + * the signal RevisionControlPlugin::revisionStatesChanged() must be emitted. + */ + virtual QList<QAction*> contextMenuActions(const KFileItemList& items) const = 0; +signals: + /** + * Should be emitted when the revision state of files has been changed + * after the last retrieval. The file manager will be triggered to + * update the revision states of the directory \p directory by invoking + * RevisionControlPlugin::beginRetrieval(), + * RevisionControlPlugin::revisionState() and + * RevisionControlPlugin::endRetrieval(). + */ + void revisionStatesChanged(const QString& directory); }; @@ -100,6 +130,14 @@ public: virtual bool beginRetrieval(const QString& directory); virtual void endRetrieval(); virtual RevisionControlPlugin::RevisionState revisionState(const KFileItem& item); + virtual QList<QAction*> contextMenuActions(const KFileItemList& items) const; + +private: + /** + * Returns true, if the content of the local file \p name is equal to the + * content of the revisioned file. + */ + bool equalRevisionContent(const QString& name) const; private: struct RevisionInfo |
