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

Method setBaseItem

plugins/execute/projecttargetscombobox.cpp:46–72  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44
45
46void ProjectTargetsComboBox::setBaseItem(ProjectFolderItem* item, bool exec)
47{
48 clear();
49
50 QList<ProjectFolderItem*> items;
51 if(item) {
52 items += item;
53 } else {
54 const auto projects = ICore::self()->projectController()->projects();
55 items.reserve(projects.size());
56 for (auto* p : projects) {
57 items += p->projectItem();
58 }
59 }
60
61 ExecutablePathsVisitor walker(exec);
62 for (ProjectFolderItem* item : std::as_const(items)) {
63 walker.visit(item);
64 }
65 walker.sort();
66
67 const auto executableItems = walker.paths();
68 for (const QString& item : executableItems) {
69 addItem(QIcon::fromTheme(QStringLiteral("system-run")), item);
70 }
71
72}
73
74QStringList ProjectTargetsComboBox::currentItemPath() const
75{

Callers 1

loadFromConfigurationMethod · 0.45

Calls 9

projectsMethod · 0.80
projectControllerMethod · 0.80
clearFunction · 0.50
reserveMethod · 0.45
sizeMethod · 0.45
projectItemMethod · 0.45
visitMethod · 0.45
sortMethod · 0.45
pathsMethod · 0.45

Tested by

no test coverage detected