diff --git a/openbr/openbr_plugin.cpp b/openbr/openbr_plugin.cpp index f36780f..f0e0e9c 100644 --- a/openbr/openbr_plugin.cpp +++ b/openbr/openbr_plugin.cpp @@ -476,6 +476,18 @@ TemplateList TemplateList::fromGallery(const br::File &gallery) return templates; } +TemplateList TemplateList::fromBuffer(const QByteArray &buffer) +{ + TemplateList templateList; + QDataStream stream(buffer); + while (!stream.atEnd()) { + Template t; + stream >> t; + templateList.append(t); + } + return templateList; +} + // indexes some property, assigns an integer id to each unique value of propName // stores the index values in "Label" of the output template list TemplateList TemplateList::relabel(const TemplateList &tl, const QString &propName, bool preserveIntegers) diff --git a/openbr/openbr_plugin.h b/openbr/openbr_plugin.h index f983238..1d9f7cd 100644 --- a/openbr/openbr_plugin.h +++ b/openbr/openbr_plugin.h @@ -437,6 +437,9 @@ struct TemplateList : public QList