| 124 | } |
| 125 | |
| 126 | void 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" |
nothing calls this directly
no test coverage detected