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

Method removeBuildConfig

plugins/qmakebuilder/qmakebuilderpreferences.cpp:126–151  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

124}
125
126void QMakeBuilderPreferences::removeBuildConfig()
127{
128 qCDebug(KDEV_QMAKEBUILDER) << "Removing config" << m_prefsUi->buildDirCombo->currentText();
129 QString removed = m_prefsUi->buildDirCombo->currentText();
130 KConfigGroup cg(m_project->projectConfiguration(), QMakeConfig::CONFIG_GROUP());
131
132 m_prefsUi->buildDirCombo->removeItem(m_prefsUi->buildDirCombo->currentIndex());
133 m_prefsUi->removeButton->setEnabled(m_prefsUi->buildDirCombo->count() > 1);
134 cg.group(removed).deleteGroup(KConfigBase::Persistent);
135
136 if (QDir(removed).exists()) {
137 int ret = KMessageBox::warningTwoActions(
138 this,
139 i18n("The %1 directory is about to be removed in KDevelop's list.\n"
140 "Do you want KDevelop to delete it in the file system as well?",
141 removed),
142 {}, KStandardGuiItem::del(),
143 KGuiItem(i18nc("@action:button", "Do Not Delete"), QStringLiteral("dialog-cancel")));
144 if (ret == KMessageBox::PrimaryAction) {
145 auto deleteJob = KIO::del(QUrl::fromLocalFile(removed));
146 KJobWidgets::setWindow(deleteJob, this);
147 if (!deleteJob->exec())
148 KMessageBox::error(this, i18n("Could not remove: %1.", removed));
149 }
150 }
151}
152
153#include "moc_qmakebuilderpreferences.cpp"

Callers

nothing calls this directly

Calls 8

removeItemMethod · 0.80
existsMethod · 0.80
execMethod · 0.80
QDirClass · 0.50
projectConfigurationMethod · 0.45
currentIndexMethod · 0.45
setEnabledMethod · 0.45
countMethod · 0.45

Tested by

no test coverage detected