From a8340241bcb0e656f6e33d2746a1ff528b3643f6 Mon Sep 17 00:00:00 2001 From: Charles Otto Date: Thu, 4 Apr 2013 19:06:38 -0400 Subject: [PATCH] Allow users to prevent the Distribute transform from being added to algorithms --- openbr/core/core.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/openbr/core/core.cpp b/openbr/core/core.cpp index 50988a2..639c3b3 100644 --- a/openbr/core/core.cpp +++ b/openbr/core/core.cpp @@ -281,6 +281,9 @@ private: const QString file = getFileName(description); if (!file.isEmpty()) description = file; + File asdf(description); + QString distribute_status = asdf.get("distribute","true"); + if (QFileInfo(description).exists()) { qDebug("Loading %s", qPrintable(QFileInfo(description).fileName())); load(description); @@ -294,8 +297,10 @@ private: QStringList words = QtUtils::parse(description, ':'); if (words.size() > 2) qFatal("Invalid algorithm format."); - words[0].prepend("DistributeTemplate("); - words[0].append(")"); + if (distribute_status == "true") { + words[0].prepend("DistributeTemplate("); + words[0].append(")"); + } transform = QSharedPointer(Transform::make(words[0], NULL)); if (words.size() > 1) distance = QSharedPointer(Distance::make(words[1], NULL)); -- libgit2 0.21.4