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

Method collectDirectories

plugins/qmakemanager/qmakemanager.cpp:371–408  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

369}
370
371Path::List QMakeProjectManager::collectDirectories(ProjectBaseItem* item, const bool collectIncludes) const
372{
373 Path::List list;
374 QMakeFolderItem* folder = findQMakeFolderParent(item);
375 if (folder) {
376 const auto proFiles = folder->projectFiles();
377 for (QMakeProjectFile* pro : proFiles) {
378 if (pro->files().contains(item->path().toLocalFile())) {
379 const QStringList directories = collectIncludes ? pro->includeDirectories() : pro->frameworkDirectories();
380 for (const QString& dir : directories) {
381 Path path(dir);
382 if (!list.contains(path)) {
383 list << path;
384 }
385 }
386 }
387 }
388 if (list.isEmpty()) {
389 // fallback for new files, use all possible include dirs
390 const auto proFiles = folder->projectFiles();
391 for (QMakeProjectFile* pro : proFiles) {
392 const QStringList directories = collectIncludes ? pro->includeDirectories() : pro->frameworkDirectories();
393 for (const QString& dir : directories) {
394 Path path(dir);
395 if (!list.contains(path)) {
396 list << path;
397 }
398 }
399 }
400 }
401 // make sure the base dir is included
402 if (!list.contains(folder->path())) {
403 list << folder->path();
404 }
405 // qCDebug(KDEV_QMAKE) << "include dirs for" << item->path() << ":" << list;
406 }
407 return list;
408}
409
410Path::List QMakeProjectManager::includeDirectories(ProjectBaseItem* item) const
411{

Callers

nothing calls this directly

Calls 9

findQMakeFolderParentFunction · 0.85
projectFilesMethod · 0.80
toLocalFileMethod · 0.80
containsMethod · 0.45
filesMethod · 0.45
pathMethod · 0.45
includeDirectoriesMethod · 0.45
frameworkDirectoriesMethod · 0.45
isEmptyMethod · 0.45

Tested by

no test coverage detected