| 499 | } |
| 500 | |
| 501 | void RepoStatusModel::itemsAdded(const QModelIndex& parent, int start, int end) |
| 502 | { |
| 503 | ProjectModel* model = ICore::self()->projectController()->projectModel(); |
| 504 | ProjectBaseItem* item = model->itemFromIndex(parent); |
| 505 | |
| 506 | if (!item) |
| 507 | return; |
| 508 | |
| 509 | IProject* project = item->project(); |
| 510 | |
| 511 | if (!findProject(project)) |
| 512 | return; |
| 513 | |
| 514 | // FIXME: this code is utterly broken. See the long comment in the slot |
| 515 | // ProjectChangesModel::itemsAdded(), from which the code has been copied. |
| 516 | |
| 517 | QList<QUrl> urls; |
| 518 | |
| 519 | for (int i = start; i < end; i++) { |
| 520 | QModelIndex idx = parent.model()->index(i, 0, parent); |
| 521 | item = model->itemFromIndex(idx); |
| 522 | |
| 523 | if (item->type() == ProjectBaseItem::File || item->type() == ProjectBaseItem::Folder |
| 524 | || item->type() == ProjectBaseItem::BuildFolder) |
| 525 | urls += item->path().toUrl(); |
| 526 | } |
| 527 | |
| 528 | if (!urls.isEmpty()) |
| 529 | fetchStatusesForUrls(project, urls, IBasicVersionControl::NonRecursive); |
| 530 | } |
| 531 | |
| 532 | void RepoStatusModel::reload(const QList<IProject*>& projects) |
| 533 | { |
nothing calls this directly
no test coverage detected