From 022f9117b7ddd44334aad08290a156298a3e6a95 Mon Sep 17 00:00:00 2001
From: Kevin Smith <git@kismith.co.uk>
Date: Sat, 30 Jun 2012 18:24:08 +0100
Subject: Don't crash when going forward/backward through User Search and
 completing with no selection.

Resolves: #1062

diff --git a/Swift/QtUI/UserSearch/QtUserSearchWindow.cpp b/Swift/QtUI/UserSearch/QtUserSearchWindow.cpp
index 2b11d02..d69c626 100644
--- a/Swift/QtUI/UserSearch/QtUserSearchWindow.cpp
+++ b/Swift/QtUI/UserSearch/QtUserSearchWindow.cpp
@@ -78,6 +78,7 @@ QtUserSearchWindow::~QtUserSearchWindow() {
 }
 
 void QtUserSearchWindow::handleCurrentChanged(int page) {
+	resultsPage_->emitCompletenessCheck();
 	if (page == 2 && lastPage_ == 1) {
 		setError("");
 		/* next won't be called if JID is selected */
@@ -254,6 +255,7 @@ void QtUserSearchWindow::setResults(const std::vector<UserSearchResult>& results
 	delete model_;
 	model_ = newModel;
 	resultsPage_->setNoResults(model_->rowCount() == 0);
+	resultsPage_->emitCompletenessCheck();
 }
 
 void QtUserSearchWindow::setResultsForm(Form::ref results) {
@@ -266,6 +268,7 @@ void QtUserSearchWindow::setResultsForm(Form::ref results) {
 	delete model_;
 	model_ = newModel;
 	resultsPage_->setNoResults(model_->rowCount() == 0);
+	resultsPage_->emitCompletenessCheck();
 }
 
 void QtUserSearchWindow::setSelectedService(const JID& jid) {
-- 
cgit v0.10.2-6-g49f6