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

Method data

kdevplatform/vcs/models/vcseventmodel.cpp:53–79  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51}
52
53QVariant VcsBasicEventModel::data(const QModelIndex& idx, int role) const
54{
55 Q_D(const VcsBasicEventModel);
56
57 if( !idx.isValid() || role != Qt::DisplayRole )
58 return QVariant();
59
60 if( idx.row() < 0 || idx.row() >= rowCount() || idx.column() < 0 || idx.column() >= columnCount() )
61 return QVariant();
62
63 KDevelop::VcsEvent ev = d->m_events.at( idx.row() );
64 switch( idx.column() )
65 {
66 case RevisionColumn:
67 return QVariant( ev.revision().revisionValue() );
68 case SummaryColumn:
69 // show the first line only
70 return QVariant( ev.message().section(QLatin1Char('\n'), 0, 0) );
71 case AuthorColumn:
72 return QVariant( ev.author() );
73 case DateColumn:
74 return QVariant( QLocale().toString( ev.date() ) );
75 default:
76 break;
77 }
78 return QVariant();
79}
80
81QVariant VcsBasicEventModel::headerData(int section, Qt::Orientation orientation, int role) const
82{

Callers 15

diffForRevMethod · 0.45
copyRevisionMethod · 0.45
helpEventMethod · 0.45
oldMessageChangedMethod · 0.45
customWidgetMethod · 0.45
cancelReviewMethod · 0.45
finishReviewMethod · 0.45
itemEventForIndexMethod · 0.45
createBranchMethod · 0.45

Calls 12

revisionValueMethod · 0.80
sectionMethod · 0.80
QVariantClass · 0.50
isValidMethod · 0.45
rowMethod · 0.45
columnMethod · 0.45
atMethod · 0.45
revisionMethod · 0.45
messageMethod · 0.45
authorMethod · 0.45
toStringMethod · 0.45
dateMethod · 0.45

Tested by 1