Use coarse timestamp format

Since format in milliseconds doesn't add additional value and is
slower than just seconds.
This commit is contained in:
Chocobo1
2022-06-18 00:18:33 +08:00
parent 61adfea196
commit af78344e5d
4 changed files with 7 additions and 7 deletions

View File

@@ -155,7 +155,7 @@ LogMessageModel::LogMessageModel(QObject *parent)
void LogMessageModel::handleNewMessage(const Log::Msg &message)
{
const QString time = QLocale::system().toString(QDateTime::fromMSecsSinceEpoch(message.timestamp), QLocale::ShortFormat);
const QString time = QLocale::system().toString(QDateTime::fromSecsSinceEpoch(message.timestamp), QLocale::ShortFormat);
const QString messageText = message.message;
const QColor foreground = m_foregroundForMessageTypes[message.type];
@@ -173,7 +173,7 @@ LogPeerModel::LogPeerModel(QObject *parent)
void LogPeerModel::handleNewMessage(const Log::Peer &peer)
{
const QString time = QLocale::system().toString(QDateTime::fromMSecsSinceEpoch(peer.timestamp), QLocale::ShortFormat);
const QString time = QLocale::system().toString(QDateTime::fromSecsSinceEpoch(peer.timestamp), QLocale::ShortFormat);
const QString message = peer.blocked
? tr("%1 was blocked. Reason: %2.", "0.0.0.0 was blocked. Reason: reason for blocking.").arg(peer.ip, peer.reason)
: tr("%1 was banned", "0.0.0.0 was banned").arg(peer.ip);