This attempts to detect the time format when initially importing a CSV
file. Well, only the minutes:seconds notation is detected currently.

Signed-off-by: Miika Turkia <[email protected]>
---
 desktop-widgets/divelogimportdialog.cpp | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/desktop-widgets/divelogimportdialog.cpp 
b/desktop-widgets/divelogimportdialog.cpp
index c99810a..363be80 100644
--- a/desktop-widgets/divelogimportdialog.cpp
+++ b/desktop-widgets/divelogimportdialog.cpp
@@ -527,6 +527,12 @@ void DiveLogImportDialog::loadFileContents(int value, 
whatChanged triggeredBy)
                                        } else if (date.contains('/')) {
                                                
ui->DateFormat->setCurrentText("mm/dd/yyyy");
                                        }
+                               } else if (foundHeading == 
QString::fromLatin1("Time") && columns.count() >= count) {
+                                       QString time = columns.at(count);
+                                       if (time.contains(':')) {
+                                               
ui->DurationFormat->setCurrentText("Minutes:seconds");
+
+                                       }
                                }
                        } else {
                                headers.append("");
-- 
2.5.0

_______________________________________________
subsurface mailing list
[email protected]
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface

Reply via email to