Commit 459e5b888750939850a2f12624954f7a6dc27707
1 parent
05721739
File::init improvement, FilterDistance bug fix
Showing
2 changed files
with
5 additions
and
3 deletions
sdk/openbr_plugin.cpp
| @@ -256,11 +256,13 @@ void File::init(const QString &file) | @@ -256,11 +256,13 @@ void File::init(const QString &file) | ||
| 256 | if (words[1][0] == '(') { | 256 | if (words[1][0] == '(') { |
| 257 | QStringList values = words[1].split(','); | 257 | QStringList values = words[1].split(','); |
| 258 | if (values.size() == 2) /* QPointF */ { | 258 | if (values.size() == 2) /* QPointF */ { |
| 259 | - QPointF point(values[0].remove('(').toFloat(), values[1].remove(')').toFloat()); | 259 | + values[1].chop(1); |
| 260 | + QPointF point(values[0].mid(1).toFloat(), values[1].remove(')').toFloat()); | ||
| 260 | set(words[0], point); | 261 | set(words[0], point); |
| 261 | } | 262 | } |
| 262 | else /* QRectF */ { | 263 | else /* QRectF */ { |
| 263 | - QRectF rect(values[0].remove('(').toFloat(), values[1].toFloat(), values[2].toFloat(), values[3].remove(')').toFloat()); | 264 | + values[3].chop(1); |
| 265 | + QRectF rect(values[0].mid(1).toFloat(), values[1].toFloat(), values[2].toFloat(), values[3].remove(')').toFloat()); | ||
| 264 | set(words[0], rect); | 266 | set(words[0], rect); |
| 265 | } | 267 | } |
| 266 | } | 268 | } |
sdk/plugins/validate.cpp
| @@ -105,7 +105,7 @@ class FilterDistance : public Distance | @@ -105,7 +105,7 @@ class FilterDistance : public Distance | ||
| 105 | foreach (const QString &key, Globals->filters.keys()) { | 105 | foreach (const QString &key, Globals->filters.keys()) { |
| 106 | bool keep = false; | 106 | bool keep = false; |
| 107 | const QString metadata = a.file.get<QString>(key, ""); | 107 | const QString metadata = a.file.get<QString>(key, ""); |
| 108 | - if (metadata.isEmpty()) continue; | 108 | + if (metadata.isEmpty() || Globals->filters[key].isEmpty()) continue; |
| 109 | foreach (const QString &value, Globals->filters[key]) { | 109 | foreach (const QString &value, Globals->filters[key]) { |
| 110 | if (metadata == value) { | 110 | if (metadata == value) { |
| 111 | keep = true; | 111 | keep = true; |