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

Method createBranch

kdevplatform/vcs/dvcs/ui/branchmanager.cpp:110–132  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

108}
109
110void BranchManager::createBranch()
111{
112 const QModelIndex currentBranchIdx = m_ui->branchView->currentIndex();
113 if (!currentBranchIdx.isValid()) {
114 KMessageBox::error(this, i18n("You must select a base branch from the list before creating a new branch."));
115 return;
116 }
117 QString baseBranch = currentBranchIdx.data().toString();
118 bool branchNameEntered = false;
119 QString newBranch = QInputDialog::getText(this, i18nc("@title:window", "New Branch"), i18nc("@label:textbox", "Name of the new branch:"),
120 QLineEdit::Normal, QString(), &branchNameEntered);
121 if (!branchNameEntered)
122 return;
123
124 if (!m_model->findItems(newBranch).isEmpty())
125 {
126 KMessageBox::error(this, i18n("Branch \"%1\" already exists.\n"
127 "Please, choose another name.",
128 newBranch));
129 }
130 else
131 m_model->createBranch(baseBranch, newBranch);
132}
133
134void BranchManager::deleteBranch()
135{

Callers

nothing calls this directly

Calls 6

QStringClass · 0.50
currentIndexMethod · 0.45
isValidMethod · 0.45
toStringMethod · 0.45
dataMethod · 0.45
isEmptyMethod · 0.45

Tested by

no test coverage detected