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

Method itemsAdded

plugins/git/repostatusmodel.cpp:501–530  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

499}
500
501void 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
532void RepoStatusModel::reload(const QList<IProject*>& projects)
533{

Callers

nothing calls this directly

Calls 11

findProjectFunction · 0.85
projectControllerMethod · 0.80
projectModelMethod · 0.45
itemFromIndexMethod · 0.45
projectMethod · 0.45
indexMethod · 0.45
modelMethod · 0.45
typeMethod · 0.45
toUrlMethod · 0.45
pathMethod · 0.45
isEmptyMethod · 0.45

Tested by

no test coverage detected