Verified Commit 701e9b9e authored by Linus Jahn's avatar Linus Jahn

Use QDateTime::toMSecsSinceEpoch() instead of deprecated toTime_t()

parent 50e1d64a
...@@ -202,7 +202,7 @@ void MessageHandler::handleMediaSharing(const gloox::Message *message, ...@@ -202,7 +202,7 @@ void MessageHandler::handleMediaSharing(const gloox::Message *message,
msg->message = QString::fromStdString(file->desc()); msg->message = QString::fromStdString(file->desc());
msg->mediaSize = file->size(); msg->mediaSize = file->size();
msg->mediaContentType = QString::fromStdString(file->mediaType()); msg->mediaContentType = QString::fromStdString(file->mediaType());
msg->mediaLastModified = stringToQDateTime(file->date()).toTime_t(); msg->mediaLastModified = stringToQDateTime(file->date()).toMSecsSinceEpoch();
QMimeType mimeType = QMimeDatabase().mimeTypeForName(msg->mediaContentType); QMimeType mimeType = QMimeDatabase().mimeTypeForName(msg->mediaContentType);
msg->type = getMessageType(mimeType); msg->type = getMessageType(mimeType);
for (gloox::Hash &hash : file->hashes()) for (gloox::Hash &hash : file->hashes())
......
...@@ -126,7 +126,7 @@ void UploadHandler::handleUploadFinished(int id, std::string &name, ...@@ -126,7 +126,7 @@ void UploadHandler::handleUploadFinished(int id, std::string &name,
QFileInfo fInfo(mediaShares[id].filePath); QFileInfo fInfo(mediaShares[id].filePath);
QDateTime modifyTime = fInfo.lastModified(); QDateTime modifyTime = fInfo.lastModified();
msg.mediaLastModified = modifyTime.isValid() ? modifyTime.toTime_t() : -1; msg.mediaLastModified = modifyTime.isValid() ? modifyTime.toMSecsSinceEpoch() : -1;
std::string modifyTimeStr = modifyTime.isValid() ? modifyTime.toUTC() std::string modifyTimeStr = modifyTime.isValid() ? modifyTime.toUTC()
.toString(Qt::ISODate).toStdString() : ""; .toString(Qt::ISODate).toStdString() : "";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment