• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdevelop API Reference
  • KDE Home
  • Contact Us
 

kdevplatform/vcs

  • sources
  • kfour-appscomplete
  • kdevelop
  • kdevplatform
  • vcs
vcsannotation.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  * This file is part of KDevelop *
3  * Copyright 2007 Andreas Pakulat <[email protected]> *
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  ***************************************************************************/
20 
21 #include "vcsannotation.h"
22 
23 #include <QSharedData>
24 #include <QDateTime>
25 #include <QHash>
26 #include <QUrl>
27 
28 #include "vcsrevision.h"
29 
30 namespace KDevelop
31 {
32 
33 class VcsAnnotationPrivate : public QSharedData
34 {
35 public:
36  QHash<int, VcsAnnotationLine> lines;
37  QUrl location;
38 };
39 
40 class VcsAnnotationLinePrivate : public QSharedData
41 {
42 public:
43  QString author;
44  QDateTime date;
45  QString text;
46  QString line;
47  VcsRevision revision;
48  QString message;
49  int lineno;
50 };
51 
52 VcsAnnotationLine::VcsAnnotationLine()
53  : d( new VcsAnnotationLinePrivate )
54 {
55  d->lineno = -1;
56 }
57 
58 VcsAnnotationLine::VcsAnnotationLine( const VcsAnnotationLine& rhs )
59  : d(rhs.d)
60 {
61 }
62 
63 VcsAnnotationLine::~VcsAnnotationLine() = default;
64 
65 int VcsAnnotationLine::lineNumber() const
66 {
67  return d->lineno;
68 }
69 
70 QString VcsAnnotationLine::text() const
71 {
72  return d->text;
73 }
74 
75 QString VcsAnnotationLine::author() const
76 {
77  return d->author;
78 }
79 
80 VcsRevision VcsAnnotationLine::revision() const
81 {
82  return d->revision;
83 }
84 
85 QDateTime VcsAnnotationLine::date() const
86 {
87  return d->date;
88 }
89 
90 void VcsAnnotationLine::setLineNumber( int lineno )
91 {
92  d->lineno = lineno;
93 }
94 
95 void VcsAnnotationLine::setText( const QString& text )
96 {
97  d->text = text;
98 }
99 
100 void VcsAnnotationLine::setAuthor( const QString& author )
101 {
102  d->author = author;
103 }
104 
105 void KDevelop::VcsAnnotationLine::setRevision( const KDevelop::VcsRevision& revision )
106 {
107  d->revision = revision;
108 }
109 
110 void VcsAnnotationLine::setDate( const QDateTime& date )
111 {
112  d->date = date;
113 }
114 
115 VcsAnnotationLine& VcsAnnotationLine::operator=( const VcsAnnotationLine& rhs)
116 {
117  d = rhs.d;
118  return *this;
119 }
120 
121 QString VcsAnnotationLine::commitMessage() const
122 {
123  return d->message;
124 }
125 
126 
127 void VcsAnnotationLine::setCommitMessage ( const QString& msg )
128 {
129  d->message = msg;
130 }
131 
132 VcsAnnotation::VcsAnnotation()
133  : d(new VcsAnnotationPrivate)
134 {
135 }
136 
137 VcsAnnotation::VcsAnnotation( const VcsAnnotation& rhs )
138  : d(rhs.d)
139 {
140 }
141 
142 VcsAnnotation::~VcsAnnotation() = default;
143 
144 QUrl VcsAnnotation::location() const
145 {
146  return d->location;
147 }
148 
149 int VcsAnnotation::lineCount() const
150 {
151  return d->lines.count();
152 }
153 
154 void VcsAnnotation::insertLine( int lineno, const VcsAnnotationLine& line )
155 {
156  if( lineno < 0 )
157  {
158  return;
159  }
160  d->lines.insert( lineno, line );
161 }
162 
163 void VcsAnnotation::setLocation(const QUrl& u)
164 {
165  d->location = u;
166 }
167 
168 VcsAnnotationLine VcsAnnotation::line( int lineno ) const
169 {
170  return d->lines[lineno];
171 }
172 
173 VcsAnnotation& VcsAnnotation::operator=( const VcsAnnotation& rhs)
174 {
175  d = rhs.d;
176  return *this;
177 }
178 
179 bool VcsAnnotation::containsLine( int lineno ) const
180 {
181  return d->lines.contains( lineno );
182 }
183 
184 }
185 
QSharedData
KDevelop::VcsAnnotationLine::text
QString text() const
Definition: vcsannotation.cpp:86
KDevelop::VcsAnnotationLine::setCommitMessage
void setCommitMessage(const QString &msg)
set the commit message of the revision in this line
Definition: vcsannotation.cpp:143
KDevelop::VcsAnnotationLine::author
QString author() const
Definition: vcsannotation.cpp:91
QUrl
KDevelop::VcsAnnotation::lineCount
int lineCount() const
Definition: vcsannotation.cpp:165
KDevelop::VcsAnnotationLine::setLineNumber
void setLineNumber(int lineno)
set the line number of this annotation line
Definition: vcsannotation.cpp:106
KDevelop::VcsRevision
Encapsulates a vcs revision number, date or range of revisions.
Definition: vcsrevision.h:66
KDevelop::VcsAnnotationLine::setText
void setText(const QString &text)
set the text of this annotation line
Definition: vcsannotation.cpp:111
KDevelop::VcsAnnotationLine::setDate
void setDate(const QDateTime &date)
set the date of this annotation line
Definition: vcsannotation.cpp:126
KDevelop::VcsAnnotationLine::setAuthor
void setAuthor(const QString &author)
set the author of this annotation line
Definition: vcsannotation.cpp:116
KDevelop::VcsAnnotation::line
VcsAnnotationLine line(int linenumber) const
retrieve the annotation line for the given number
Definition: vcsannotation.cpp:184
KDevelop::VcsAnnotationLine::revision
VcsRevision revision() const
Definition: vcsannotation.cpp:96
KDevelop::VcsAnnotation::~VcsAnnotation
virtual ~VcsAnnotation()
QString
KDevelop::VcsAnnotationLine::commitMessage
QString commitMessage() const
Definition: vcsannotation.cpp:137
KDevelop::VcsAnnotationLine
Annotation information for a line of a version controlled file.
Definition: vcsannotation.h:40
KDevelop::VcsAnnotation::VcsAnnotation
VcsAnnotation()
Definition: vcsannotation.cpp:148
KDevelop::VcsAnnotationLine::setRevision
void setRevision(const VcsRevision &revision)
set the revision of this annotation line
Definition: vcsannotation.cpp:121
KDevelop::VcsAnnotationLine::operator=
VcsAnnotationLine & operator=(const VcsAnnotationLine &rhs)
Definition: vcsannotation.cpp:131
KDevelop::VcsAnnotation
Annotations for a local file.
Definition: vcsannotation.h:115
KDevelop::VcsAnnotation::setLocation
void setLocation(const QUrl &location)
Definition: vcsannotation.cpp:179
KDevelop::VcsAnnotation::containsLine
bool containsLine(int lineno) const
Definition: vcsannotation.cpp:195
KDevelop::VcsAnnotation::insertLine
void insertLine(int lineno, const VcsAnnotationLine &line)
insert a new line to list of lines using the parameters
Definition: vcsannotation.cpp:170
KDevelop::VcsAnnotationLine::date
QDateTime date() const
Definition: vcsannotation.cpp:101
KDevelop
Definition: dvcsevent.h:33
QDateTime
KDevelop::VcsAnnotationLine::lineNumber
int lineNumber() const
Definition: vcsannotation.cpp:81
vcsannotation.h
QHash
KDevelop::VcsAnnotation::operator=
VcsAnnotation & operator=(const VcsAnnotation &rhs)
Definition: vcsannotation.cpp:189
vcsrevision.h
KDevelop::VcsAnnotationLine::~VcsAnnotationLine
virtual ~VcsAnnotationLine()
KDevelop::VcsAnnotation::location
QUrl location() const
Definition: vcsannotation.cpp:160
KDevelop::VcsAnnotationLine::VcsAnnotationLine
VcsAnnotationLine()
Definition: vcsannotation.cpp:68
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Sat Jan 16 2021 23:36:06 by doxygen 1.8.16 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kdevplatform/vcs

Skip menu "kdevplatform/vcs"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdevelop API Reference

Skip menu "kdevelop API Reference"
  • kdevplatform
  •   debugger
  •   documentation
  •   interfaces
  •   language
  •     assistant
  •     backgroundparser
  •     checks
  •     classmodel
  •     codecompletion
  •     codegen
  •     duchain
  •     editor
  •     highlighting
  •     interfaces
  •     util
  •   outputview
  •   project
  •   serialization
  •   shell
  •   sublime
  •   tests
  •   util
  •   vcs

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal