Rename literal operator

Qt 6.4 introduced `QString operator""_s()` and the previous `""_qs` is
deprecated since Qt 6.8.
This commit is contained in:
Chocobo1
2023-06-18 02:02:02 +08:00
parent f6b58f36e2
commit e6d85a468b
141 changed files with 3610 additions and 3604 deletions

View File

@@ -43,14 +43,14 @@
AboutDialog::AboutDialog(QWidget *parent)
: QDialog(parent)
, m_ui(new Ui::AboutDialog)
, m_storeDialogSize(SETTINGS_KEY(u"Size"_qs))
, m_storeDialogSize(SETTINGS_KEY(u"Size"_s))
{
m_ui->setupUi(this);
// Title
m_ui->labelName->setText(QStringLiteral("<b><h2>qBittorrent " QBT_VERSION " (%1-bit)</h2></b>").arg(QT_POINTER_SIZE * 8));
m_ui->logo->setPixmap(UIThemeManager::instance()->getScaledPixmap(u"qbittorrent-tray"_qs, 32));
m_ui->logo->setPixmap(UIThemeManager::instance()->getScaledPixmap(u"qbittorrent-tray"_s, 32));
// About
const QString aboutText =
@@ -62,33 +62,33 @@ AboutDialog::AboutDialog(QWidget *parent)
u"<tr><td>%4</td><td><a href=\"https://forum.qbittorrent.org\">https://forum.qbittorrent.org</a></td></tr>"
u"<tr><td>%5</td><td><a href=\"https://bugs.qbittorrent.org\">https://bugs.qbittorrent.org</a></td></tr>"
u"</table>"
u"</p>"_qs
u"</p>"_s
.arg(tr("An advanced BitTorrent client programmed in C++, based on Qt toolkit and libtorrent-rasterbar.")
.replace(u"C++"_qs, u"C\u2060+\u2060+"_qs) // make C++ non-breaking
.replace(u"C++"_s, u"C\u2060+\u2060+"_s) // make C++ non-breaking
, tr("Copyright %1 2006-2022 The qBittorrent project").arg(C_COPYRIGHT)
, tr("Home Page:")
, tr("Forum:")
, tr("Bug Tracker:"));
m_ui->labelAbout->setText(aboutText);
m_ui->labelMascot->setPixmap(Utils::Gui::scaledPixmap(Path(u":/icons/mascot.png"_qs), this));
m_ui->labelMascot->setPixmap(Utils::Gui::scaledPixmap(Path(u":/icons/mascot.png"_s), this));
// Thanks
if (const auto readResult = Utils::IO::readFile(Path(u":/thanks.html"_qs), -1, QIODevice::Text)
if (const auto readResult = Utils::IO::readFile(Path(u":/thanks.html"_s), -1, QIODevice::Text)
; readResult)
{
m_ui->textBrowserThanks->setHtml(QString::fromUtf8(readResult.value()));
}
// Translation
if (const auto readResult = Utils::IO::readFile(Path(u":/translators.html"_qs), -1, QIODevice::Text)
if (const auto readResult = Utils::IO::readFile(Path(u":/translators.html"_s), -1, QIODevice::Text)
; readResult)
{
m_ui->textBrowserTranslation->setHtml(QString::fromUtf8(readResult.value()));
}
// License
if (const auto readResult = Utils::IO::readFile(Path(u":/gpl.html"_qs), -1, QIODevice::Text)
if (const auto readResult = Utils::IO::readFile(Path(u":/gpl.html"_s), -1, QIODevice::Text)
; readResult)
{
m_ui->textBrowserLicense->setHtml(QString::fromUtf8(readResult.value()));
@@ -103,7 +103,7 @@ AboutDialog::AboutDialog(QWidget *parent)
const QString DBIPText = u"<html><head/><body><p>"
u"%1 (<a href=\"https://db-ip.com/\">https://db-ip.com/</a>)"
u"</p></body></html>"_qs
u"</p></body></html>"_s
.arg(tr("The free IP to Country Lite database by DB-IP is used for resolving the countries of peers. "
"The database is licensed under the Creative Commons Attribution 4.0 International License"));
m_ui->labelDBIP->setText(DBIPText);