From 90c574fefe81b54a2eccdd72bf9152b662985c5c Mon Sep 17 00:00:00 2001 From: Josh Klontz Date: Fri, 9 Aug 2013 12:55:56 -0400 Subject: [PATCH] allow File::name to be queried using 'name' property --- openbr/openbr_plugin.cpp | 4 ++-- openbr/openbr_plugin.h | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/openbr/openbr_plugin.cpp b/openbr/openbr_plugin.cpp index 38aeb80..8caf86f 100644 --- a/openbr/openbr_plugin.cpp +++ b/openbr/openbr_plugin.cpp @@ -127,12 +127,12 @@ QString File::resolved() const bool File::contains(const QString &key) const { - return m_metadata.contains(key) || Globals->contains(key); + return m_metadata.contains(key) || Globals->contains(key) || key == "name"; } QVariant File::value(const QString &key) const { - return m_metadata.contains(key) ? m_metadata.value(key) : Globals->property(qPrintable(key)); + return m_metadata.contains(key) ? m_metadata.value(key) : (key == "name" ? name : Globals->property(qPrintable(key))); } QVariant File::parse(const QString &value) diff --git a/openbr/openbr_plugin.h b/openbr/openbr_plugin.h index 0f0d800..0161799 100644 --- a/openbr/openbr_plugin.h +++ b/openbr/openbr_plugin.h @@ -138,6 +138,7 @@ void reset_##NAME() { NAME = DEFAULT; } * * Key | Value | Description * --- | ---- | ----------- + * name | QString | Contents of #name * separator | QString | Seperate #name into multiple files * Index | int | Index of a template in a template list * Confidence | float | Classification/Regression quality -- libgit2 0.21.4