Fix date in ActivityWidget and remove unnecessary string conversion
authorMichael Schuster <michael@schuster.ms>
Tue, 24 Dec 2019 07:26:16 +0000 (08:26 +0100)
committerMichael Schuster <48932272+misch7@users.noreply.github.com>
Tue, 24 Dec 2019 07:53:14 +0000 (08:53 +0100)
The local date and time value was converted into a string, just to be converted
into another string, to be converted to a value once again, returning zero as
the result. This caused the widget to always display "now".

Looks like this was a simply copy and paste mistake from this line in
ActivityListModel::slotActivitiesReceived:

a._dateTime = QDateTime::fromString(json.value("date").toString(), Qt::ISODate);

Signed-off-by: Michael Schuster <michael@schuster.ms>
src/gui/activitywidget.cpp

index f5dbe7d498174631d4e26a12fa79eec30ef1c21b..469b0d14ea3d461837293b512755fa48d354fcfc 100644 (file)
@@ -179,7 +179,7 @@ void ActivityWidget::slotItemCompleted(const QString &folder, const SyncFileItem
         Activity activity;
         activity._type = Activity::SyncFileItemType; //client activity
         activity._status = item->_status;
-        activity._dateTime = QDateTime::fromString(QDateTime::currentDateTime().toString(), Qt::ISODate);
+        activity._dateTime = QDateTime::currentDateTime();
         activity._message = item->_originalFile;
         activity._link = folderInstance->accountState()->account()->url();
         activity._accName = folderInstance->accountState()->account()->displayName();