Changeset View
Changeset View
Standalone View
Standalone View
kdevplatform/vcs/vcsstatusinfo.cpp
Show All 16 Lines | |||||
17 | * Free Software Foundation, Inc., * | 17 | * Free Software Foundation, Inc., * | ||
18 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * | 18 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * | ||
19 | ***************************************************************************/ | 19 | ***************************************************************************/ | ||
20 | 20 | | |||
21 | #include "vcsstatusinfo.h" | 21 | #include "vcsstatusinfo.h" | ||
22 | 22 | | |||
23 | #include <QDebug> | 23 | #include <QDebug> | ||
24 | #include <QUrl> | 24 | #include <QUrl> | ||
25 | #include <QSharedData> | ||||
25 | 26 | | |||
26 | namespace KDevelop | 27 | namespace KDevelop | ||
27 | { | 28 | { | ||
28 | 29 | | |||
29 | class VcsStatusInfoPrivate | 30 | class VcsStatusInfoPrivate : public QSharedData | ||
30 | { | 31 | { | ||
31 | public: | 32 | public: | ||
32 | int state; | 33 | int state; | ||
33 | QUrl url; | 34 | QUrl url; | ||
34 | }; | 35 | }; | ||
35 | 36 | | |||
36 | VcsStatusInfo::VcsStatusInfo() | 37 | VcsStatusInfo::VcsStatusInfo() | ||
37 | : d( new VcsStatusInfoPrivate) | 38 | : d( new VcsStatusInfoPrivate) | ||
38 | { | 39 | { | ||
39 | d->state = VcsStatusInfo::ItemUnknown; | 40 | d->state = VcsStatusInfo::ItemUnknown; | ||
40 | } | 41 | } | ||
41 | 42 | | |||
42 | VcsStatusInfo::~VcsStatusInfo() = default; | 43 | VcsStatusInfo::~VcsStatusInfo() = default; | ||
43 | 44 | | |||
44 | VcsStatusInfo::VcsStatusInfo( const VcsStatusInfo& rhs ) | 45 | VcsStatusInfo::VcsStatusInfo( const VcsStatusInfo& rhs ) | ||
45 | : d(new VcsStatusInfoPrivate) | 46 | : d(rhs.d) | ||
46 | { | 47 | { | ||
47 | d->state = rhs.d->state; | | |||
48 | d->url = rhs.d->url; | | |||
49 | } | 48 | } | ||
50 | 49 | | |||
51 | VcsStatusInfo& VcsStatusInfo::operator=( const VcsStatusInfo& rhs) | 50 | VcsStatusInfo& VcsStatusInfo::operator=( const VcsStatusInfo& rhs) | ||
52 | { | 51 | { | ||
53 | if(this == &rhs) | 52 | d = rhs.d; | ||
54 | return *this; | | |||
55 | d->state = rhs.d->state; | | |||
56 | d->url = rhs.d->url; | | |||
57 | return *this; | 53 | return *this; | ||
58 | } | 54 | } | ||
59 | 55 | | |||
60 | bool VcsStatusInfo::operator==( const KDevelop::VcsStatusInfo& rhs) const | 56 | bool VcsStatusInfo::operator==( const KDevelop::VcsStatusInfo& rhs) const | ||
61 | { | 57 | { | ||
62 | return ( d->state == rhs.d->state && d->url == rhs.d->url ); | 58 | return ( d->state == rhs.d->state && d->url == rhs.d->url ); | ||
63 | } | 59 | } | ||
64 | 60 | | |||
▲ Show 20 Lines • Show All 42 Lines • Show Last 20 Lines |