Finds the immediate child of a `parent` item whose data with role `role` has value `value` */
| 150 | |
| 151 | /* Finds the immediate child of a `parent` item whose data with role `role` has value `value` */ |
| 152 | QStandardItem* findItemChild(const QStandardItem* parent, const QVariant& value, int role = Qt::DisplayRole) |
| 153 | { |
| 154 | for (int i = 0; i < parent->rowCount(); i++) { |
| 155 | QStandardItem* curr = parent->child(i); |
| 156 | |
| 157 | if (curr->data(role) == value) |
| 158 | return curr; |
| 159 | } |
| 160 | |
| 161 | return nullptr; |
| 162 | } |
| 163 | |
| 164 | QStandardItem* RepoStatusModel::findProject(const IProject* project) const |
| 165 | { |
no test coverage detected