summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2017-04-04 07:17:53 (GMT)
committerTobias Markmann <tm@ayena.de>2017-04-04 07:18:28 (GMT)
commit38f35935581b826940a10246b0a624c643dccc2e (patch)
treebc1e27b5209acc0bba2611dee50d0c419563effb /Swift/QtUI
parentf4034579f0d4adc6d2e7cb293e91cabd6d598887 (diff)
downloadswift-38f35935581b826940a10246b0a624c643dccc2e.zip
swift-38f35935581b826940a10246b0a624c643dccc2e.tar.bz2
Test against dialog type instead of nullptr in QtUserSearchWindow
If the dialog is not of type AddContact, firstMultiJIDPage_ is initialised and this states more clearly that the reset is only done when the dialog is in this mode. Coverity raised this issue. Test-Information: Added a user from search and started a chat from user search. All unit tests pass on macOS 10.12.4. Change-Id: I55f6df5b4f48e2c6718922846a424bf17f363b16
Diffstat (limited to 'Swift/QtUI')
-rw-r--r--Swift/QtUI/UserSearch/QtUserSearchWindow.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/Swift/QtUI/UserSearch/QtUserSearchWindow.cpp b/Swift/QtUI/UserSearch/QtUserSearchWindow.cpp
index 7575a13..f150557 100644
--- a/Swift/QtUI/UserSearch/QtUserSearchWindow.cpp
+++ b/Swift/QtUI/UserSearch/QtUserSearchWindow.cpp
@@ -77,7 +77,7 @@ QtUserSearchWindow::~QtUserSearchWindow() {
void QtUserSearchWindow::handleCurrentChanged(int page) {
searchNext_ = false;
- if (firstMultiJIDPage_) {
+ if (type_ != AddContact) {
firstMultiJIDPage_->reset();
}
resultsPage_->emitCompletenessCheck();
@@ -121,7 +121,8 @@ void QtUserSearchWindow::handleCurrentChanged(int page) {
JID QtUserSearchWindow::getServerToSearch() {
if (type_ == AddContact) {
return firstPage_->byRemoteSearch_->isChecked() ? JID(Q2PSTRING(firstPage_->service_->currentText().trimmed())) : myServer_;
- } else {
+ }
+ else {
return firstMultiJIDPage_->byRemoteSearch_->isChecked() ? JID(Q2PSTRING(firstMultiJIDPage_->service_->currentText().trimmed())) : myServer_;
}
}