fix(gui): replace QDateTime::setTime_t with setSecsSinceEpoch for Qt6

QDateTime::setTime_t() was deprecated in Qt 5.8 and removed in Qt6.
setSecsSinceEpoch() exists since Qt 5.8 so the GUI keeps building
against both Qt5 and Qt6.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
jolavillette 2026-06-20 18:14:53 +02:00
parent 5374a746e2
commit 0c0ad41f77
2 changed files with 3 additions and 3 deletions

View File

@ -179,7 +179,7 @@ void GxsCommentDialog::setCommentHeader(QWidget *header)
ui->postFrame->setVisible(true);
QDateTime qtime;
qtime.setTime_t(mCurrentPost.mMeta.mPublishTs);
qtime.setSecsSinceEpoch(mCurrentPost.mMeta.mPublishTs);
QString timestamp = DateTime::formatDateTime(qtime);
ui->dateLabel->setText(timestamp);
ui->fromLabel->setText(QString::fromUtf8(mCurrentPost.mMeta.mAuthorId.c_str()));

View File

@ -994,7 +994,7 @@ static void recursPrintModel(const std::vector<ForumModelPostEntry>& entries,For
const ForumModelPostEntry& e(entries[index]);
QDateTime qtime;
qtime.setTime_t(e.mPublishTs);
qtime.setSecsSinceEpoch(e.mPublishTs);
std::cerr << std::string(depth*2,' ') << index << " : " << e.mAuthorId.toStdString() << " "
<< QString("%1").arg((uint32_t)e.mPostFlags,8,16,QChar('0')).toStdString() << " "
@ -1024,7 +1024,7 @@ void RsGxsForumModel::debug_dump()
std::cerr << " " << e.mChildren[j] ;
QDateTime qtime;
qtime.setTime_t(e.mPublishTs);
qtime.setSecsSinceEpoch(e.mPublishTs);
std::cerr << " (" << e.mParent << ")";
std::cerr << " " << qtime.toString().toStdString() << " \"" << e.mTitle << "\"" << std::endl;