Remove tabs in Viatom loader and normalize whitespace to OSCAR convensions.

Also change from using sprintf/QDateTime::fromString to using Qt native objects.
No change in output.
This commit is contained in:
sawinglogz 2020-01-23 19:25:06 -05:00
parent 9cb7de950b
commit ae8ce0e9d6
2 changed files with 90 additions and 92 deletions

View File

@ -1,6 +1,7 @@
/* SleepLib Viatom Loader Implementation
*
* Copyright (c) 2019 The OSCAR Team (written by dave madden <dhm@mersenne.com>)
* Copyright (c) 2019-2020 The OSCAR Team
* (Initial importer written by dave madden <dhm@mersenne.com>)
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file COPYING in the main directory of the source code
@ -81,10 +82,7 @@ Session* ViatomLoader::ParseFile(const QString & filename)
return nullptr;
}
char dchr[32];
sprintf( dchr, "%02u/%02u/%04u %02u:%02u:%02u", m, d, Y, H, M, S );
QDateTime data_timestamp = QDateTime::fromString( QString( dchr ), "MM/dd/yyyy HH:mm:ss" );
QDateTime data_timestamp = QDateTime(QDate(Y, m, d), QTime(H, M, S));
quint64 time_s = data_timestamp.toTime_t();
quint64 time_ms = time_s * 1000L;
SessionID sid = time_s;