Commit 686c452fe3989358ca90f5653fc47f86a5b4f3fd
Committed by
GitHub
Merge pull request #507 from biometrics/split_metadata
Only use old metadata for an empty file
Showing
1 changed file
with
6 additions
and
2 deletions
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 | } |