Verified Commit 70324835 authored by Jonah Brüchert's avatar Jonah Brüchert 🌳

Use const & everywhere

parent 9c01f6b2
......@@ -85,7 +85,7 @@ int TabsModel::rowCount(const QModelIndex &parent) const
* @param url
* @param isMobile
*/
void TabsModel::setTab(int index, QString url, bool isMobile)
void TabsModel::setTab(int index, const QString &url, bool isMobile)
{
if (index < 0 && index >= m_tabs.count())
return; // index out of bounds
......@@ -219,7 +219,7 @@ void TabsModel::createEmptyTab()
newTab(QStringLiteral("about:blank"));
};
void TabsModel::newTab(QString url, bool isMobile) {
void TabsModel::newTab(const QString &url, bool isMobile) {
beginInsertRows({}, m_tabs.count(), m_tabs.count());
QJsonObject tab;
......@@ -274,7 +274,7 @@ void TabsModel::closeTab(int index) {
/**
* Load a url in the current tab
*/
void TabsModel::load(QString url) {
void TabsModel::load(const QString &url) {
qDebug() << "Loading url:" << url;
qDebug() << "current tab" << m_currentTab << "tabs open" << m_tabs.count();
......
......@@ -67,13 +67,13 @@ public:
QVector<TabState> tabs() const;
Q_INVOKABLE void setTab(int index, QString url, bool isMobile = false);
Q_INVOKABLE void setTab(int index, const QString &url, bool isMobile = false);
Q_INVOKABLE TabState tab(int index);
Q_INVOKABLE void newTab(QString url, bool isMobile = false);
Q_INVOKABLE void newTab(const QString &url, bool isMobile = false);
Q_INVOKABLE void createEmptyTab();
Q_INVOKABLE void closeTab(int index);
Q_INVOKABLE void load(QString url);
Q_INVOKABLE void load(const QString &url);
bool privateMode() const;
void setPrivateMode(bool privateMode);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment