mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-01-12 18:24:58 +08:00
Remove superfluous QString::fromUtf8()
This commit is contained in:
parent
4927d26877
commit
27090f0cfb
@ -600,15 +600,15 @@ void Application::initializeTranslation()
|
||||
// Load translation
|
||||
QString localeStr = pref->getLocale();
|
||||
|
||||
if (m_qtTranslator.load(QString::fromUtf8("qtbase_") + localeStr, QLibraryInfo::location(QLibraryInfo::TranslationsPath)) ||
|
||||
m_qtTranslator.load(QString::fromUtf8("qt_") + localeStr, QLibraryInfo::location(QLibraryInfo::TranslationsPath)))
|
||||
if (m_qtTranslator.load(QLatin1String("qtbase_") + localeStr, QLibraryInfo::location(QLibraryInfo::TranslationsPath)) ||
|
||||
m_qtTranslator.load(QLatin1String("qt_") + localeStr, QLibraryInfo::location(QLibraryInfo::TranslationsPath)))
|
||||
qDebug("Qt %s locale recognized, using translation.", qUtf8Printable(localeStr));
|
||||
else
|
||||
qDebug("Qt %s locale unrecognized, using default (en).", qUtf8Printable(localeStr));
|
||||
|
||||
installTranslator(&m_qtTranslator);
|
||||
|
||||
if (m_translator.load(QString::fromUtf8(":/lang/qbittorrent_") + localeStr))
|
||||
if (m_translator.load(QLatin1String(":/lang/qbittorrent_") + localeStr))
|
||||
qDebug("%s locale recognized, using translation.", qUtf8Printable(localeStr));
|
||||
else
|
||||
qDebug("%s locale unrecognized, using default (en).", qUtf8Printable(localeStr));
|
||||
|
@ -60,7 +60,7 @@ class downloadFromURL : public QDialog, private Ui::downloadFromURL
|
||||
|
||||
// Paste clipboard if there is an URL in it
|
||||
QString clip_txt = qApp->clipboard()->text();
|
||||
QStringList clip_txt_list = clip_txt.split(QString::fromUtf8("\n"));
|
||||
QStringList clip_txt_list = clip_txt.split(QLatin1Char('\n'));
|
||||
clip_txt.clear();
|
||||
QStringList clip_txt_list_cleaned;
|
||||
foreach (clip_txt, clip_txt_list) {
|
||||
@ -94,7 +94,7 @@ class downloadFromURL : public QDialog, private Ui::downloadFromURL
|
||||
void downloadButtonClicked()
|
||||
{
|
||||
QString urls = textUrls->toPlainText();
|
||||
QStringList url_list = urls.split(QString::fromUtf8("\n"));
|
||||
QStringList url_list = urls.split(QLatin1Char('\n'));
|
||||
QString url;
|
||||
QStringList url_list_cleaned;
|
||||
foreach (url, url_list) {
|
||||
|
@ -259,7 +259,7 @@ OptionsDialog::OptionsDialog(QWidget *parent)
|
||||
connect(m_ui->autoRunBox, &QGroupBox::toggled, this, &ThisType::enableApplyButton);
|
||||
connect(m_ui->autoRun_txt, &FileSystemPathEdit::selectedPathChanged, this, &ThisType::enableApplyButton);
|
||||
|
||||
const QString autoRunStr = QString::fromUtf8("%1\n %2\n %3\n %4\n %5\n %6\n %7\n %8\n %9\n %10\n%11")
|
||||
const QString autoRunStr = QString("%1\n %2\n %3\n %4\n %5\n %6\n %7\n %8\n %9\n %10\n%11")
|
||||
.arg(tr("Supported parameters (case sensitive):"))
|
||||
.arg(tr("%N: Torrent name"))
|
||||
.arg(tr("%L: Category"))
|
||||
@ -489,7 +489,7 @@ void OptionsDialog::saveOptions()
|
||||
QString locale = getLocale();
|
||||
if (pref->getLocale() != locale) {
|
||||
QTranslator *translator = new QTranslator;
|
||||
if (translator->load(QString::fromUtf8(":/lang/qbittorrent_") + locale))
|
||||
if (translator->load(QLatin1String(":/lang/qbittorrent_") + locale))
|
||||
qDebug("%s locale recognized, using translation.", qUtf8Printable(locale));
|
||||
else
|
||||
qDebug("%s locale unrecognized, using default (en).", qUtf8Printable(locale));
|
||||
|
@ -799,7 +799,7 @@ void PropertiesWidget::askWebSeed()
|
||||
// Ask user for a new url seed
|
||||
const QString url_seed = AutoExpandableDialog::getText(this, tr("New URL seed", "New HTTP source"),
|
||||
tr("New URL seed:"), QLineEdit::Normal,
|
||||
QString::fromUtf8("http://www."), &ok);
|
||||
QLatin1String("http://www."), &ok);
|
||||
if (!ok) return;
|
||||
qDebug("Adding %s web seed", qUtf8Printable(url_seed));
|
||||
if (!m_ui->listWebSeeds->findItems(url_seed, Qt::MatchFixedString).empty()) {
|
||||
|
@ -74,7 +74,7 @@ void SpeedLimitDialog::updateSpinValue(int val) const
|
||||
if (val <= 0) {
|
||||
m_ui->spinBandwidth->setValue(0);
|
||||
m_ui->spinBandwidth->setSpecialValueText(QString::fromUtf8(C_INFINITY));
|
||||
m_ui->spinBandwidth->setSuffix(QString::fromUtf8(""));
|
||||
m_ui->spinBandwidth->setSuffix("");
|
||||
}
|
||||
else {
|
||||
m_ui->spinBandwidth->setValue(val);
|
||||
@ -87,7 +87,7 @@ void SpeedLimitDialog::updateSliderValue(int val) const
|
||||
if (val <= 0) {
|
||||
m_ui->spinBandwidth->setValue(0);
|
||||
m_ui->spinBandwidth->setSpecialValueText(QString::fromUtf8(C_INFINITY));
|
||||
m_ui->spinBandwidth->setSuffix(QString::fromUtf8(""));
|
||||
m_ui->spinBandwidth->setSuffix("");
|
||||
}
|
||||
if (val > m_ui->bandwidthSlider->maximum())
|
||||
m_ui->bandwidthSlider->setMaximum(val);
|
||||
|
@ -43,7 +43,7 @@ trackerLogin::trackerLogin(QWidget *parent, BitTorrent::TorrentHandle *const tor
|
||||
|
||||
buttonBox->button(QDialogButtonBox::Ok)->setText(tr("Log in"));
|
||||
|
||||
login_logo->setPixmap(QPixmap(QString::fromUtf8(":/icons/qbt-theme/encrypted.png")));
|
||||
login_logo->setPixmap(QPixmap(QLatin1String(":/icons/qbt-theme/encrypted.png")));
|
||||
|
||||
tracker_url->setText(torrent->currentTracker());
|
||||
|
||||
|
@ -844,7 +844,7 @@ void TransferListWidget::displayListMenu(const QPoint&)
|
||||
connect(&actionDelete, SIGNAL(triggered()), this, SLOT(softDeleteSelectedTorrents()));
|
||||
QAction actionPreview_file(GuiIconProvider::instance()->getIcon("view-preview"), tr("Preview file..."), 0);
|
||||
connect(&actionPreview_file, SIGNAL(triggered()), this, SLOT(previewSelectedTorrents()));
|
||||
QAction actionSet_max_ratio(QIcon(QString::fromUtf8(":/icons/skin/ratio.png")), tr("Limit share ratio..."), 0);
|
||||
QAction actionSet_max_ratio(QIcon(QLatin1String(":/icons/skin/ratio.png")), tr("Limit share ratio..."), 0);
|
||||
connect(&actionSet_max_ratio, SIGNAL(triggered()), this, SLOT(setMaxRatioSelectedTorrents()));
|
||||
QAction actionSet_upload_limit(GuiIconProvider::instance()->getIcon("kt-set-max-upload-speed"), tr("Limit upload rate..."), 0);
|
||||
connect(&actionSet_upload_limit, SIGNAL(triggered()), this, SLOT(setUpLimitSelectedTorrents()));
|
||||
|
@ -394,7 +394,7 @@ void prefjson::setPreferences(const QString& json)
|
||||
QString locale = m["locale"].toString();
|
||||
if (pref->getLocale() != locale) {
|
||||
QTranslator *translator = new QTranslator;
|
||||
if (translator->load(QString::fromUtf8(":/lang/qbittorrent_") + locale)) {
|
||||
if (translator->load(QLatin1String(":/lang/qbittorrent_") + locale)) {
|
||||
qDebug("%s locale recognized, using translation.", qUtf8Printable(locale));
|
||||
}else{
|
||||
qDebug("%s locale unrecognized, using default (en).", qUtf8Printable(locale));
|
||||
|
Loading…
Reference in New Issue
Block a user