From 9abe69538c34a96b02feb2afb5ff07c495b17f6e Mon Sep 17 00:00:00 2001 From: Charles Otto Date: Fri, 16 Jan 2015 16:28:44 -0500 Subject: [PATCH] More elaborate stored transform handling --- openbr/openbr_plugin.cpp | 7 +++++++ openbr/plugins/meta.cpp | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/openbr/openbr_plugin.cpp b/openbr/openbr_plugin.cpp index 4fff6d5..533c5f3 100644 --- a/openbr/openbr_plugin.cpp +++ b/openbr/openbr_plugin.cpp @@ -1413,6 +1413,13 @@ Transform *Transform::make(QString str, QObject *parent) if (str.startsWith('(') && str.endsWith(')')) return make(str.mid(1, str.size()-2), parent); + // Base name not found? Try constructing it via LoadStore + if (!Factory::names().contains(parsed.suffix())) { + Transform *tform = make("<"+parsed.suffix()+">", parent); + applyAdditionalProperties(parsed, tform); + return tform; + } + //! [Construct the root transform] Transform *transform = Factory::make("." + str); //! [Construct the root transform] diff --git a/openbr/plugins/meta.cpp b/openbr/plugins/meta.cpp index aaa0e22..df880d5 100644 --- a/openbr/plugins/meta.cpp +++ b/openbr/plugins/meta.cpp @@ -540,7 +540,7 @@ private: void init() { if (transform != NULL) return; - if (fileName.isEmpty()) baseName = QRegExp("^[a-zA-Z0-9]+$").exactMatch(transformString) ? transformString : QtUtils::shortTextHash(transformString); + if (fileName.isEmpty()) baseName = QRegExp("^[_a-zA-Z0-9]+$").exactMatch(transformString) ? transformString : QtUtils::shortTextHash(transformString); else baseName = fileName; if (!tryLoad()) transform = make(transformString); -- libgit2 0.21.4