From 3289608e4f5a9dc91633d695787f0c728f5cd4a8 Mon Sep 17 00:00:00 2001 From: Josh Klontz Date: Mon, 14 Apr 2014 15:23:34 -0400 Subject: [PATCH] moved turkGallery to turk.cpp --- openbr/plugins/gallery.cpp | 66 ------------------------------------------------------------------ openbr/plugins/turk.cpp | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+), 66 deletions(-) diff --git a/openbr/plugins/gallery.cpp b/openbr/plugins/gallery.cpp index d3187a8..e1e2144 100644 --- a/openbr/plugins/gallery.cpp +++ b/openbr/plugins/gallery.cpp @@ -1019,72 +1019,6 @@ class landmarksGallery : public Gallery BR_REGISTER(Gallery, landmarksGallery) -/*! - * \ingroup galleries - * \brief Treats each line as a file. - * \author Josh Klontz \cite jklontz - * - * Columns should be comma separated with first row containing headers. - * The first column in the file should be the path to the file to enroll. - * Other columns will be treated as file metadata. - * - * \see txtGallery - */ -class turkGallery : public Gallery -{ - Q_OBJECT -; - TemplateList readBlock(bool *done) - { - *done = true; - TemplateList templates; - if (!file.exists()) return templates; - - QStringList lines = QtUtils::readLines(file); - QRegExp regexp(",(?!(?:\\w+,?)+\\])"); - - QStringList headers; - - if (!lines.isEmpty()) headers = lines.takeFirst().split(regexp); - - foreach (const QString &line, lines) { - QStringList words = line.split(regexp); - if (words.size() != headers.size()) continue; - File f; - f.name = words[0]; - f.set("Label", words[0].mid(0,5)); - - for (int i=1; i categoryMap; - for (int j=0; j categoryMap; + for (int j=0; j