From 4f387ef2ff44266fbeab9b5bae7e7c704e926d01 Mon Sep 17 00:00:00 2001
From: Kevin Smith <git@kismith.co.uk>
Date: Tue, 25 May 2010 09:21:59 +0100
Subject: More careful use of focus change signal to avoid status setting
 failing on Windows


diff --git a/Swift/QtUI/QtStatusWidget.cpp b/Swift/QtUI/QtStatusWidget.cpp
index ab2e854..da5d0e0 100644
--- a/Swift/QtUI/QtStatusWidget.cpp
+++ b/Swift/QtUI/QtStatusWidget.cpp
@@ -80,8 +80,6 @@ QtStatusWidget::QtStatusWidget(QWidget *parent) : QWidget(parent), editCursor_(Q
 
 	connect(menu_, SIGNAL(itemClicked(QListWidgetItem*)), this, SLOT(handleItemClicked(QListWidgetItem*)));
 
-	connect(qApp, SIGNAL(focusChanged(QWidget*, QWidget*)), this, SLOT(handleApplicationFocusChanged(QWidget*, QWidget*)));
-
 	viewMode();
 }
 
@@ -145,9 +143,11 @@ void QtStatusWidget::handleClicked() {
 	statusEdit_->selectAll();
 	stack_->setCurrentIndex(1);
 	statusEdit_->setFocus();
+	connect(qApp, SIGNAL(focusChanged(QWidget*, QWidget*)), this, SLOT(handleApplicationFocusChanged(QWidget*, QWidget*)), Qt/*::ConnectionType*/::QueuedConnection);
 }
 
 void QtStatusWidget::viewMode() {
+	disconnect(qApp, SIGNAL(focusChanged(QWidget*, QWidget*)), this, SLOT(handleApplicationFocusChanged(QWidget*, QWidget*)));
 	editing_ = false;
 	menu_->hide();
 	stack_->setCurrentIndex(0);	
-- 
cgit v0.10.2-6-g49f6