Skip to content

Commit

Permalink
FIX(client): Replace deprecated Qt::SystemLocaleDate and Qt::DefaultL…
Browse files Browse the repository at this point in the history
…ocaleShortDate
  • Loading branch information
davidebeatrici committed Oct 1, 2023
1 parent 9681ab3 commit 9672bf6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions src/mumble/Cert.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,13 @@ void CertView::setCert(const QList< QSslCertificate > &cert) {
else
qlSubjectEmail->setText(tr("(none)"));

const auto expiryDateStr = QLocale::system().toString(qscCert.expiryDate(), QLocale::ShortFormat);

if (qscCert.expiryDate() <= QDateTime::currentDateTime())
qlExpiry->setText(QString::fromLatin1("<font color=\"red\"><b>%1</b></font>")
.arg(qscCert.expiryDate().toString(Qt::SystemLocaleDate).toHtmlEscaped()));
qlExpiry->setText(
QString::fromLatin1("<font color=\"red\"><b>%1</b></font>").arg(expiryDateStr.toHtmlEscaped()));
else
qlExpiry->setText(qscCert.expiryDate().toString(Qt::SystemLocaleDate));
qlExpiry->setText(expiryDateStr);

if (qlCert.count() > 1)
qscCert = qlCert.last();
Expand Down
2 changes: 1 addition & 1 deletion src/mumble/Log.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -732,7 +732,7 @@ void Log::log(MsgType mt, const QString &console, const QString &terse, bool own
qdDate = dt.date();
tc.insertBlock();
tc.insertHtml(
tr("[Date changed to %1]\n").arg(qdDate.toString(Qt::DefaultLocaleShortDate).toHtmlEscaped()));
tr("[Date changed to %1]\n").arg(QLocale().toString(qdDate, QLocale::ShortFormat).toHtmlEscaped()));
tc.movePosition(QTextCursor::End);
}

Expand Down

0 comments on commit 9672bf6

Please sign in to comment.