diff options
| author | Karol Kosek <krkk@krkk.ct8.pl> | 2020-12-30 15:45:03 +0100 |
|---|---|---|
| committer | Felix Queißner <felix@ib-queissner.de> | 2020-12-30 20:31:39 +0100 |
| commit | 07a4ddc230c11c7249acd4c0363c6075e939f11b (patch) | |
| tree | e6330578c94bedfdc9b552cecbc8a874cc2713b9 /src | |
| parent | 80f64ff08cb3234c124cee786118c8e356942922 (diff) | |
| download | kristall-07a4ddc230c11c7249acd4c0363c6075e939f11b.tar.gz | |
Use multi-arg overload to save memory allocations
Diffstat (limited to 'src')
| -rw-r--r-- | src/browsertab.cpp | 9 | ||||
| -rw-r--r-- | src/dialogs/certificatemanagementdialog.cpp | 2 | ||||
| -rw-r--r-- | src/dialogs/settingsdialog.cpp | 18 | ||||
| -rw-r--r-- | src/documentstyle.cpp | 12 |
4 files changed, 17 insertions, 24 deletions
diff --git a/src/browsertab.cpp b/src/browsertab.cpp index 7d4de95..601ddd0 100644 --- a/src/browsertab.cpp +++ b/src/browsertab.cpp @@ -646,8 +646,7 @@ Info: MIME Type: %1 File Size: %2 )md") - .arg(mime.type) - .arg(IoUtil::size_human(data.size()))); + .arg(mime.type, data.size())); } assert((document != nullptr) == (doc_type == Text)); @@ -1159,9 +1158,9 @@ bool BrowserTab::startRequest(const QUrl &url, ProtocolHandler::RequestOptions o auto answer = QMessageBox::question( this, "Kristall", - tr("Your client certificate has a host filter enabled and this site does not match the host filter.\r\nNew URL: %1\r\nHost Filter: %2\r\nDo you want to keep the certificate enabled?") - .arg(url.toString(QUrl::FullyEncoded | QUrl::RemoveFragment)) - .arg(this->current_identity.host_filter), + tr("Your client certificate has a host filter enabled and this site does not match the host filter.\r\n" + "New URL: %1\r\nHost Filter: %2\r\nDo you want to keep the certificate enabled?") + .arg(url.toString(QUrl::FullyEncoded | QUrl::RemoveFragment), this->current_identity.host_filter), QMessageBox::Yes | QMessageBox::No, QMessageBox::No ); diff --git a/src/dialogs/certificatemanagementdialog.cpp b/src/dialogs/certificatemanagementdialog.cpp index 1ed78dd..9600378 100644 --- a/src/dialogs/certificatemanagementdialog.cpp +++ b/src/dialogs/certificatemanagementdialog.cpp @@ -249,7 +249,7 @@ void CertificateManagementDialog::on_import_cert_button_clicked() &cert_file, dialog.keyFileName().endsWith(".der") ? QSsl::Der : QSsl::Pem, }; - ident.user_notes = tr("Imported from:\r\nkey: %1\r\n:cert: %2").arg(dialog.keyFileName()).arg(dialog.certificateFileName()); + ident.user_notes = tr("Imported from:\r\nkey: %1\r\n:cert: %2").arg(dialog.keyFileName(), dialog.certificateFileName()); ident.display_name = "Imported Certificate"; ident.auto_enable = false; ident.host_filter = ""; diff --git a/src/dialogs/settingsdialog.cpp b/src/dialogs/settingsdialog.cpp index 269a0bd..8a319d2 100644 --- a/src/dialogs/settingsdialog.cpp +++ b/src/dialogs/settingsdialog.cpp @@ -109,29 +109,23 @@ void SettingsDialog::setGeminiStyle(DocumentStyle const &style) { label->setText(formatFont(font)); label->setStyleSheet(COLOR_STYLE - .arg(this->current_style.background_color.name()) - .arg(color.name())); + .arg(this->current_style.background_color.name(), color.name())); }; ui->bg_preview->setStyleSheet(COLOR_STYLE - .arg(this->current_style.background_color.name()) - .arg("#FF00FF")); + .arg(this->current_style.background_color.name(), "#FF00FF")); ui->quote_preview->setStyleSheet(COLOR_STYLE - .arg(this->current_style.blockquote_color.name()) - .arg("#FF00FF")); + .arg(this->current_style.blockquote_color.name(), "#FF00FF")); ui->link_local_preview->setStyleSheet(COLOR_STYLE - .arg(this->current_style.background_color.name()) - .arg(this->current_style.internal_link_color.name())); + .arg(this->current_style.background_color.name(), this->current_style.internal_link_color.name())); ui->link_foreign_preview->setStyleSheet(COLOR_STYLE - .arg(this->current_style.background_color.name()) - .arg(this->current_style.external_link_color.name())); + .arg(this->current_style.background_color.name(), this->current_style.external_link_color.name())); ui->link_cross_preview->setStyleSheet(COLOR_STYLE - .arg(this->current_style.background_color.name()) - .arg(this->current_style.cross_scheme_link_color.name())); + .arg(this->current_style.background_color.name(), this->current_style.cross_scheme_link_color.name())); setFontAndColor(this->ui->std_preview, this->current_style.standard_font, this->current_style.standard_color); setFontAndColor(this->ui->pre_preview, this->current_style.preformatted_font, this->current_style.preformatted_color); diff --git a/src/documentstyle.cpp b/src/documentstyle.cpp index 5829a1b..f5d91eb 100644 --- a/src/documentstyle.cpp +++ b/src/documentstyle.cpp @@ -414,12 +414,12 @@ QString DocumentStyle::toStyleSheet() const { QString css; - css += QString("p { color: %2; %1 }\n").arg(encodeCssFont (standard_font)).arg(standard_color.name()); - css += QString("a { color: %2; %1 }\n").arg(encodeCssFont (standard_font)).arg(external_link_color.name()); - css += QString("pre { color: %2; %1 }\n").arg(encodeCssFont (preformatted_font)).arg(preformatted_color.name()); - css += QString("h1 { color: %2; %1 }\n").arg(encodeCssFont (h1_font)).arg(h1_color.name()); - css += QString("h2 { color: %2; %1 }\n").arg(encodeCssFont (h2_font)).arg(h2_color.name()); - css += QString("h3 { color: %2; %1 }\n").arg(encodeCssFont (h3_font)).arg(h3_color.name()); + css += QString("p { color: %2; %1 }\n").arg(encodeCssFont (standard_font), standard_color.name()); + css += QString("a { color: %2; %1 }\n").arg(encodeCssFont (standard_font), external_link_color.name()); + css += QString("pre { color: %2; %1 }\n").arg(encodeCssFont (preformatted_font), preformatted_color.name()); + css += QString("h1 { color: %2; %1 }\n").arg(encodeCssFont (h1_font), h1_color.name()); + css += QString("h2 { color: %2; %1 }\n").arg(encodeCssFont (h2_font), h2_color.name()); + css += QString("h3 { color: %2; %1 }\n").arg(encodeCssFont (h3_font), h3_color.name()); css += QString("blockquote { background: %1 }\n").arg(blockquote_color.name()); // qDebug() << "CSS → " << css; |
