Commit 06946725831838a4bf22375448f94e713b762a0e
Merge commit 'aa08653'
Showing
1 changed file
with
6 additions
and
3 deletions
openbr/plugins/gallery/lmdb.cpp
| ... | ... | @@ -15,6 +15,8 @@ using namespace br; |
| 15 | 15 | class lmdbGallery : public Gallery |
| 16 | 16 | { |
| 17 | 17 | Q_OBJECT |
| 18 | + Q_PROPERTY(bool remap READ get_remap WRITE set_remap RESET reset_remap STORED false) | |
| 19 | + BR_PROPERTY(bool, remap, true) | |
| 18 | 20 | |
| 19 | 21 | TemplateList readBlock(bool *done) |
| 20 | 22 | { |
| ... | ... | @@ -129,9 +131,10 @@ class lmdbGallery : public Gallery |
| 129 | 131 | QVariant base_label = t.file.value("Label"); |
| 130 | 132 | QString label_str = base_label.toString(); |
| 131 | 133 | |
| 132 | - | |
| 133 | - if (!base->observedLabels.contains(label_str) ) | |
| 134 | - base->observedLabels.insert(label_str, base->observedLabels.size()); | |
| 134 | + if (!base->observedLabels.contains(label_str)) { | |
| 135 | + if (base->remap) base->observedLabels.insert(label_str, base->observedLabels.size()); | |
| 136 | + else base->observedLabels.insert(label_str, label_str.toInt()); | |
| 137 | + } | |
| 135 | 138 | |
| 136 | 139 | datum.set_label(base->observedLabels[label_str]); |
| 137 | 140 | ... | ... |