Replaced some more QDateTime::setTime_t by DateTime::DateTimeFromTime_t

This commit is contained in:
thunder2 2025-07-20 18:55:04 +02:00
parent a6cf10fd1a
commit 0d37db307c
9 changed files with 19 additions and 28 deletions

View file

@ -37,6 +37,7 @@
#include "PhotoView.h"
#include "gui/Posted/PostedDialog.h"
#include "ui_PostedItem.h"
#include "util/DateTime.h"
#include <retroshare/rsposted.h>
@ -498,8 +499,7 @@ void PostedItem::fill()
ui->thumbnailLabel->setPicture( FilesDefs::getPixmapFromQtResourcePath(":/images/thumb-default.png"));
ui->fromLabel->setId(mPost.mMeta.mAuthorId);
ui->titleLabel->setText(tr( "<p><font color=\"#ff0000\"><b>The author of this message (with ID %1) is banned.</b>").arg(QString::fromStdString(mPost.mMeta.mAuthorId.toStdString()))) ;
QDateTime qtime;
qtime.setTime_t(mPost.mMeta.mPublishTs);
QDateTime qtime = DateTime::DateTimeFromTime_t(mPost.mMeta.mPublishTs);
QString timestamp = qtime.toString("hh:mm dd-MMM-yyyy");
ui->dateLabel->setText(timestamp);
} else {
@ -514,8 +514,7 @@ void PostedItem::fill()
ui->thumbnailLabel->setFixedSize(desired_width,desired_height);
QDateTime qtime;
qtime.setTime_t(mPost.mMeta.mPublishTs);
QDateTime qtime = DateTime::DateTimeFromTime_t(mPost.mMeta.mPublishTs);
QString timestamp = qtime.toString("hh:mm dd-MMM-yyyy");
QString timestamp2 = misc::timeRelativeToNow(mPost.mMeta.mPublishTs);
ui->dateLabel->setText(timestamp2);