From e088067ef12f5e2032f6b742ef103c582283f84a Mon Sep 17 00:00:00 2001 From: Gehad Date: Wed, 23 Apr 2014 10:06:45 +0200 Subject: Fix a minor bug in the tags widget. Using the auto-completer while the tags widget is 'empty', always picked the first choice. Write some letters and remove them in an empty tags widget, the complete list of tags will appear - now if you try to choose any tag with the keyboard arrows it will choose the first one. also if you tried choosing it by mouse it will be inserted twice. This is fixed by removing the unneeded else part. Signed-off-by: Gehad elrobey Signed-off-by: Dirk Hohndel --- qt-ui/tagwidget.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/qt-ui/tagwidget.cpp b/qt-ui/tagwidget.cpp index fbebe3f35..dfeeac537 100644 --- a/qt-ui/tagwidget.cpp +++ b/qt-ui/tagwidget.cpp @@ -146,13 +146,8 @@ void TagWidget::completionSelected(const QString& completion) void TagWidget::completionHighlighted(const QString& completion) { QPair pos = getCursorTagPosition(); - if (pos.first >= 0 && pos.second > 0) { - setText(text().remove(pos.first, pos.second - pos.first).insert(pos.first, completion)); - setCursorPosition(pos.first + completion.length()); - } else { - setText(completion + QString(", ")); - setCursorPosition(text().length()); - } + setText(text().remove(pos.first, pos.second - pos.first).insert(pos.first, completion)); + setCursorPosition(pos.first + completion.length()); } void TagWidget::setCursorPosition(int position) -- cgit v1.2.3-70-g09d2