aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAqua-sama <aqua@iserlohn-fortress.net>2020-01-12 20:48:06 +0200
committerAqua-sama <aqua@iserlohn-fortress.net>2020-01-12 20:48:06 +0200
commit3b1e87b4f11658dcc731fa4396a7bee7981f7af0 (patch)
tree4196f30f17577b70f4953f51b68f66add3562dee
parentUpdate doc/ and move various entries to wiki (diff)
downloadsmolbote-3b1e87b4f11658dcc731fa4396a7bee7981f7af0.tar.xz
Fix address bar completer deleting url when closing with no item selected
-rw-r--r--meson.build1
-rw-r--r--src/mainwindow/widgets/completer.cpp3
2 files changed, 3 insertions, 1 deletions
diff --git a/meson.build b/meson.build
index c033cac..32984ea 100644
--- a/meson.build
+++ b/meson.build
@@ -37,6 +37,7 @@ add_project_arguments(cxx.get_supported_arguments([
'-Wconsumed', # (clang) use-after-move warnings
'-Wdate-time', # Warn when using __TIME__ and __DATE__ macros
'-Wimplicit-fallthrough',
+ '-Wold-style-cast'
]), language: 'cpp')
mod_qt5 = import('qt5')
diff --git a/src/mainwindow/widgets/completer.cpp b/src/mainwindow/widgets/completer.cpp
index 578f745..1295fa3 100644
--- a/src/mainwindow/widgets/completer.cpp
+++ b/src/mainwindow/widgets/completer.cpp
@@ -70,7 +70,8 @@ bool Completer::keyPressed(QKeyEvent *event)
case Qt::Key_Enter:
case Qt::Key_Return:
hide();
- emit completionActivated(currentIndex.data().toString());
+ if(currentIndex.row() >= 0)
+ emit completionActivated(currentIndex.data().toString());
break;
default: