| 130 | } |
| 131 | |
| 132 | QVariant 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 | |
| 162 | VcsRevision VcsAnnotationModel::revisionForLine( int line ) const |
| 163 | { |
nothing calls this directly
no test coverage detected