Commit bf73e9dd authored by Waqar Ahmed's avatar Waqar Ahmed Committed by Christoph Cullmann
Browse files

Clean up - avoid unnecessary copying

parent 2733ec1c
......@@ -225,8 +225,6 @@ KateCommandBar::KateCommandBar(QWidget *parent)
m_proxyModel = new CommandBarFilterModel(this);
m_proxyModel->setFilterRole(Qt::DisplayRole);
m_proxyModel->setSortRole(CommandModel::Score);
m_proxyModel->setFilterCaseSensitivity(Qt::CaseInsensitive);
m_proxyModel->setSortCaseSensitivity(Qt::CaseInsensitive);
m_proxyModel->setFilterKeyColumn(0);
connect(m_lineEdit, &QLineEdit::returnPressed, this, &KateCommandBar::slotReturnPressed);
......@@ -253,7 +251,7 @@ KateCommandBar::KateCommandBar(QWidget *parent)
setHidden(true);
}
void KateCommandBar::updateBar(QList<KActionCollection *> actionCollections)
void KateCommandBar::updateBar(const QList<KActionCollection *> &actionCollections)
{
QVector<QPair<QString, QAction*>> actionList;
for (const auto collection : actionCollections) {
......@@ -262,7 +260,7 @@ void KateCommandBar::updateBar(QList<KActionCollection *> actionCollections)
}
}
m_model->refresh(actionList);
m_model->refresh(std::move(actionList));
reselectFirst();
updateViewGeometry();
......
......@@ -19,7 +19,7 @@ class KateCommandBar : public QMenu
public:
KateCommandBar(QWidget* parent = nullptr);
void updateBar(QList<KActionCollection*> actions);
void updateBar(const QList<KActionCollection*>& actions);
void updateViewGeometry();
......
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