Browse Source

Merge pull request #7782 from Chocobo1/utf8

Remove superfluous QString::fromUtf8()
adaptive-webui-19844
sledgehammer999 7 years ago committed by GitHub
parent
commit
1a9e650936
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      src/app/application.cpp
  2. 4
      src/gui/downloadfromurldlg.h
  3. 4
      src/gui/optionsdlg.cpp
  4. 2
      src/gui/properties/propertieswidget.cpp
  5. 4
      src/gui/speedlimitdlg.cpp
  6. 2
      src/gui/trackerlogin.cpp
  7. 2
      src/gui/transferlistwidget.cpp
  8. 2
      src/webui/prefjson.cpp

6
src/app/application.cpp

@ -600,15 +600,15 @@ void Application::initializeTranslation() @@ -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));

4
src/gui/downloadfromurldlg.h

@ -60,7 +60,7 @@ class downloadFromURL : public QDialog, private Ui::downloadFromURL @@ -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 @@ -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) {

4
src/gui/optionsdlg.cpp

@ -259,7 +259,7 @@ OptionsDialog::OptionsDialog(QWidget *parent) @@ -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() @@ -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));

2
src/gui/properties/propertieswidget.cpp

@ -799,7 +799,7 @@ void PropertiesWidget::askWebSeed() @@ -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()) {

4
src/gui/speedlimitdlg.cpp

@ -74,7 +74,7 @@ void SpeedLimitDialog::updateSpinValue(int val) const @@ -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 @@ -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);

2
src/gui/trackerlogin.cpp

@ -43,7 +43,7 @@ trackerLogin::trackerLogin(QWidget *parent, BitTorrent::TorrentHandle *const tor @@ -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());

2
src/gui/transferlistwidget.cpp

@ -844,7 +844,7 @@ void TransferListWidget::displayListMenu(const QPoint&) @@ -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()));

2
src/webui/prefjson.cpp

@ -394,7 +394,7 @@ void prefjson::setPreferences(const QString& json) @@ -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…
Cancel
Save