| 132 | } |
| 133 | |
| 134 | void BranchManager::deleteBranch() |
| 135 | { |
| 136 | QString baseBranch = m_ui->branchView->selectionModel()->selection().indexes().first().data().toString(); |
| 137 | |
| 138 | if (baseBranch == m_model->currentBranch()) |
| 139 | { |
| 140 | KMessageBox::error(this, i18n("Currently at the branch \"%1\".\n" |
| 141 | "To delete it, please change to another branch.", |
| 142 | baseBranch)); |
| 143 | return; |
| 144 | } |
| 145 | |
| 146 | int ret = KMessageBox::warningTwoActions( |
| 147 | this, i18n("Are you sure you want to irreversibly delete the branch '%1'?", baseBranch), {}, |
| 148 | KStandardGuiItem::del(), KStandardGuiItem::cancel()); |
| 149 | if (ret == KMessageBox::PrimaryAction) |
| 150 | m_model->removeBranch(baseBranch); |
| 151 | } |
| 152 | |
| 153 | void BranchManager::renameBranch() |
| 154 | { |
no test coverage detected