Changeset View
Changeset View
Standalone View
Standalone View
src/views/versioncontrol/versioncontrolobserver.h
Show All 31 Lines | |||||
32 | #include <QUrl> | 32 | #include <QUrl> | ||
33 | 33 | | |||
34 | class KFileItemList; | 34 | class KFileItemList; | ||
35 | class KFileItemModel; | 35 | class KFileItemModel; | ||
36 | class QAction; | 36 | class QAction; | ||
37 | class QTimer; | 37 | class QTimer; | ||
38 | class UpdateItemStatesThread; | 38 | class UpdateItemStatesThread; | ||
39 | 39 | | |||
40 | class DolphinView; | ||||
41 | | ||||
40 | /** | 42 | /** | ||
41 | * @brief Observes all version control plugins. | 43 | * @brief Observes all version control plugins. | ||
42 | * | 44 | * | ||
43 | * The items of the directory-model get updated automatically if the currently | 45 | * The items of the directory-model get updated automatically if the currently | ||
44 | * shown directory is under version control. | 46 | * shown directory is under version control. | ||
45 | * | 47 | * | ||
46 | * @see VersionControlPlugin | 48 | * @see VersionControlPlugin | ||
47 | */ | 49 | */ | ||
48 | class DOLPHIN_EXPORT VersionControlObserver : public QObject | 50 | class DOLPHIN_EXPORT VersionControlObserver : public QObject | ||
49 | { | 51 | { | ||
50 | Q_OBJECT | 52 | Q_OBJECT | ||
51 | 53 | | |||
52 | public: | 54 | public: | ||
53 | explicit VersionControlObserver(QObject* parent = nullptr); | 55 | explicit VersionControlObserver(QObject* parent = nullptr); | ||
54 | ~VersionControlObserver() override; | 56 | ~VersionControlObserver() override; | ||
55 | 57 | | |||
56 | void setModel(KFileItemModel* model); | 58 | void setModel(KFileItemModel* model); | ||
57 | KFileItemModel* model() const; | 59 | KFileItemModel* model() const; | ||
60 | void setView(DolphinView* view); | ||||
61 | DolphinView* view() const; | ||||
58 | 62 | | |||
59 | QList<QAction*> actions(const KFileItemList& items) const; | 63 | QList<QAction*> actions(const KFileItemList& items) const; | ||
60 | 64 | | |||
61 | signals: | 65 | signals: | ||
62 | /** | 66 | /** | ||
63 | * Is emitted if an information message with the content \a msg | 67 | * Is emitted if an information message with the content \a msg | ||
64 | * should be shown. | 68 | * should be shown. | ||
65 | */ | 69 | */ | ||
▲ Show 20 Lines • Show All 68 Lines • ▼ Show 20 Line(s) | 108 | private: | |||
134 | bool isVersioned() const; | 138 | bool isVersioned() const; | ||
135 | 139 | | |||
136 | private: | 140 | private: | ||
137 | bool m_pendingItemStatesUpdate; | 141 | bool m_pendingItemStatesUpdate; | ||
138 | bool m_versionedDirectory; | 142 | bool m_versionedDirectory; | ||
139 | bool m_silentUpdate; // if true, no messages will be send during the update | 143 | bool m_silentUpdate; // if true, no messages will be send during the update | ||
140 | // of version states | 144 | // of version states | ||
141 | 145 | | |||
146 | DolphinView* m_view; | ||||
142 | KFileItemModel* m_model; | 147 | KFileItemModel* m_model; | ||
143 | 148 | | |||
144 | QTimer* m_dirVerificationTimer; | 149 | QTimer* m_dirVerificationTimer; | ||
145 | 150 | | |||
146 | bool m_pluginsInitialized; | 151 | bool m_pluginsInitialized; | ||
147 | KVersionControlPlugin* m_plugin; | 152 | KVersionControlPlugin* m_plugin; | ||
148 | QList<KVersionControlPlugin*> m_plugins; | 153 | QList<KVersionControlPlugin*> m_plugins; | ||
149 | UpdateItemStatesThread* m_updateItemStatesThread; | 154 | UpdateItemStatesThread* m_updateItemStatesThread; | ||
150 | 155 | | |||
151 | friend class UpdateItemStatesThread; | 156 | friend class UpdateItemStatesThread; | ||
152 | }; | 157 | }; | ||
153 | 158 | | |||
154 | #endif // REVISIONCONTROLOBSERVER_H | 159 | #endif // REVISIONCONTROLOBSERVER_H | ||
155 | 160 | |