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

Method activateProject

plugins/git/committoolview.cpp:277–295  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

275}
276
277void CommitToolView::activateProject(const QModelIndex& idx)
278{
279 if (idx.data(RepoStatusModel::AreaRole).toInt() == RepoStatusModel::ProjectRoot) {
280 m_styleDelegate->setActive(idx);
281 auto repoIdx = m_proxymodel->mapToSource(idx);
282 for (const auto* pr : m_statusmodel->projectRoots()) {
283 if (pr->index() != repoIdx)
284 m_view->collapse(m_proxymodel->mapFromSource(pr->index()));
285 }
286 m_commitForm->setProjectName(idx.data(RepoStatusModel::NameRole).toString());
287 m_commitForm->setBranchName(idx.data(RepoStatusModel::BranchNameRole).toString());
288 m_commitForm->clearError();
289 m_commitForm->enable();
290 if (m_statusmodel->projectItem(m_statusmodel->itemFromIndex(repoIdx)).index->rowCount() == 0)
291 m_commitForm->disableCommitButton();
292 else
293 m_commitForm->enableCommitButton();
294 }
295}
296
297void CommitToolView::popupContextMenu(const QPoint& pos)
298{

Callers

nothing calls this directly

Calls 15

toIntMethod · 0.80
setActiveMethod · 0.80
projectRootsMethod · 0.80
collapseMethod · 0.80
setBranchNameMethod · 0.80
clearErrorMethod · 0.80
disableCommitButtonMethod · 0.80
enableCommitButtonMethod · 0.80
dataMethod · 0.45
mapToSourceMethod · 0.45
indexMethod · 0.45
mapFromSourceMethod · 0.45

Tested by

no test coverage detected