Convert two QDateTime::toString() usages to QLocale::toString()

Qt::LocalDate has been deprecated for ages as an alias for
Qt::SystemLocaleDate, which we intend to remove at Qt 6; and all use
of them can (and should) be converted to use QLocale::toString().
So do that.

Task-number: QTBUG-80441
Change-Id: I0a40fa287cb347c704ec3673d17ef18381063f7f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Edward Welbourne 2020-01-23 13:41:44 +01:00
parent ee41a5941b
commit 6bac3552ac
2 changed files with 2 additions and 2 deletions

View File

@ -797,7 +797,7 @@ QString QFileSystemModelPrivate::time(const QModelIndex &index) const
if (!index.isValid())
return QString();
#if QT_CONFIG(datestring)
return node(index)->lastModified().toString(Qt::SystemLocaleDate);
return QLocale::system().toString(node(index)->lastModified(), QLocale::ShortFormat);
#else
Q_UNUSED(index);
return QString();

View File

@ -1319,7 +1319,7 @@ QString QDirModelPrivate::type(const QModelIndex &index) const
QString QDirModelPrivate::time(const QModelIndex &index) const
{
#if QT_CONFIG(datestring)
return node(index)->info.lastModified().toString(Qt::LocalDate);
return QLocale::system().toString(node(index)->info.lastModified(), QLocale::ShortFormat);
#else
Q_UNUSED(index);
return QString();