Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

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,
msg->message = QString::fromStdString(file->desc());
msg->mediaSize = file->size();
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);
msg->type = getMessageType(mimeType);
for (gloox::Hash &hash : file->hashes())
......
......@@ -126,7 +126,7 @@ void UploadHandler::handleUploadFinished(int id, std::string &name,
QFileInfo fInfo(mediaShares[id].filePath);
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()
.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