Commit a8340241bcb0e656f6e33d2746a1ff528b3643f6
1 parent
635d2dc2
Allow users to prevent the Distribute transform from being added to algorithms
-algorithm something[distribute=false] prevents the default DistributeTemplate from being prepended to the transform part of "something"
Showing
1 changed file
with
7 additions
and
2 deletions
openbr/core/core.cpp
| ... | ... | @@ -281,6 +281,9 @@ private: |
| 281 | 281 | const QString file = getFileName(description); |
| 282 | 282 | if (!file.isEmpty()) description = file; |
| 283 | 283 | |
| 284 | + File asdf(description); | |
| 285 | + QString distribute_status = asdf.get<QString>("distribute","true"); | |
| 286 | + | |
| 284 | 287 | if (QFileInfo(description).exists()) { |
| 285 | 288 | qDebug("Loading %s", qPrintable(QFileInfo(description).fileName())); |
| 286 | 289 | load(description); |
| ... | ... | @@ -294,8 +297,10 @@ private: |
| 294 | 297 | QStringList words = QtUtils::parse(description, ':'); |
| 295 | 298 | if (words.size() > 2) qFatal("Invalid algorithm format."); |
| 296 | 299 | |
| 297 | - words[0].prepend("DistributeTemplate("); | |
| 298 | - words[0].append(")"); | |
| 300 | + if (distribute_status == "true") { | |
| 301 | + words[0].prepend("DistributeTemplate("); | |
| 302 | + words[0].append(")"); | |
| 303 | + } | |
| 299 | 304 | |
| 300 | 305 | transform = QSharedPointer<Transform>(Transform::make(words[0], NULL)); |
| 301 | 306 | if (words.size() > 1) distance = QSharedPointer<Distance>(Distance::make(words[1], NULL)); | ... | ... |