aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorGravatar Miika Turkia <miika.turkia@gmail.com>2017-05-07 14:19:58 +0300
committerGravatar Miika Turkia <miika.turkia@gmail.com>2017-05-07 14:19:58 +0300
commitcef56c6290c82b882181bf7477ee96ad4fa65dcd (patch)
tree426d378c10acbd8c491ac59af994f79393eafc7f /core
parent0dfa448d8c7132bd0058a6fb3bc820fdde2a4759 (diff)
downloadsubsurface-cef56c6290c82b882181bf7477ee96ad4fa65dcd.tar.gz
Import dive number from Seabear CSV file
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Diffstat (limited to 'core')
-rw-r--r--core/qthelper.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/core/qthelper.cpp b/core/qthelper.cpp
index 0673a78ce..cbfbd2f72 100644
--- a/core/qthelper.cpp
+++ b/core/qthelper.cpp
@@ -1518,6 +1518,19 @@ int parse_seabear_header(const char *filename, char **params, int pnr)
QString parseLine = f.readLine();
/*
+ * Parse dive number from Seabear CSV header
+ */
+
+ while ((parseLine = f.readLine().trimmed()).length() > 0 && !f.atEnd()) {
+ if (parseLine.contains("//DIVE NR: ")) {
+ qDebug() << "DEBGU: " << parseLine;
+ params[pnr++] = strdup("diveNro");
+ params[pnr++] = strdup(parseLine.replace(QString::fromLatin1("//DIVE NR: "), QString::fromLatin1("")).toUtf8().data());
+ break;
+ }
+ }
+
+ /*
* Parse header - currently only interested in sample
* interval and hardware version. If we have old format
* the interval value is missing from the header.