refactor: Replace deprecated Qt::SystemLocale{Short,Long}Date

This commit is contained in:
Hennadii Stepanov 2020-11-26 18:58:47 +02:00
parent 50091592dd
commit 86b1ab64b1
No known key found for this signature in database
GPG Key ID: 410108112E7EA81F
2 changed files with 4 additions and 2 deletions

View File

@ -11,6 +11,7 @@
#include <QDateTime>
#include <QList>
#include <QLocale>
#include <QModelIndex>
#include <QVariant>
@ -122,7 +123,7 @@ QVariant BanTableModel::data(const QModelIndex &index, int role) const
case Bantime:
QDateTime date = QDateTime::fromMSecsSinceEpoch(0);
date = date.addSecs(rec->banEntry.nBanUntil);
return date.toString(Qt::SystemLocaleLongDate);
return QLocale::system().toString(date, QLocale::LongFormat);
}
}

View File

@ -43,6 +43,7 @@
#include <QKeyEvent>
#include <QLineEdit>
#include <QList>
#include <QLocale>
#include <QMenu>
#include <QMouseEvent>
#include <QProgressDialog>
@ -67,7 +68,7 @@ namespace GUIUtil {
QString dateTimeStr(const QDateTime &date)
{
return date.date().toString(Qt::SystemLocaleShortDate) + QString(" ") + date.toString("hh:mm");
return QLocale::system().toString(date.date(), QLocale::ShortFormat) + QString(" ") + date.toString("hh:mm");
}
QString dateTimeStr(qint64 nTime)