Fixed deprecated method Qt::SystemLocaleLongDate (#2784)

Fixes deprecation notices introduced in #2748

Reference: https://doc.qt.io/qt-5/qt.html#DateFormat-enum
Replacement: https://doc.qt.io/qt-5/qlocale.html#FormatType-enum
This commit is contained in:
Paweł 2021-05-16 00:34:42 +02:00 committed by GitHub
parent 519855d852
commit 6732b25f36
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View file

@ -754,7 +754,7 @@ void TwitchChannel::loadRecentMessages()
{
shared.get()->lastDate_ = msgDate;
auto msg = makeSystemMessage(
msgDate.toString(Qt::SystemLocaleLongDate),
QLocale().toString(msgDate, QLocale::LongFormat),
QTime(0, 0));
msg->flags.set(MessageFlag::RecentMessage);
allBuiltMessages.emplace_back(msg);

View file

@ -607,10 +607,10 @@ void ChannelView::setChannel(ChannelPtr underlyingChannel)
if (this->channel_->lastDate_ != QDate::currentDate())
{
this->channel_->lastDate_ = QDate::currentDate();
auto msg =
makeSystemMessage(QDate::currentDate().toString(
Qt::SystemLocaleLongDate),
QTime(0, 0));
auto msg = makeSystemMessage(
QLocale().toString(QDate::currentDate(),
QLocale::LongFormat),
QTime(0, 0));
this->channel_->addMessage(msg);
}
// When the message was received in the underlyingChannel,