From 629330c6056bb14774a962de37526e5f59325c4f Mon Sep 17 00:00:00 2001 From: Tunde Date: Thu, 5 Jun 2014 17:14:43 -0400 Subject: [PATCH] Committing change to init function in AlgorithmCore which changes the default input to QStrings instead of Files to remove issues parenthessis and other issues --- openbr/core/core.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/openbr/core/core.cpp b/openbr/core/core.cpp index 32d71f2..42c93ae 100644 --- a/openbr/core/core.cpp +++ b/openbr/core/core.cpp @@ -516,17 +516,19 @@ private: QString getFileName(const QString &description) const { const QString file = Globals->sdkPath + "/share/openbr/models/algorithms/" + description; - return QFileInfo(file).exists() ? file : QString(); + QFileInfo qFile(file); + return qFile.exists() && !qFile.isDir() ? file : QString(); } - void init(const File &description) + void init(const QString &description) { // Check if a trained binary already exists for this algorithm const QString file = getFileName(description); if (!file.isEmpty()) return init(file); - if (description.exists()) { - qDebug("Loading %s", qPrintable(description.fileName())); + QFileInfo dFile(description); + if (dFile.exists()) { + qDebug("Loading %s", qPrintable(dFile.fileName())); load(description); return; } @@ -536,7 +538,7 @@ private: return init(Globals->abbreviations[description]); //! [Parsing the algorithm description] - QStringList words = QtUtils::parse(description.flat(), ':'); + QStringList words = QtUtils::parse(description, ':'); if ((words.size() < 1) || (words.size() > 2)) qFatal("Invalid algorithm format."); //! [Parsing the algorithm description] -- libgit2 0.21.4