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

Method removeBuildDir

plugins/cmake/settings/cmakepreferences.cpp:331–371  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

329}
330
331void 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
373void CMakePreferences::configure()
374{

Callers

nothing calls this directly

Calls 15

currentBuildDirFunction · 0.85
currentInstallDirFunction · 0.85
currentExtraArgumentsFunction · 0.85
currentBuildTypeFunction · 0.85
currentCMakeExecutableFunction · 0.85
currentEnvironmentFunction · 0.85
removeBuildDirConfigFunction · 0.85
toLocalFileMethod · 0.80
existsMethod · 0.80
execMethod · 0.80
removeItemMethod · 0.80
QDirClass · 0.50

Tested by

no test coverage detected