mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-31 04:38:04 -06:00
Migrate away from deprecated Qt functions
`QString QDateTime::toString(Qt::DateFormat format = Qt::TextDate)` will be removed in Qt6.
This commit is contained in:
@@ -155,7 +155,7 @@ LogMessageModel::LogMessageModel(QObject *parent)
|
||||
|
||||
void LogMessageModel::handleNewMessage(const Log::Msg &message)
|
||||
{
|
||||
const QString time = QDateTime::fromMSecsSinceEpoch(message.timestamp).toString(Qt::SystemLocaleShortDate);
|
||||
const QString time = QLocale::system().toString(QDateTime::fromMSecsSinceEpoch(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 = QDateTime::fromMSecsSinceEpoch(peer.timestamp).toString(Qt::SystemLocaleShortDate);
|
||||
const QString time = QLocale::system().toString(QDateTime::fromMSecsSinceEpoch(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);
|
||||
|
||||
Reference in New Issue
Block a user