From ccf916344b7f91934cf5fa2aaf949b786fe1f3c1 Mon Sep 17 00:00:00 2001 From: Miika Turkia Date: Sun, 7 May 2017 21:22:00 +0300 Subject: Include some extradata info on Seabear import Signed-off-by: Miika Turkia --- core/qthelper.cpp | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'core') diff --git a/core/qthelper.cpp b/core/qthelper.cpp index 45e402fc7..238a0bc11 100644 --- a/core/qthelper.cpp +++ b/core/qthelper.cpp @@ -1582,6 +1582,37 @@ int parse_seabear_header(const char *filename, char **params, int pnr) } f.seek(0); + /* + * Grabbing some fields for the extradata + */ + + while ((parseLine = f.readLine().trimmed()).length() > 0 && !f.atEnd()) { + QString needle = "//Firmware Version: "; + if (parseLine.contains(needle)) { + params[pnr++] = strdup("Firmware"); + params[pnr++] = strdup(parseLine.replace(needle, QString::fromLatin1("")).prepend("\"").append("\"").toUtf8().data()); + } + } + f.seek(0); + + while ((parseLine = f.readLine().trimmed()).length() > 0 && !f.atEnd()) { + QString needle = "//Serial number: "; + if (parseLine.contains(needle)) { + params[pnr++] = strdup("Serial"); + params[pnr++] = strdup(parseLine.replace(needle, QString::fromLatin1("")).prepend("\"").append("\"").toUtf8().data()); + } + } + f.seek(0); + + while ((parseLine = f.readLine().trimmed()).length() > 0 && !f.atEnd()) { + QString needle = "//GF: "; + if (parseLine.contains(needle)) { + params[pnr++] = strdup("GF"); + params[pnr++] = strdup(parseLine.replace(needle, QString::fromLatin1("")).prepend("\"").append("\"").toUtf8().data()); + } + } + f.seek(0); + while ((parseLine = f.readLine().trimmed()).length() > 0 && !f.atEnd()) { } -- cgit v1.2.3-70-g09d2