const-reference large types
This commit is contained in:
parent
07a4ddc230
commit
54c4fc7b36
|
@ -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);
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ struct CertificateHelper
|
|||
|
||||
static CryptoIdentity createNewIdentity(
|
||||
QString const & common_name,
|
||||
QDateTime expiry_date);
|
||||
QDateTime const & expiry_date);
|
||||
};
|
||||
|
||||
#endif // CERTIFICATEHELPER_HPP
|
||||
|
|
|
@ -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());
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)) {
|
||||
|
|
|
@ -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)))
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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{};
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue