Skip to content

Commit 57db2d9

Browse files
committed
Display the local time not utc time
Copying to clipboard will still display utc time (raw data) Fixes: #9006
1 parent 58178ae commit 57db2d9

File tree

4 files changed

+10
-2
lines changed

4 files changed

+10
-2
lines changed

changelog/unreleased/9006

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Bugfix: Tables now display local time
2+
3+
We fixed a bug where the sync tables where displaying utc time for some items.
4+
5+
https://github.com/owncloud/client/issues/9006

src/gui/models/protocolitemmodel.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ QVariant ProtocolItemModel::data(const QModelIndex &index, int role) const
5858
case Qt::DisplayRole:
5959
switch (column) {
6060
case ProtocolItemRole::Time:
61-
return item.timestamp();
61+
return item.timestamp().toLocalTime();
6262
case ProtocolItemRole::Folder:
6363
return item.folder()->shortGuiLocalPath();
6464
case ProtocolItemRole::Action:

src/gui/protocolitem.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ ProtocolItem::ProtocolItem(Folder *folder, const SyncFileItemPtr &item)
3737
if (!item->_responseTimeStamp.isEmpty()) {
3838
_timestamp = QDateTime::fromString(QString::fromUtf8(item->_responseTimeStamp), Qt::RFC2822Date);
3939
} else {
40-
_timestamp = QDateTime::currentDateTime();
40+
_timestamp = QDateTime::currentDateTimeUtc();
4141
}
4242
if (_message.isEmpty()) {
4343
_message = Progress::asResultString(*item);

src/gui/protocolitem.h

+3
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ class ProtocolItem
3434

3535
Folder *folder() const;
3636

37+
/**
38+
* UTC Time
39+
*/
3740
QDateTime timestamp() const;
3841

3942
qint64 size() const;

0 commit comments

Comments
 (0)