1 /***************************************************************************
2 * This file is part of KDevelop *
3 * Copyright 2007 Andreas Pakulat <apaku@gmx.de> *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU Library General Public License as *
7 * published by the Free Software Foundation; either version 2 of the *
8 * License, or (at your option) any later version. *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
15 * You should have received a copy of the GNU Library General Public *
16 * License along with this program; if not, write to the *
17 * Free Software Foundation, Inc., *
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
19 ***************************************************************************/
22 #include <QtCore/QString>
23 #include <QtCore/QList>
24 #include <QtCore/QDateTime>
26 #include "vcsrevision.h"
30 class VcsItemEventPrivate
34 QString sourceLocation
;
36 VcsRevision sourceRevision
;
37 VcsItemEvent::Actions actions
;
40 VcsItemEvent::VcsItemEvent()
41 : d(new VcsItemEventPrivate
)
45 VcsItemEvent::~VcsItemEvent()
50 VcsItemEvent::VcsItemEvent(const VcsItemEvent
& rhs
)
51 : d(new VcsItemEventPrivate
)
53 d
->actions
= rhs
.d
->actions
;
54 d
->revision
= rhs
.d
->revision
;
55 d
->sourceRevision
= rhs
.d
->sourceRevision
;
56 d
->sourceLocation
= rhs
.d
->sourceLocation
;
57 d
->location
= rhs
.d
->location
;
60 QString
VcsItemEvent::repositoryLocation() const
65 QString
VcsItemEvent::repositoryCopySourceLocation() const
67 return d
->sourceLocation
;
70 VcsRevision
VcsItemEvent::repositoryCopySourceRevision() const
72 return d
->sourceRevision
;
75 VcsRevision
VcsItemEvent::revision() const
80 VcsItemEvent::Actions
VcsItemEvent::actions() const
85 void VcsItemEvent::setRepositoryLocation( const QString
& l
)
90 void VcsItemEvent::setRepositoryCopySourceLocation( const QString
& l
)
92 d
->sourceLocation
= l
;
95 void VcsItemEvent::setRevision( const KDevelop::VcsRevision
& rev
)
100 void VcsItemEvent::setRepositoryCopySourceRevision( const KDevelop::VcsRevision
& rev
)
102 d
->sourceRevision
= rev
;
105 void VcsItemEvent::setActions( VcsItemEvent::Actions a
)
110 VcsItemEvent
& VcsItemEvent::operator=( const VcsItemEvent
& rhs
)
114 d
->actions
= rhs
.d
->actions
;
115 d
->revision
= rhs
.d
->revision
;
116 d
->sourceRevision
= rhs
.d
->sourceRevision
;
117 d
->sourceLocation
= rhs
.d
->sourceLocation
;
118 d
->location
= rhs
.d
->location
;
122 class VcsEventPrivate
125 VcsRevision revision
;
129 VcsItemEvent::Actions actions
;
130 QList
<VcsItemEvent
> items
;
134 : d(new VcsEventPrivate
)
138 VcsEvent::~VcsEvent()
143 VcsEvent::VcsEvent( const VcsEvent
& rhs
)
144 : d(new VcsEventPrivate
)
146 d
->revision
= rhs
.d
->revision
;
147 d
->author
= rhs
.d
->author
;
148 d
->message
= rhs
.d
->message
;
149 d
->date
= rhs
.d
->date
;
150 d
->actions
= rhs
.d
->actions
;
151 d
->items
= rhs
.d
->items
;
154 VcsRevision
VcsEvent::revision()
159 QString
VcsEvent::author()
164 QDateTime
VcsEvent::date()
169 QString
VcsEvent::message()
174 VcsItemEvent::Actions
VcsEvent::actions()
179 QList
<VcsItemEvent
> VcsEvent::items()
184 void VcsEvent::setRevision( const VcsRevision
& rev
)
189 void VcsEvent::setAuthor( const QString
& a
)
194 void VcsEvent::setDate( const QDateTime
& date
)
199 void VcsEvent::setMessage(const QString
& m
)
204 void VcsEvent::setActions( VcsItemEvent::Actions a
)
209 void VcsEvent::setItems( const QList
<VcsItemEvent
>& l
)
214 VcsEvent
& VcsEvent::operator=( const VcsEvent
& rhs
)
218 d
->actions
= rhs
.d
->actions
;
219 d
->revision
= rhs
.d
->revision
;
220 d
->message
= rhs
.d
->message
;
221 d
->items
= rhs
.d
->items
;
222 d
->date
= rhs
.d
->date
;
223 d
->author
= rhs
.d
->author
;