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

Method start

plugins/cmakebuilder/prunejob.cpp:30–61  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28}
29
30void PruneJob::start()
31{
32 auto* output = new OutputModel(this);
33 setModel(output);
34 startOutput();
35
36 Path builddir = CMake::currentBuildDir( m_project );
37 if( builddir.isEmpty() )
38 {
39 output->appendLine(i18n("No build directory configured, cannot clear the build directory"));
40 emitResult();
41 return;
42 }
43 else if (!builddir.isLocalFile() || QDir(builddir.toLocalFile()).exists(QStringLiteral("CMakeLists.txt")))
44 {
45 output->appendLine(i18n("Wrong build directory, cannot clear the build directory"));
46 emitResult();
47 return;
48 }
49
50 QDir d( builddir.toLocalFile() );
51 QList<QUrl> urls;
52 const auto entries = d.entryList(QDir::NoDotAndDotDot | QDir::AllEntries | QDir::Hidden);
53 urls.reserve(entries.size());
54 for (const auto& entry : entries) {
55 urls << Path(builddir, entry).toUrl();
56 }
57 output->appendLine(i18n("%1> rm -rf %2", m_project->path().pathOrUrl(), builddir.toLocalFile()));
58 m_job = KIO::del( urls );
59 m_job->start();
60 connect(m_job, &KJob::finished, this, &PruneJob::jobFinished);
61}
62
63bool PruneJob::doKill()
64{

Callers 5

completionInvokedMethod · 0.45
executeCompletionItemMethod · 0.45
cmakeExecutableVersionFunction · 0.45
executeProcessFunction · 0.45

Calls 13

currentBuildDirFunction · 0.85
isLocalFileMethod · 0.80
existsMethod · 0.80
toLocalFileMethod · 0.80
pathOrUrlMethod · 0.80
QDirClass · 0.50
PathClass · 0.50
isEmptyMethod · 0.45
appendLineMethod · 0.45
reserveMethod · 0.45
sizeMethod · 0.45
toUrlMethod · 0.45

Tested by

no test coverage detected