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

Method cloneSelectedProfile

kdevplatform/shell/settings/environmentwidget.cpp:278–292  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

276}
277
278void EnvironmentWidget::cloneSelectedProfile()
279{
280 const int currentIndex = ui.profileSelect->currentIndex();
281 const auto currentProfileName = m_environmentProfileListModel->profileName(currentIndex);
282 // pass original name as starting name, as the user might want to enter a variant of it
283 const auto profileName = askNewProfileName(currentProfileName);
284 if (profileName.isEmpty()) {
285 return;
286 }
287
288 const int profileIndex = m_environmentProfileListModel->cloneProfile(profileName, currentProfileName);
289
290 ui.profileSelect->setCurrentIndex(profileIndex);
291 ui.variableTable->setFocus(Qt::OtherFocusReason);
292}
293
294void EnvironmentWidget::removeSelectedProfile()
295{

Callers

nothing calls this directly

Calls 5

profileNameMethod · 0.80
cloneProfileMethod · 0.80
setCurrentIndexMethod · 0.80
currentIndexMethod · 0.45
isEmptyMethod · 0.45

Tested by

no test coverage detected