| 141 | } |
| 142 | |
| 143 | void YACReader::iterate(const QModelIndex &index, |
| 144 | const QAbstractItemModel *model, |
| 145 | const std::function<bool(const QModelIndex &)> &iteration) |
| 146 | { |
| 147 | if (index.isValid()) { |
| 148 | auto continueIterating = iteration(index); |
| 149 | if (!continueIterating) { |
| 150 | return; |
| 151 | } |
| 152 | } |
| 153 | if ((index.flags() & Qt::ItemNeverHasChildren) || !model->hasChildren(index)) |
| 154 | return; |
| 155 | auto rows = model->rowCount(index); |
| 156 | for (int i = 0; i < rows; ++i) |
| 157 | iterate(model->index(i, 0, index), model, iteration); |
| 158 | } |
| 159 | |
| 160 | QLibrary *YACReader::load7zLibrary() |
| 161 | { |