diff options
-rw-r--r-- | qt-ui/tagwidget.cpp | 8 | ||||
-rw-r--r-- | qt-ui/tagwidget.h | 6 |
2 files changed, 7 insertions, 7 deletions
diff --git a/qt-ui/tagwidget.cpp b/qt-ui/tagwidget.cpp index 4c71c5fac..53643648f 100644 --- a/qt-ui/tagwidget.cpp +++ b/qt-ui/tagwidget.cpp @@ -138,13 +138,13 @@ void TagWidget::reparse() } } -void TagWidget::completionSelected(QString completion) +void TagWidget::completionSelected(const QString& completion) { completionHighlighted(completion); emit textChanged(); } -void TagWidget::completionHighlighted(QString completion) +void TagWidget::completionHighlighted(const QString& completion) { QPair<int, int> pos; pos = getCursorTagPosition(); @@ -152,7 +152,7 @@ void TagWidget::completionHighlighted(QString completion) setText(text().remove(pos.first, pos.second - pos.first).insert(pos.first, completion)); setCursorPosition(pos.first + completion.length()); } else { - setText(completion.append(", ")); + setText(completion + QString(", ")); setCursorPosition(text().length()); } } @@ -164,7 +164,7 @@ void TagWidget::setCursorPosition(int position) blockSignals(false); } -void TagWidget::setText(QString text) +void TagWidget::setText(const QString& text) { blockSignals(true); GroupedLineEdit::setText(text); diff --git a/qt-ui/tagwidget.h b/qt-ui/tagwidget.h index 42c94b4e0..62fa36f30 100644 --- a/qt-ui/tagwidget.h +++ b/qt-ui/tagwidget.h @@ -12,15 +12,15 @@ public: void setCompleter(QCompleter *completer); QPair<int, int> getCursorTagPosition(); void highlight(); - void setText(QString text); + void setText(const QString& text); void clear(); void setCursorPosition(int position); void wheelEvent(QWheelEvent *event); public slots: void reparse(); - void completionSelected(QString); - void completionHighlighted(QString); + void completionSelected(const QString& text); + void completionHighlighted(const QString& text); protected: void keyPressEvent(QKeyEvent *e); |