diff options
| author | Karol Kosek <krkk@krkk.ct8.pl> | 2020-12-30 16:01:26 +0100 |
|---|---|---|
| committer | Felix Queißner <felix@ib-queissner.de> | 2020-12-30 20:31:39 +0100 |
| commit | 54c4fc7b36fea598d3b35ff9d00c451eefcaf710 (patch) | |
| tree | 58f9ae4abb520e774fef4ece031b03bbb4c4fa24 /src | |
| parent | 07a4ddc230c11c7249acd4c0363c6075e939f11b (diff) | |
| download | kristall-54c4fc7b36fea598d3b35ff9d00c451eefcaf710.tar.gz | |
const-reference large types
Diffstat (limited to 'src')
| -rw-r--r-- | src/browsertab.cpp | 2 | ||||
| -rw-r--r-- | src/browsertab.hpp | 2 | ||||
| -rw-r--r-- | src/certificatehelper.cpp | 2 | ||||
| -rw-r--r-- | src/certificatehelper.hpp | 2 | ||||
| -rw-r--r-- | src/dialogs/certificateselectiondialog.cpp | 2 | ||||
| -rw-r--r-- | src/dialogs/certificateselectiondialog.hpp | 2 | ||||
| -rw-r--r-- | src/dialogs/settingsdialog.cpp | 2 | ||||
| -rw-r--r-- | src/main.cpp | 2 | ||||
| -rw-r--r-- | src/renderers/geminirenderer.cpp | 2 | ||||
| -rw-r--r-- | src/renderers/markdownrenderer.cpp | 6 | ||||
| -rw-r--r-- | src/tabbrowsinghistory.cpp | 4 | ||||
| -rw-r--r-- | src/tabbrowsinghistory.hpp | 4 |
12 files changed, 16 insertions, 16 deletions
diff --git a/src/browsertab.cpp b/src/browsertab.cpp index 601ddd0..11ad9fb 100644 --- a/src/browsertab.cpp +++ b/src/browsertab.cpp @@ -144,7 +144,7 @@ void BrowserTab::navigateTo(const QUrl &url, PushToHistory mode) this->updateUI(); } -void BrowserTab::navigateBack(QModelIndex history_index) +void BrowserTab::navigateBack(const QModelIndex &history_index) { auto url = history.get(history_index); diff --git a/src/browsertab.hpp b/src/browsertab.hpp index 391bacd..10edbc7 100644 --- a/src/browsertab.hpp +++ b/src/browsertab.hpp @@ -53,7 +53,7 @@ public: void navigateTo(QUrl const & url, PushToHistory mode); - void navigateBack(QModelIndex history_index); + void navigateBack(const QModelIndex &history_index); void navOneBackback(); diff --git a/src/certificatehelper.cpp b/src/certificatehelper.cpp index 2b6acb8..147be6e 100644 --- a/src/certificatehelper.cpp +++ b/src/certificatehelper.cpp @@ -4,7 +4,7 @@ #include <openssl/x509.h> #include <openssl/pem.h> -CryptoIdentity CertificateHelper::createNewIdentity(const QString &common_name, QDateTime expiry_date) +CryptoIdentity CertificateHelper::createNewIdentity(const QString &common_name, const QDateTime &expiry_date) { CryptoIdentity identity; diff --git a/src/certificatehelper.hpp b/src/certificatehelper.hpp index e395666..90cb526 100644 --- a/src/certificatehelper.hpp +++ b/src/certificatehelper.hpp @@ -11,7 +11,7 @@ struct CertificateHelper static CryptoIdentity createNewIdentity( QString const & common_name, - QDateTime expiry_date); + QDateTime const & expiry_date); }; #endif // CERTIFICATEHELPER_HPP diff --git a/src/dialogs/certificateselectiondialog.cpp b/src/dialogs/certificateselectiondialog.cpp index 4caf988..2c08110 100644 --- a/src/dialogs/certificateselectiondialog.cpp +++ b/src/dialogs/certificateselectiondialog.cpp @@ -63,7 +63,7 @@ void CertificateSelectionDialog::on_use_temp_cert_48h_clicked() acceptTemporaryWithTimeout(QDateTime::currentDateTime().addDays(2)); } -void CertificateSelectionDialog::acceptTemporaryWithTimeout(QDateTime timeout) +void CertificateSelectionDialog::acceptTemporaryWithTimeout(const QDateTime &timeout) { std::default_random_engine rng; rng.seed(QDateTime::currentDateTime().toMSecsSinceEpoch()); diff --git a/src/dialogs/certificateselectiondialog.hpp b/src/dialogs/certificateselectiondialog.hpp index e628f5c..117e991 100644 --- a/src/dialogs/certificateselectiondialog.hpp +++ b/src/dialogs/certificateselectiondialog.hpp @@ -41,7 +41,7 @@ private slots: private: //! Creates an anonymous identity with a randomly chosen name that //! will time out on `timeout`, then accepts the dialog. - void acceptTemporaryWithTimeout(QDateTime timeout); + void acceptTemporaryWithTimeout(const QDateTime &timeout); void on_currentChanged(const QModelIndex ¤t, const QModelIndex &previous); diff --git a/src/dialogs/settingsdialog.cpp b/src/dialogs/settingsdialog.cpp index 8a319d2..6024a04 100644 --- a/src/dialogs/settingsdialog.cpp +++ b/src/dialogs/settingsdialog.cpp @@ -105,7 +105,7 @@ void SettingsDialog::setGeminiStyle(DocumentStyle const &style) this->ui->page_margin->setValue(this->current_style.margin); - auto setFontAndColor = [this](QLabel * label, QFont font, QColor color) + auto setFontAndColor = [this](QLabel * label, const QFont &font, QColor color) { label->setText(formatFont(font)); label->setStyleSheet(COLOR_STYLE diff --git a/src/main.cpp b/src/main.cpp index 8fe2c64..c7b6259 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -37,7 +37,7 @@ static QApplication * app; #define SSTR(X) STR(X) #define STR(X) #X -static QDir derive_dir(QDir const & parent, QString subdir) +static QDir derive_dir(QDir const & parent, QString const & subdir) { QDir child = parent; if(not child.mkpath(subdir)) { diff --git a/src/renderers/geminirenderer.cpp b/src/renderers/geminirenderer.cpp index 5c26e6b..e7d18b5 100644 --- a/src/renderers/geminirenderer.cpp +++ b/src/renderers/geminirenderer.cpp @@ -10,7 +10,7 @@ #include "textstyleinstance.hpp" -static QByteArray trim_whitespace(QByteArray items) +static QByteArray trim_whitespace(const QByteArray &items) { int start = 0; while (start < items.size() and isspace(items.at(start))) diff --git a/src/renderers/markdownrenderer.cpp b/src/renderers/markdownrenderer.cpp index db09e21..5ab4504 100644 --- a/src/renderers/markdownrenderer.cpp +++ b/src/renderers/markdownrenderer.cpp @@ -75,9 +75,9 @@ struct RenderState } }; -static void renderNode(RenderState &state, cmark_node &node, QTextCharFormat current_format, QString &page_title, int listIndent = 1); +static void renderNode(RenderState &state, cmark_node &node, const QTextCharFormat ¤t_format, QString &page_title, int listIndent = 1); -static void renderChildren(RenderState &state, cmark_node & node, QTextCharFormat current_format, QString &page_title, int listIndent = 1) +static void renderChildren(RenderState &state, cmark_node & node, const QTextCharFormat ¤t_format, QString &page_title, int listIndent = 1) { for (auto child = cmark_node_first_child(&node); child != nullptr; child = cmark_node_next(child)) { @@ -102,7 +102,7 @@ static QString extractNodeText(cmark_node &node) return QString::fromUtf8(data, strlen(data)); } -static void renderNode(RenderState &state, cmark_node & node, QTextCharFormat current_format, QString &page_title, int listIndent) +static void renderNode(RenderState &state, cmark_node & node, const QTextCharFormat ¤t_format, QString &page_title, int listIndent) { auto & cursor = state.cursor; diff --git a/src/tabbrowsinghistory.cpp b/src/tabbrowsinghistory.cpp index db4a981..5f2cba4 100644 --- a/src/tabbrowsinghistory.cpp +++ b/src/tabbrowsinghistory.cpp @@ -41,7 +41,7 @@ QUrl TabBrowsingHistory::get(const QModelIndex &index) const return history.at(index.row()); } -QModelIndex TabBrowsingHistory::oneForward(QModelIndex index) const +QModelIndex TabBrowsingHistory::oneForward(const QModelIndex &index) const { if(not index.isValid()) return QModelIndex{}; @@ -50,7 +50,7 @@ QModelIndex TabBrowsingHistory::oneForward(QModelIndex index) const return createIndex(index.row() + 1, index.column()); } -QModelIndex TabBrowsingHistory::oneBackward(QModelIndex index) const +QModelIndex TabBrowsingHistory::oneBackward(const QModelIndex &index) const { if(not index.isValid()) return QModelIndex{}; diff --git a/src/tabbrowsinghistory.hpp b/src/tabbrowsinghistory.hpp index 4305218..8adee30 100644 --- a/src/tabbrowsinghistory.hpp +++ b/src/tabbrowsinghistory.hpp @@ -20,9 +20,9 @@ public: QUrl get(QModelIndex const & index) const; - QModelIndex oneForward(QModelIndex index) const; + QModelIndex oneForward(const QModelIndex &index) const; - QModelIndex oneBackward(QModelIndex index) const; + QModelIndex oneBackward(const QModelIndex &index) const; public: int rowCount(const QModelIndex &parent = QModelIndex()) const override; |
