Commit 4cf201e993b7459fb6e59463a01231af87f4e75d
1 parent
edddbc52
Switched to iterator
Showing
1 changed file
with
7 additions
and
4 deletions
openbr/plugins/gallery/binary.cpp
| ... | ... | @@ -178,10 +178,13 @@ class galGallery : public BinaryGallery |
| 178 | 178 | else if (t.file.fte) { |
| 179 | 179 | // Only write metadata for failure to enroll, but remove any stored QVariants of type cv::Mat |
| 180 | 180 | File f = t.file; |
| 181 | - QList<QVariant> values = f.localMetadata().values(); | |
| 182 | - for (int i=0; i<values.size(); i++) | |
| 183 | - if (strcmp(values[i].typeName(),"cv::Mat") == 0) | |
| 184 | - f.remove(f.localMetadata().key(values[i])); | |
| 181 | + QVariantMap metadata = f.localMetadata(); | |
| 182 | + QMapIterator<QString, QVariant> i(metadata); | |
| 183 | + while (i.hasNext()) { | |
| 184 | + i.next(); | |
| 185 | + if (strcmp(i.value().typeName(),"cv::Mat") == 0) | |
| 186 | + f.remove(i.key()); | |
| 187 | + } | |
| 185 | 188 | stream << Template(f); |
| 186 | 189 | } |
| 187 | 190 | else | ... | ... |