| 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) |