mirror of
https://github.com/Lurkki14/tuxclocker.git
synced 2025-02-25 18:55:24 -06:00
call callback on the index it is called with
This commit is contained in:
parent
b6ed9b2e7c
commit
928a031208
@ -22,6 +22,9 @@ QVariant fromAssignmentArgument(TuxClocker::Device::AssignmentArgument arg) {
|
||||
|
||||
void traverseModel(
|
||||
const ModelTraverseCallback &cb, QAbstractItemModel *model, const QModelIndex &parent) {
|
||||
// Run callback on the index itself
|
||||
(void) cb(model, parent.parent(), parent.row());
|
||||
|
||||
for (int i = 0; i < model->rowCount(parent); i++) {
|
||||
auto nextOpt = cb(model, parent, i);
|
||||
if (!nextOpt.has_value())
|
||||
|
Loading…
Reference in New Issue
Block a user