diff --git a/openbr/core/core.cpp b/openbr/core/core.cpp index cb9c809..070cab4 100644 --- a/openbr/core/core.cpp +++ b/openbr/core/core.cpp @@ -142,11 +142,8 @@ struct AlgorithmCore // assuming it is not already present. QFileInfo finfo(model); QString path = finfo.absolutePath(); - QList paths = Globals->file.getList("modelSearch",QList() ); - if (!paths.contains(path)) { - paths.append(path); - Globals->file.setList("modelSearch", paths); - } + if (!Globals->modelSearch.contains(path)) + Globals->modelSearch.append(path); QtUtils::BlockCompression compressedRead; QFile inFile(model); @@ -777,9 +774,7 @@ class pathInitializer : public Initializer Q_OBJECT void initialize() const { - QList paths = Globals->file.getList("modelSearch",QList()); - paths.append(Globals->sdkPath + "/share/openbr/models/transforms/"); - Globals->file.setList("modelSearch", paths); + Globals->modelSearch.append(Globals->sdkPath + "/share/openbr/models/transforms/"); } }; diff --git a/openbr/openbr_plugin.h b/openbr/openbr_plugin.h index ac99081..5b22901 100644 --- a/openbr/openbr_plugin.h +++ b/openbr/openbr_plugin.h @@ -754,6 +754,12 @@ public: Q_PROPERTY(int crossValidate READ get_crossValidate WRITE set_crossValidate RESET reset_crossValidate) BR_PROPERTY(int, crossValidate, 0) + /*! + * \brief List of paths sub-models will be searched for on + */ + Q_PROPERTY(QList modelSearch READ get_modelSearch WRITE set_modelSearch RESET reset_modelSearch) + BR_PROPERTY(QList, modelSearch, QList() ) + QHash abbreviations; /*!< \brief Used by br::Transform::make() to expand abbreviated algorithms into their complete definitions. */ QTime startTime; /*!< \brief Used to estimate timeRemaining(). */ diff --git a/openbr/plugins/core/loadstore.cpp b/openbr/plugins/core/loadstore.cpp index 20872e5..5657aa8 100644 --- a/openbr/plugins/core/loadstore.cpp +++ b/openbr/plugins/core/loadstore.cpp @@ -130,7 +130,7 @@ private: { if (QFileInfo(fileName).exists()) return fileName; - foreach(const QString &path, Globals->file.getList("modelSearch",QList())) { + foreach(const QString &path, Globals->modelSearch) { const QString file = path + "/" + fileName; if (QFileInfo(file).exists()) return file;