Use QDateTime::fromSecsSinceEpoch in Qt 6 instead of QDateTime::fromTime_t

This commit is contained in:
thunder2 2025-07-18 18:58:45 +02:00 committed by Thunder
parent a00c1375e5
commit 42b3b95fd8
19 changed files with 62 additions and 41 deletions

View file

@ -26,6 +26,7 @@
#include "gui/RetroShareLink.h"
#include "gui/chat/ChatDialog.h"
#include "util/misc.h"
#include "util/DateTime.h"
#include "retroshare/rsconfig.h"
#include "retroshare/rshistory.h"
@ -494,7 +495,7 @@ ChatPage::load()
QString tt ;
tt += tr("Name :")+" " + QString::fromUtf8(detail.name.c_str()) ;
tt += "\n" + tr("PGP id :")+" " + QString::fromStdString(invites[i].destination_pgp_id.toStdString()) ;
tt += "\n" + tr("Valid until :")+" " + QDateTime::fromTime_t(invites[i].time_of_validity).toString() ;
tt += "\n" + tr("Valid until :")+" " + DateTime::DateTimeFromTime_t(invites[i].time_of_validity).toString() ;
item->setData(Qt::UserRole,QString::fromStdString(invites[i].pid.toStdString())) ;
item->setToolTip(tt) ;
@ -538,7 +539,7 @@ void ChatPage::setPreviewMessages(QString &stylePath, QString styleVariant, QTex
QString nameIncoming = tr("Incoming");
QString nameOutgoing = tr("Outgoing");
QDateTime timestmp = QDateTime::fromTime_t(time(NULL));
QDateTime timestmp = DateTime::DateTimeFromTime_t(time(NULL));
QColor backgroundColor = textBrowser->palette().base().color();
textBrowser->append(style.formatMessage(ChatStyle::FORMATMSG_HINCOMING, nameIncoming, timestmp, tr("Incoming message in history"), 0, backgroundColor));