| 275 | } |
| 276 | |
| 277 | void 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 | |
| 297 | void CommitToolView::popupContextMenu(const QPoint& pos) |
| 298 | { |
nothing calls this directly
no test coverage detected