MCPcopy Create free account
hub / github.com/KDE/kdevelop / data

Method data

kdevplatform/vcs/models/vcsannotationmodel.cpp:132–160  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

130}
131
132QVariant VcsAnnotationModel::data( int line, Qt::ItemDataRole role ) const
133{
134 Q_D(const VcsAnnotationModel);
135
136 if( line < 0 || !d->m_annotation.containsLine( line ) )
137 {
138 return QVariant();
139 }
140
141 KDevelop::VcsAnnotationLine aline = d->m_annotation.line( line );
142 if( role == Qt::ForegroundRole )
143 {
144 return QVariant(QPen(d->foreground));
145 }
146 if( role == Qt::BackgroundRole )
147 {
148 return QVariant(d->brush(aline.revision()));
149 } else if( role == Qt::DisplayRole )
150 {
151 return QVariant( QStringLiteral("%1 ").arg(aline.date().date().year()) + abbreviateLastName(aline.author()) );
152 } else if( role == (int) KTextEditor::AnnotationModel::GroupIdentifierRole )
153 {
154 return aline.revision().revisionValue();
155 } else if( role == Qt::ToolTipRole )
156 {
157 return QVariant(annotationToolTip(aline));
158 }
159 return QVariant();
160}
161
162VcsRevision VcsAnnotationModel::revisionForLine( int line ) const
163{

Callers

nothing calls this directly

Calls 9

abbreviateLastNameFunction · 0.85
annotationToolTipFunction · 0.85
containsLineMethod · 0.80
revisionValueMethod · 0.80
QVariantClass · 0.50
lineMethod · 0.45
revisionMethod · 0.45
dateMethod · 0.45
authorMethod · 0.45

Tested by

no test coverage detected