diff options
Diffstat (limited to 'Swift/QtUI/UserSearch/QtUserSearchWindow.cpp')
-rw-r--r-- | Swift/QtUI/UserSearch/QtUserSearchWindow.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/Swift/QtUI/UserSearch/QtUserSearchWindow.cpp b/Swift/QtUI/UserSearch/QtUserSearchWindow.cpp index 17214e4..e5bd5d0 100644 --- a/Swift/QtUI/UserSearch/QtUserSearchWindow.cpp +++ b/Swift/QtUI/UserSearch/QtUserSearchWindow.cpp @@ -72,19 +72,19 @@ QtUserSearchWindow::~QtUserSearchWindow() { } void QtUserSearchWindow::handleCurrentChanged(int page) { searchNext_ = false; if (firstMultiJIDPage_) { firstMultiJIDPage_->reset(); } resultsPage_->emitCompletenessCheck(); if (page == 1 && lastPage_ == 3) { - addSearchedJIDToList(getContactJID()); + addSearchedJIDToList(getContact()); setSecondPage(); } else if (page == 2 && lastPage_ == 1) { setError(""); /* next won't be called if JID is selected */ JID server = getServerToSearch(); clearForm(); onFormRequested(server); setThirdPage(); @@ -264,21 +264,25 @@ JID QtUserSearchWindow::getContactJID() const { } } } else { jid = JID(Q2PSTRING(firstPage_->jid_->text().trimmed())); } return jid; } -void QtUserSearchWindow::addSearchedJIDToList(const JID& jid) { +Contact::ref QtUserSearchWindow::getContact() const { + return boost::make_shared<Contact>("", getContactJID(), StatusShow::None, ""); +} + +void QtUserSearchWindow::addSearchedJIDToList(const Contact::ref& contact) { std::vector<JID> jids; - jids.push_back(jid); + jids.push_back(contact->jid); handleJIDsAdded(jids); firstMultiJIDPage_->jid_->clear(); } void QtUserSearchWindow::show() { clear(); QWidget::show(); } @@ -337,19 +341,19 @@ void QtUserSearchWindow::setContactSuggestions(const std::vector<Contact::ref>& if (type_ == AddContact) { firstPage_->jid_->setSuggestions(suggestions); } else { firstMultiJIDPage_->jid_->setSuggestions(suggestions); } } void QtUserSearchWindow::setJIDs(const std::vector<JID> &jids) { foreach(JID jid, jids) { - addSearchedJIDToList(jid); + addSearchedJIDToList(boost::make_shared<Contact>("", jid, StatusShow::None, "")); } onJIDUpdateRequested(jids); } void QtUserSearchWindow::setRoomJID(const JID& roomJID) { roomJID_ = roomJID; } std::string QtUserSearchWindow::getReason() const { |