Commit ba1580c3671a096c40c4ab5bc1e43b101ddf3c73

Authored by Charles Otto
1 parent 3c6b8c3c

Use Label as the default class identifier more consistently

openbr/openbr_plugin.cpp
@@ -412,8 +412,8 @@ TemplateList TemplateList::fromGallery(const br::File &gallery) @@ -412,8 +412,8 @@ TemplateList TemplateList::fromGallery(const br::File &gallery)
412 // of target images to every partition 412 // of target images to every partition
413 newTemplates[i].file.set("Partition", -1); 413 newTemplates[i].file.set("Partition", -1);
414 } else { 414 } else {
415 - // Direct use of "Subject" is not general -cao  
416 - const QByteArray md5 = QCryptographicHash::hash(newTemplates[i].file.get<QString>("Subject").toLatin1(), QCryptographicHash::Md5); 415 + // Direct use of "Label" is not general -cao
  416 + const QByteArray md5 = QCryptographicHash::hash(newTemplates[i].file.get<QString>("Label").toLatin1(), QCryptographicHash::Md5);
417 // Select the right 8 hex characters so that it can be represented as a 64 bit integer without overflow 417 // Select the right 8 hex characters so that it can be represented as a 64 bit integer without overflow
418 newTemplates[i].file.set("Partition", md5.toHex().right(8).toULongLong(0, 16) % crossValidate); 418 newTemplates[i].file.set("Partition", md5.toHex().right(8).toULongLong(0, 16) % crossValidate);
419 } 419 }
openbr/openbr_plugin.h
@@ -172,7 +172,7 @@ struct BR_EXPORT File @@ -172,7 +172,7 @@ struct BR_EXPORT File
172 172
173 File() {} 173 File() {}
174 File(const QString &file) { init(file); } /*!< \brief Construct a file from a string. */ 174 File(const QString &file) { init(file); } /*!< \brief Construct a file from a string. */
175 - File(const QString &file, const QVariant &subject) { init(file); set("Subject", subject); } /*!< \brief Construct a file from a string and assign a label. */ 175 + File(const QString &file, const QVariant &label) { init(file); set("Label", label); } /*!< \brief Construct a file from a string and assign a label. */
176 File(const char *file) { init(file); } /*!< \brief Construct a file from a c-style string. */ 176 File(const char *file) { init(file); } /*!< \brief Construct a file from a c-style string. */
177 inline operator QString() const { return name; } /*!< \brief Returns #name. */ 177 inline operator QString() const { return name; } /*!< \brief Returns #name. */
178 QString flat() const; /*!< \brief A stringified version of the file with metadata. */ 178 QString flat() const; /*!< \brief A stringified version of the file with metadata. */