From 7c2c6eac147982150dad191ed1d9b5b58c6558d7 Mon Sep 17 00:00:00 2001 From: Max-Wilhelm Bruker Date: Tue, 3 Jan 2012 01:13:15 +0100 Subject: [PATCH] changed creation_time to time_t to get around Qt4.7 dependency --- cockatrice/src/remotedecklist_treewidget.cpp | 2 +- common/pb/proto/serverinfo_deckstorage.proto | 2 +- servatrice/src/serversocketinterface.cpp | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cockatrice/src/remotedecklist_treewidget.cpp b/cockatrice/src/remotedecklist_treewidget.cpp index eeb3ee31d..ee3b15bee 100644 --- a/cockatrice/src/remotedecklist_treewidget.cpp +++ b/cockatrice/src/remotedecklist_treewidget.cpp @@ -207,7 +207,7 @@ void RemoteDeckList_TreeModel::addFileToTree(const ServerInfo_DeckStorage_TreeIt { const ServerInfo_DeckStorage_File &fileInfo = file.file(); QDateTime time; - time.setMSecsSinceEpoch(fileInfo.creation_time()); + time.setTime_t(fileInfo.creation_time()); beginInsertRows(nodeToIndex(parent), parent->size(), parent->size()); parent->append(new FileNode(QString::fromStdString(file.name()), file.id(), time, parent)); diff --git a/common/pb/proto/serverinfo_deckstorage.proto b/common/pb/proto/serverinfo_deckstorage.proto index a8c9f2b68..531a613d8 100644 --- a/common/pb/proto/serverinfo_deckstorage.proto +++ b/common/pb/proto/serverinfo_deckstorage.proto @@ -1,5 +1,5 @@ message ServerInfo_DeckStorage_File { - optional uint64 creation_time = 1; + optional uint32 creation_time = 1; } message ServerInfo_DeckStorage_Folder { diff --git a/servatrice/src/serversocketinterface.cpp b/servatrice/src/serversocketinterface.cpp index 0e9309c63..67e6fddc1 100644 --- a/servatrice/src/serversocketinterface.cpp +++ b/servatrice/src/serversocketinterface.cpp @@ -296,7 +296,7 @@ bool ServerSocketInterface::deckListHelper(int folderId, ServerInfo_DeckStorage_ newItem->set_name(query.value(1).toString().toStdString()); ServerInfo_DeckStorage_File *newFile = newItem->mutable_file(); - newFile->set_creation_time(query.value(2).toDateTime().toMSecsSinceEpoch()); + newFile->set_creation_time(query.value(2).toDateTime().toTime_t()); } return true; @@ -437,7 +437,7 @@ Response::ResponseCode ServerSocketInterface::cmdDeckUpload(const Command_DeckUp ServerInfo_DeckStorage_TreeItem *fileInfo = re->mutable_new_file(); fileInfo->set_id(query.lastInsertId().toInt()); fileInfo->set_name(deckName.toStdString()); - fileInfo->mutable_file()->set_creation_time(QDateTime::currentMSecsSinceEpoch()); + fileInfo->mutable_file()->set_creation_time(QDateTime::currentDateTime().toTime_t()); rc.setResponseExtension(re); return Response::RespOk;