diff options
Diffstat (limited to 'Swift/QtUI')
-rw-r--r-- | Swift/QtUI/UserSearch/QtUserSearchFirstPage.cpp | 4 | ||||
-rw-r--r-- | Swift/QtUI/UserSearch/QtUserSearchWindow.cpp | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/Swift/QtUI/UserSearch/QtUserSearchFirstPage.cpp b/Swift/QtUI/UserSearch/QtUserSearchFirstPage.cpp index cba2f33..7a91a98 100644 --- a/Swift/QtUI/UserSearch/QtUserSearchFirstPage.cpp +++ b/Swift/QtUI/UserSearch/QtUserSearchFirstPage.cpp @@ -15,23 +15,23 @@ QtUserSearchFirstPage::QtUserSearchFirstPage(UserSearchWindow::Type type, const setTitle(title); setSubTitle(QString(tr("%1. If you know their address you can enter it directly, or you can search for them.")).arg(type == UserSearchWindow::AddContact ? tr("Add another user to your contact list") : tr("Chat to another user"))); connect(jid_, SIGNAL(textChanged(const QString&)), this, SLOT(emitCompletenessCheck())); connect(service_->lineEdit(), SIGNAL(textChanged(const QString&)), this, SLOT(emitCompletenessCheck())); } bool QtUserSearchFirstPage::isComplete() const { bool complete = false; if (byJID_->isChecked()) { - complete = JID(Q2PSTRING(jid_->text())).isValid(); + complete = JID(Q2PSTRING(jid_->text().trimmed())).isValid(); } else if (byLocalSearch_->isChecked()) { complete = true; } else if (byRemoteSearch_->isChecked()) { - complete = JID(Q2PSTRING(service_->currentText())).isValid(); + complete = JID(Q2PSTRING(service_->currentText().trimmed())).isValid(); } return complete; } void QtUserSearchFirstPage::emitCompletenessCheck() { emit completeChanged(); } } diff --git a/Swift/QtUI/UserSearch/QtUserSearchWindow.cpp b/Swift/QtUI/UserSearch/QtUserSearchWindow.cpp index 53eac07..949d65c 100644 --- a/Swift/QtUI/UserSearch/QtUserSearchWindow.cpp +++ b/Swift/QtUI/UserSearch/QtUserSearchWindow.cpp @@ -91,19 +91,19 @@ void QtUserSearchWindow::handleCurrentChanged(int page) { else if (page == 4) { detailsPage_->clear(); detailsPage_->setJID(getContactJID()); onNameSuggestionRequested(getContactJID()); } lastPage_ = page; } JID QtUserSearchWindow::getServerToSearch() { - return firstPage_->byRemoteSearch_->isChecked() ? JID(Q2PSTRING(firstPage_->service_->currentText())) : myServer_; + return firstPage_->byRemoteSearch_->isChecked() ? JID(Q2PSTRING(firstPage_->service_->currentText().trimmed())) : myServer_; } void QtUserSearchWindow::handleAccepted() { JID jid = getContactJID(); if (type_ == AddContact) { eventStream_->send(boost::make_shared<AddContactUIEvent>(jid, detailsPage_->getName(), detailsPage_->getSelectedGroups())); } else { @@ -186,19 +186,19 @@ JID QtUserSearchWindow::getContactJID() const { fallbackJid = field->getRawValues().at(0); } } if (!jid.isValid()) { jid = fallbackJid; } } } else { - jid = JID(Q2PSTRING(firstPage_->jid_->text())); + jid = JID(Q2PSTRING(firstPage_->jid_->text().trimmed())); } return jid; } void QtUserSearchWindow::show() { clear(); QWidget::show(); } |