Changeset View
Changeset View
Standalone View
Standalone View
kdevplatform/vcs/vcsrevision.h
Show All 18 Lines | |||||
19 | * 02110-1301, USA. | 19 | * 02110-1301, USA. | ||
20 | */ | 20 | */ | ||
21 | 21 | | |||
22 | #ifndef KDEVPLATFORM_VCSREVISION_H | 22 | #ifndef KDEVPLATFORM_VCSREVISION_H | ||
23 | #define KDEVPLATFORM_VCSREVISION_H | 23 | #define KDEVPLATFORM_VCSREVISION_H | ||
24 | 24 | | |||
25 | #include "vcsexport.h" | 25 | #include "vcsexport.h" | ||
26 | #include <QVariant> | 26 | #include <QVariant> | ||
27 | #include <QSharedDataPointer> | ||||
27 | class QStringList; | 28 | class QStringList; | ||
28 | class QString; | 29 | class QString; | ||
29 | 30 | | |||
30 | namespace KDevelop | 31 | namespace KDevelop | ||
31 | { | 32 | { | ||
32 | 33 | | |||
33 | /** | 34 | /** | ||
34 | * Encapsulates a vcs revision number, date or range of revisions. | 35 | * Encapsulates a vcs revision number, date or range of revisions. | ||
▲ Show 20 Lines • Show All 51 Lines • ▼ Show 20 Line(s) | 86 | { | |||
86 | Head = 0 /**< Latest revision in the repository. */, | 87 | Head = 0 /**< Latest revision in the repository. */, | ||
87 | Working = 1 /**< The local copy (including any changes made). */, | 88 | Working = 1 /**< The local copy (including any changes made). */, | ||
88 | Base = 2 /**< The repository source of the local copy. */, | 89 | Base = 2 /**< The repository source of the local copy. */, | ||
89 | Previous = 3 /**< The version prior the other one (only valid in functions that take two revisions). */, | 90 | Previous = 3 /**< The version prior the other one (only valid in functions that take two revisions). */, | ||
90 | Start = 4, /**< The first commit in a repository. */ | 91 | Start = 4, /**< The first commit in a repository. */ | ||
91 | UserSpecialType = 1000 /**< This should be used by subclasses as base for their own special types. */ | 92 | UserSpecialType = 1000 /**< This should be used by subclasses as base for their own special types. */ | ||
92 | }; | 93 | }; | ||
93 | 94 | | |||
95 | /** | ||||
96 | * Creates an invalid revision. | ||||
97 | */ | ||||
94 | VcsRevision(); | 98 | VcsRevision(); | ||
95 | virtual ~VcsRevision(); | 99 | virtual ~VcsRevision(); | ||
96 | 100 | | |||
97 | VcsRevision( const VcsRevision& ); | 101 | VcsRevision( const VcsRevision& ); | ||
98 | 102 | | |||
99 | VcsRevision& operator=( const VcsRevision& ); | 103 | VcsRevision& operator=( const VcsRevision& ); | ||
100 | 104 | | |||
101 | /** | 105 | /** | ||
▲ Show 20 Lines • Show All 48 Lines • ▼ Show 20 Line(s) | 138 | protected: | |||
150 | * write methods for subclasses to easily set the type and value | 154 | * write methods for subclasses to easily set the type and value | ||
151 | */ | 155 | */ | ||
152 | void setType( RevisionType t); | 156 | void setType( RevisionType t); | ||
153 | void setSpecialType( RevisionSpecialType t); | 157 | void setSpecialType( RevisionSpecialType t); | ||
154 | void setValue( const QVariant& ); | 158 | void setValue( const QVariant& ); | ||
155 | 159 | | |||
156 | 160 | | |||
157 | private: | 161 | private: | ||
158 | const QScopedPointer<class VcsRevisionPrivate> d; | 162 | QSharedDataPointer<class VcsRevisionPrivate> d; | ||
159 | }; | 163 | }; | ||
160 | 164 | | |||
161 | KDEVPLATFORMVCS_EXPORT uint qHash( const KDevelop::VcsRevision& rev); | 165 | KDEVPLATFORMVCS_EXPORT uint qHash( const KDevelop::VcsRevision& rev); | ||
162 | 166 | | |||
163 | } | 167 | } | ||
164 | 168 | | |||
165 | Q_DECLARE_METATYPE(KDevelop::VcsRevision) | 169 | Q_DECLARE_METATYPE(KDevelop::VcsRevision) | ||
170 | Q_DECLARE_TYPEINFO(KDevelop::VcsRevision, Q_MOVABLE_TYPE); | ||||
166 | Q_DECLARE_METATYPE(KDevelop::VcsRevision::RevisionSpecialType) | 171 | Q_DECLARE_METATYPE(KDevelop::VcsRevision::RevisionSpecialType) | ||
167 | 172 | | |||
168 | 173 | | |||
169 | 174 | | |||
170 | #endif | 175 | #endif | ||
171 | 176 | |