Update viatom_loader.cpp - Remove filename extension

This commit is contained in:
Steve Gearhart 2024-01-20 20:25:35 +00:00
parent 3954d9ac3a
commit 78f5e3fc90

View File

@ -314,6 +314,10 @@ bool ViatomFile::ParseHeader()
QDateTime data_timestamp = QDateTime(QDate(year, month, day), QTime(hour, min, sec)); QDateTime data_timestamp = QDateTime(QDate(year, month, day), QTime(hour, min, sec));
QString date_string = QFileInfo(m_file).fileName().section("_", -1); // Strip any SleepU_ etc. prefix. QString date_string = QFileInfo(m_file).fileName().section("_", -1); // Strip any SleepU_ etc. prefix.
int lastPoint = date_string.lastIndexOf("."); // Added to strip off any filename extension
date_string = date_string.left(lastPoint);
QString format_string = "yyyyMMddHHmmss"; QString format_string = "yyyyMMddHHmmss";
if (date_string.contains(":")) { if (date_string.contains(":")) {
format_string = "yyyy-MM-dd HH:mm:ss"; format_string = "yyyy-MM-dd HH:mm:ss";