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

Method data

plugins/projectmanagerview/vcsoverlayproxymodel.cpp:49–71  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47}
48
49QVariant VcsOverlayProxyModel::data(const QModelIndex& proxyIndex, int role) const
50{
51 if(role == VcsStatusRole) {
52 auto* const project = qobject_cast<IProject*>(proxyIndex.data(ProjectModel::ProjectRole).value<QObject*>());
53 if (!proxyIndex.parent().isValid()) {
54 return m_branchName.value(project);
55 }
56
57 // Display the VCS status of the item only if the changes model already exists. The VCS status
58 // is not essential, not worth the overhead and possible UI freezes due to the inefficient
59 // tracking of VCS statuses by ProjectChangesModel. See https://bugs.kde.org/show_bug.cgi?id=486949
60 if (const auto model = ICore::self()->projectController()->changesModel()) {
61 if (const auto* const projectItem = model->projectItem(project)) {
62 const QUrl url = proxyIndex.data(ProjectModel::UrlRole).toUrl();
63 return ProjectChangesModel::statusIndexForUrl(*model, projectItem->index(), url).data(Qt::DisplayRole);
64 }
65 }
66
67 return {};
68 }
69
70 return QIdentityProxyModel::data(proxyIndex, role);
71}
72
73void VcsOverlayProxyModel::addProject(IProject* p)
74{

Callers 9

indexToConfigStringMethod · 0.45
paintMethod · 0.45
helpEventMethod · 0.45
branchNameReadyMethod · 0.45
indexFromProjectMethod · 0.45
itemAtPosMethod · 0.45
slotActivatedMethod · 0.45
selectedProjectsMethod · 0.45
drawBranchesMethod · 0.45

Calls 9

projectControllerMethod · 0.80
dataFunction · 0.50
isValidMethod · 0.45
parentMethod · 0.45
valueMethod · 0.45
changesModelMethod · 0.45
projectItemMethod · 0.45
toUrlMethod · 0.45
indexMethod · 0.45

Tested by

no test coverage detected