Commit 3b89cb25384340cc632dab3739daf39860855cc8

Authored by Josh Klontz
2 parents d10363ee 686c452f

Merge branch 'master' of https://github.com/biometrics/openbr

openbr/openbr_plugin.cpp
@@ -111,7 +111,11 @@ QList<File> File::split(const QString &separator) const @@ -111,7 +111,11 @@ QList<File> File::split(const QString &separator) const
111 QList<File> files; 111 QList<File> files;
112 foreach (const QString &word, name.split(separator, QString::SkipEmptyParts)) { 112 foreach (const QString &word, name.split(separator, QString::SkipEmptyParts)) {
113 File file(word); 113 File file(word);
114 - file.append(m_metadata); 114 + // If file metadata is empty after this constructor, it means that this is the
  115 + // file corresponding to *this.m_metadata, so we append its metadata to get
  116 + // the correct functionality
  117 + if (file.m_metadata.isEmpty())
  118 + file.append(m_metadata);
115 files.append(file); 119 files.append(file);
116 } 120 }
117 return files; 121 return files;
@@ -764,7 +768,7 @@ QStringList Object::prunedArguments(bool expanded) const @@ -764,7 +768,7 @@ QStringList Object::prunedArguments(bool expanded) const
764 const char *name = metaObject()->property(i).name(); 768 const char *name = metaObject()->property(i).name();
765 769
766 QVariant defaultVal = shellObject->property(name); 770 QVariant defaultVal = shellObject->property(name);
767 - 771 +
768 if (defaultVal != property(name)) 772 if (defaultVal != property(name))
769 arguments.append(name + QString("=") + argument(i, expanded)); 773 arguments.append(name + QString("=") + argument(i, expanded));
770 } 774 }
openbr/plugins/metadata/checkpoints.cpp
@@ -14,11 +14,18 @@ class CheckPointsTransform : public UntrainableMetadataTransform @@ -14,11 +14,18 @@ class CheckPointsTransform : public UntrainableMetadataTransform
14 Q_OBJECT 14 Q_OBJECT
15 15
16 Q_PROPERTY(QList<int> indices READ get_indices WRITE set_indices RESET reset_indices STORED false) 16 Q_PROPERTY(QList<int> indices READ get_indices WRITE set_indices RESET reset_indices STORED false)
  17 + Q_PROPERTY(int count READ get_count WRITE set_count RESET reset_count STORED false)
17 BR_PROPERTY(QList<int>, indices, QList<int>()) 18 BR_PROPERTY(QList<int>, indices, QList<int>())
  19 + BR_PROPERTY(int, count, 0)
18 20
19 void projectMetadata(const File &src, File &dst) const 21 void projectMetadata(const File &src, File &dst) const
20 { 22 {
21 dst = src; 23 dst = src;
  24 +
  25 + const QList<QPointF> points = src.points();
  26 + if (count && points.size() < count)
  27 + dst.fte = true;
  28 +
22 for (int i=0; i<indices.size(); i++) 29 for (int i=0; i<indices.size(); i++)
23 if (src.points()[indices[i]] == QPointF(-1,-1)) { 30 if (src.points()[indices[i]] == QPointF(-1,-1)) {
24 dst.fte = true; 31 dst.fte = true;