diff options
author | Miika Turkia <miika.turkia@gmail.com> | 2017-05-07 21:22:00 +0300 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2017-05-07 21:36:50 -0700 |
commit | ccf916344b7f91934cf5fa2aaf949b786fe1f3c1 (patch) | |
tree | 122258a2e49f6f47a9ae088700201793211798d1 /core | |
parent | d7cf3408e5d2f8c7f5ce25fa2b330cc3e75ff489 (diff) | |
download | subsurface-ccf916344b7f91934cf5fa2aaf949b786fe1f3c1.tar.gz |
Include some extradata info on Seabear import
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Diffstat (limited to 'core')
-rw-r--r-- | core/qthelper.cpp | 31 |
1 files changed, 31 insertions, 0 deletions
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()) { } |