diff options
Diffstat (limited to 'Swift/QtUI/UserSearch/QtSuggestingJIDInput.cpp')
-rw-r--r-- | Swift/QtUI/UserSearch/QtSuggestingJIDInput.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Swift/QtUI/UserSearch/QtSuggestingJIDInput.cpp b/Swift/QtUI/UserSearch/QtSuggestingJIDInput.cpp index a4a4610..9b96627 100644 --- a/Swift/QtUI/UserSearch/QtSuggestingJIDInput.cpp +++ b/Swift/QtUI/UserSearch/QtSuggestingJIDInput.cpp @@ -91,6 +91,11 @@ void QtSuggestingJIDInput::setSuggestions(const std::vector<Contact::ref>& sugge } } +void QtSuggestingJIDInput::clear() { + setText(""); + currentContact_.reset(); +} + void QtSuggestingJIDInput::keyPressEvent(QKeyEvent* event) { if (event->key() == Qt::Key_Up) { if (contactListModel_->rowCount() > 0) { @@ -138,7 +143,6 @@ void QtSuggestingJIDInput::handleSettingsChanged(const std::string& setting) { void QtSuggestingJIDInput::handleClicked(const QModelIndex& index) { if (index.isValid()) { currentContact_ = contactListModel_->getContact(index.row()); - setText(""); onUserSelected(currentContact_->jid); hidePopup(); } |