summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorGravatar Miika Turkia <miika.turkia@gmail.com>2017-05-07 21:22:00 +0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2017-05-07 21:36:50 -0700
commitccf916344b7f91934cf5fa2aaf949b786fe1f3c1 (patch)
tree122258a2e49f6f47a9ae088700201793211798d1 /core
parentd7cf3408e5d2f8c7f5ce25fa2b330cc3e75ff489 (diff)
downloadsubsurface-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.cpp31
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()) {
}