| 329 | } |
| 330 | |
| 331 | void CMakePreferences::removeBuildDir() |
| 332 | { |
| 333 | int curr=m_prefsUi->buildDirs->currentIndex(); |
| 334 | if(curr < 0) |
| 335 | return; |
| 336 | |
| 337 | Path removedPath = CMake::currentBuildDir( m_project ); |
| 338 | QString removed = removedPath.toLocalFile(); |
| 339 | if(QDir(removed).exists()) |
| 340 | { |
| 341 | int ret = KMessageBox::warningTwoActions( |
| 342 | this, |
| 343 | i18n("The %1 directory is about to be removed in KDevelop's list.\n" |
| 344 | "Do you want KDevelop to delete it in the file system as well?", |
| 345 | removed), |
| 346 | {}, KStandardGuiItem::del(), |
| 347 | KGuiItem(i18nc("@action:button", "Do Not Delete"), QStringLiteral("dialog-cancel"))); |
| 348 | if (ret == KMessageBox::PrimaryAction) { |
| 349 | auto deleteJob = KIO::del(removedPath.toUrl()); |
| 350 | KJobWidgets::setWindow(deleteJob, this); |
| 351 | if (!deleteJob->exec()) |
| 352 | KMessageBox::error(this, i18n("Could not remove: %1", removed)); |
| 353 | } |
| 354 | } |
| 355 | |
| 356 | qCDebug(CMAKE) << "removing from cmake config: using builddir " << curr; |
| 357 | qCDebug(CMAKE) << "removing from cmake config: builddir path " << removedPath; |
| 358 | qCDebug(CMAKE) << "removing from cmake config: installdir " << CMake::currentInstallDir( m_project ); |
| 359 | qCDebug(CMAKE) << "removing from cmake config: extra args" << CMake::currentExtraArguments( m_project ); |
| 360 | qCDebug(CMAKE) << "removing from cmake config: buildtype " << CMake::currentBuildType( m_project ); |
| 361 | qCDebug(CMAKE) << "removing from cmake config: cmake executable " << CMake::currentCMakeExecutable(m_project); |
| 362 | qCDebug(CMAKE) << "removing from cmake config: environment " << CMake::currentEnvironment( m_project ); |
| 363 | |
| 364 | |
| 365 | CMake::removeBuildDirConfig(m_project); |
| 366 | m_prefsUi->buildDirs->removeItem( curr ); // this triggers buildDirChanged() |
| 367 | if(m_prefsUi->buildDirs->count()==0) |
| 368 | m_prefsUi->removeBuildDir->setEnabled(false); |
| 369 | |
| 370 | emit changed(); |
| 371 | } |
| 372 | |
| 373 | void CMakePreferences::configure() |
| 374 | { |
nothing calls this directly
no test coverage detected