Migrate away from deprecated Qt functions

`QString QDateTime::toString(Qt::DateFormat format = Qt::TextDate)` will
be removed in Qt6.
This commit is contained in:
Chocobo1 2021-01-06 12:47:18 +08:00
parent 89559eae2b
commit cede5ac9d2
No known key found for this signature in database
GPG key ID: 210D9C873253A68C
5 changed files with 11 additions and 11 deletions

View file

@ -361,9 +361,9 @@ QString TransferListModel::displayValue(const BitTorrent::TorrentHandle *torrent
case TR_TAGS:
return tagsString(torrent->tags());
case TR_ADD_DATE:
return torrent->addedTime().toLocalTime().toString(Qt::DefaultLocaleShortDate);
return QLocale().toString(torrent->addedTime().toLocalTime(), QLocale::ShortFormat);
case TR_SEED_DATE:
return torrent->completedTime().toLocalTime().toString(Qt::DefaultLocaleShortDate);
return QLocale().toString(torrent->completedTime().toLocalTime(), QLocale::ShortFormat);
case TR_TRACKER:
return torrent->currentTracker();
case TR_DLLIMIT:
@ -387,7 +387,7 @@ QString TransferListModel::displayValue(const BitTorrent::TorrentHandle *torrent
case TR_COMPLETED:
return unitString(torrent->completedSize());
case TR_SEEN_COMPLETE_DATE:
return torrent->lastSeenComplete().toLocalTime().toString(Qt::DefaultLocaleShortDate);
return QLocale().toString(torrent->lastSeenComplete().toLocalTime(), QLocale::ShortFormat);
case TR_LAST_ACTIVITY:
return lastActivityString((torrent->isPaused() || torrent->isChecking()) ? -1 : torrent->timeSinceActivity());
case TR_AVAILABILITY: