diff options
author | Miika Turkia <miika.turkia@gmail.com> | 2015-02-01 22:44:19 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-02-01 13:50:35 -0800 |
commit | e1db5f21b15b2d5ac9845f9f85bf433020bc35f0 (patch) | |
tree | 7ce2055c51b71ced03ebcd1cd1953c5d37d6c693 /qt-ui/tagwidget.cpp | |
parent | 62bc751bd900232ed6dc1ae8269f9f889531c0d9 (diff) | |
download | subsurface-e1db5f21b15b2d5ac9845f9f85bf433020bc35f0.tar.gz |
Fix Ubuntu glitch with completer popup
On Ubuntu, the completer often prevents applying/discarding the changes
on the dive info pane and disrupts editing of other fields as well. This
patch prevents the completer popup from appearing when not in edit mode
(apply or discard is pressed) or when the string is still empty.
Fixes #818
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/tagwidget.cpp')
-rw-r--r-- | qt-ui/tagwidget.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/qt-ui/tagwidget.cpp b/qt-ui/tagwidget.cpp index bfe535447..8365a2ea7 100644 --- a/qt-ui/tagwidget.cpp +++ b/qt-ui/tagwidget.cpp @@ -85,6 +85,14 @@ void TagWidget::reparse() if (pos.first >= 0 && pos.second > 0) currentText = text().mid(pos.first, pos.second - pos.first).trimmed(); + /* + * Do not show the completer when not in edit mode - basically + * this returns when we are accepting or discarding the changes. + */ + if (MainWindow::instance()->information()->isEditing() == false || currentText.length() == 0) { + return; + } + if (m_completer) { m_completer->setCompletionPrefix(currentText); if (m_completer->completionCount() == 1) { |