| 592 | } |
| 593 | |
| 594 | void RepoStatusModel::branchNameReady(VcsJob* job) |
| 595 | { |
| 596 | auto* const project = qobject_cast<IProject*>(job->property("project").value<QObject*>()); |
| 597 | const auto item = findProject(project); |
| 598 | if (!item) |
| 599 | return; |
| 600 | |
| 601 | if (job->status() == VcsJob::JobSucceeded) { |
| 602 | QString name = job->fetchResults().toString(); |
| 603 | QString branchName = name.isEmpty() ? i18n("no branch") : name; |
| 604 | item->setText(i18nc("project name (branch name)", "%1 (%2)", project->name(), branchName)); |
| 605 | item->setData(branchName, RepoStatusModel::BranchNameRole); |
| 606 | } else { |
| 607 | item->setData(QStringLiteral("unknown"), RepoStatusModel::BranchNameRole); |
| 608 | item->setText(project->name()); |
| 609 | } |
| 610 | |
| 611 | reload(QList<IProject*>() << project); |
| 612 | } |
| 613 | |
| 614 | #include "moc_repostatusmodel.cpp" |
nothing calls this directly
no test coverage detected