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

Method itemsForPath

kdevplatform/shell/project.cpp:170–197  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

168 }
169
170 QList<ProjectBaseItem*> itemsForPath( const IndexedString& path ) const
171 {
172 if ( path.isEmpty() ) {
173 return QList<ProjectBaseItem*>();
174 }
175
176 if (!topItem->model()) {
177 // this gets hit when the project has not yet been added to the model
178 // i.e. during import phase
179 // TODO: should we handle this somehow?
180 // possible idea: make the item<->path hash per-project
181 return QList<ProjectBaseItem*>();
182 }
183
184 Q_ASSERT(topItem->model());
185 QList<ProjectBaseItem*> items = topItem->model()->itemsForPath(path);
186
187 QList<ProjectBaseItem*>::iterator it = items.begin();
188 while(it != items.end()) {
189 if ((*it)->project() != project) {
190 it = items.erase(it);
191 } else {
192 ++it;
193 }
194 }
195
196 return items;
197 }
198
199
200 void importDone( KJob* job)

Callers

nothing calls this directly

Calls 6

isEmptyMethod · 0.45
modelMethod · 0.45
itemsForPathMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
projectMethod · 0.45

Tested by

no test coverage detected