Commit e753e4edeb1c4b0f88c078e522fd67a84fd3c120
Merge pull request #88 from biometrics/name_property
allow File::name to be queried using 'name' property
Showing
2 changed files
with
3 additions
and
2 deletions
openbr/openbr_plugin.cpp
| ... | ... | @@ -127,12 +127,12 @@ QString File::resolved() const |
| 127 | 127 | |
| 128 | 128 | bool File::contains(const QString &key) const |
| 129 | 129 | { |
| 130 | - return m_metadata.contains(key) || Globals->contains(key); | |
| 130 | + return m_metadata.contains(key) || Globals->contains(key) || key == "name"; | |
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 | QVariant File::value(const QString &key) const |
| 134 | 134 | { |
| 135 | - return m_metadata.contains(key) ? m_metadata.value(key) : Globals->property(qPrintable(key)); | |
| 135 | + return m_metadata.contains(key) ? m_metadata.value(key) : (key == "name" ? name : Globals->property(qPrintable(key))); | |
| 136 | 136 | } |
| 137 | 137 | |
| 138 | 138 | QVariant File::parse(const QString &value) | ... | ... |
openbr/openbr_plugin.h
| ... | ... | @@ -138,6 +138,7 @@ void reset_##NAME() { NAME = DEFAULT; } |
| 138 | 138 | * |
| 139 | 139 | * Key | Value | Description |
| 140 | 140 | * --- | ---- | ----------- |
| 141 | + * name | QString | Contents of #name | |
| 141 | 142 | * separator | QString | Seperate #name into multiple files |
| 142 | 143 | * Index | int | Index of a template in a template list |
| 143 | 144 | * Confidence | float | Classification/Regression quality | ... | ... |