Fix no newlines warnings. Patch by Peter Oberndorfer
[kdevelopdvcssupport.git] / vcs / vcsevent.cpp
blob383663f2df29fb644351d3cbb0c2a66f6b6f1cbf
1 /***************************************************************************
2 * This file is part of KDevelop *
3 * Copyright 2007 Andreas Pakulat <apaku@gmx.de> *
4 * *
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. *
9 * *
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. *
14 * *
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 ***************************************************************************/
21 #include "vcsevent.h"
22 #include <QtCore/QString>
23 #include <QtCore/QList>
24 #include <QtCore/QDateTime>
26 #include "vcsrevision.h"
27 namespace KDevelop
30 class VcsItemEventPrivate
32 public:
33 QString location;
34 QString sourceLocation;
35 VcsRevision revision;
36 VcsRevision sourceRevision;
37 VcsItemEvent::Actions actions;
40 VcsItemEvent::VcsItemEvent()
41 : d(new VcsItemEventPrivate)
45 VcsItemEvent::~VcsItemEvent()
47 delete d;
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
62 return d->location;
65 QString VcsItemEvent::repositoryCopySourceLocation() const
67 return d->sourceLocation;
70 VcsRevision VcsItemEvent::repositoryCopySourceRevision() const
72 return d->sourceRevision;
75 VcsRevision VcsItemEvent::revision() const
77 return d->revision;
80 VcsItemEvent::Actions VcsItemEvent::actions() const
82 return d->actions;
85 void VcsItemEvent::setRepositoryLocation( const QString& l )
87 d->location = l;
90 void VcsItemEvent::setRepositoryCopySourceLocation( const QString& l )
92 d->sourceLocation = l;
95 void VcsItemEvent::setRevision( const KDevelop::VcsRevision& rev )
97 d->revision = rev;
100 void VcsItemEvent::setRepositoryCopySourceRevision( const KDevelop::VcsRevision& rev )
102 d->sourceRevision = rev;
105 void VcsItemEvent::setActions( VcsItemEvent::Actions a )
107 d->actions = a;
110 VcsItemEvent& VcsItemEvent::operator=( const VcsItemEvent& rhs)
112 if(this == &rhs)
113 return *this;
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;
119 return *this;
122 class VcsEventPrivate
124 public:
125 VcsRevision revision;
126 QString author;
127 QString message;
128 QDateTime date;
129 VcsItemEvent::Actions actions;
130 QList<VcsItemEvent> items;
133 VcsEvent::VcsEvent()
134 : d(new VcsEventPrivate)
138 VcsEvent::~VcsEvent()
140 delete d;
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()
156 return d->revision;
159 QString VcsEvent::author()
161 return d->author;
164 QDateTime VcsEvent::date()
166 return d->date;
169 QString VcsEvent::message()
171 return d->message;
174 VcsItemEvent::Actions VcsEvent::actions()
176 return d->actions;
179 QList<VcsItemEvent> VcsEvent::items()
181 return d->items;
184 void VcsEvent::setRevision( const VcsRevision& rev )
186 d->revision = rev;
189 void VcsEvent::setAuthor( const QString& a )
191 d->author = a;
194 void VcsEvent::setDate( const QDateTime& date )
196 d->date = date;
199 void VcsEvent::setMessage(const QString& m )
201 d->message = m;
204 void VcsEvent::setActions( VcsItemEvent::Actions a )
206 d->actions = a;
209 void VcsEvent::setItems( const QList<VcsItemEvent>& l )
211 d->items = l;
214 VcsEvent& VcsEvent::operator=( const VcsEvent& rhs)
216 if(this == &rhs)
217 return *this;
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;
224 return *this;