aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2020-11-26 18:58:47 +0200
committerHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2020-11-27 10:04:13 +0200
commit86b1ab64b1a5b56518787ef16ea54ddbbc97d83e (patch)
tree195e19542faa44e86ac3905d2cb46565533ba25e
parent50091592dd875a1c94030dbed74112b003732d68 (diff)
refactor: Replace deprecated Qt::SystemLocale{Short,Long}Date
-rw-r--r--src/qt/bantablemodel.cpp3
-rw-r--r--src/qt/guiutil.cpp3
2 files changed, 4 insertions, 2 deletions
diff --git a/src/qt/bantablemodel.cpp b/src/qt/bantablemodel.cpp
index 2739b21a9d..2676de96d7 100644
--- a/src/qt/bantablemodel.cpp
+++ b/src/qt/bantablemodel.cpp
@@ -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);
}
}
diff --git a/src/qt/guiutil.cpp b/src/qt/guiutil.cpp
index 70e76f765b..53ffb27f50 100644
--- a/src/qt/guiutil.cpp
+++ b/src/qt/guiutil.cpp
@@ -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)