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

Method reloadFromContextMenu

plugins/projectmanagerview/projectmanagerviewplugin.cpp:512–540  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

510}
511
512void ProjectManagerViewPlugin::reloadFromContextMenu( )
513{
514 QList< KDevelop::ProjectFolderItem* > folders;
515 const auto items = itemsFromIndexes(d->ctxProjectItemList);
516 for (KDevelop::ProjectBaseItem* item : items) {
517 if ( item->folder() ) {
518 // since reloading should be recursive, only pass the upper-most items
519 bool found = false;
520 const auto currentFolders = folders;
521 for (KDevelop::ProjectFolderItem* existing : currentFolders) {
522 if ( existing->path().isParentOf(item->folder()->path()) ) {
523 // simply skip this child
524 found = true;
525 break;
526 } else if ( item->folder()->path().isParentOf(existing->path()) ) {
527 // remove the child in the list and add the current item instead
528 folders.removeOne(existing);
529 // continue since there could be more than one existing child
530 }
531 }
532 if ( !found ) {
533 folders << item->folder();
534 }
535 }
536 }
537 for (KDevelop::ProjectFolderItem* folder : std::as_const(folders)) {
538 folder->project()->projectFileManager()->reload(folder);
539 }
540}
541
542void ProjectManagerViewPlugin::createFolderFromContextMenu( )
543{

Callers

nothing calls this directly

Calls 8

itemsFromIndexesFunction · 0.85
folderMethod · 0.80
isParentOfMethod · 0.80
removeOneMethod · 0.80
projectFileManagerMethod · 0.80
pathMethod · 0.45
reloadMethod · 0.45
projectMethod · 0.45

Tested by

no test coverage detected