1 files changed, 10 insertions, 1 deletions
diff --git a/src/QuickSwitcher.cc b/src/QuickSwitcher.cc
index 542eebd9..2be636a4 100644
--- a/src/QuickSwitcher.cc
+++ b/src/QuickSwitcher.cc
@@ -122,7 +122,16 @@ QuickSwitcher::QuickSwitcher(QWidget *parent)
roomSearch_, &RoomSearchInput::hiding, this, [=]() { completer_->popup()->hide(); });
connect(roomSearch_, &QLineEdit::returnPressed, this, [=]() {
emit closing();
- emit roomSelected(rooms_[this->roomSearch_->text().trimmed()]);
+
+ QString text("");
+
+ if (selection_ == -1) {
+ completer_->setCurrentRow(0);
+ text = completer_->currentCompletion();
+ } else {
+ text = this->roomSearch_->text().trimmed();
+ }
+ emit roomSelected(rooms_[text]);
roomSearch_->clear();
});
|