aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--qt-ui/divelogimportdialog.cpp4
-rw-r--r--tests/testparse.cpp2
2 files changed, 3 insertions, 3 deletions
diff --git a/qt-ui/divelogimportdialog.cpp b/qt-ui/divelogimportdialog.cpp
index 29138da87..3a3402371 100644
--- a/qt-ui/divelogimportdialog.cpp
+++ b/qt-ui/divelogimportdialog.cpp
@@ -397,7 +397,7 @@ void DiveLogImportDialog::loadFileContents(int value, whatChanged triggeredBy)
* the interval value is missing from the header.
*/
- while ((firstLine = f.readLine()).length() > 3 && !f.atEnd()) {
+ while ((firstLine = f.readLine().trimmed()).length() > 0 && !f.atEnd()) {
if (firstLine.contains("//Hardware Version: ")) {
hw = firstLine.replace(QString::fromLatin1("//Hardware Version: "), QString::fromLatin1("\"Seabear ")).trimmed().append("\"");
break;
@@ -408,7 +408,7 @@ void DiveLogImportDialog::loadFileContents(int value, whatChanged triggeredBy)
* Note that we scan over the "Log interval" on purpose
*/
- while ((firstLine = f.readLine()).length() > 3 && !f.atEnd()) {
+ while ((firstLine = f.readLine().trimmed()).length() > 0 && !f.atEnd()) {
if (firstLine.contains("//Log interval: "))
delta = firstLine.remove(QString::fromLatin1("//Log interval: ")).trimmed().remove(QString::fromLatin1(" s"));
}
diff --git a/tests/testparse.cpp b/tests/testparse.cpp
index 9288baf63..fa1d6d223 100644
--- a/tests/testparse.cpp
+++ b/tests/testparse.cpp
@@ -166,7 +166,7 @@ void TestParse::testParseNewFormat()
*/
f.open(QFile::ReadOnly);
- while ((firstLine = f.readLine()).length() > 3 && !f.atEnd()) {
+ while ((firstLine = f.readLine().trimmed()).length() > 0 && !f.atEnd()) {
if (firstLine.contains("//Log interval: "))
delta = firstLine.remove(QString::fromLatin1("//Log interval: ")).trimmed().remove(QString::fromLatin1(" s"));
}