From 95ff0fccf5fdefc395091a16e278bf3c2cd9d865 Mon Sep 17 00:00:00 2001
From: Kevin Smith <git@kismith.co.uk>
Date: Mon, 24 May 2010 19:38:41 +0100
Subject: Various cleanups


diff --git a/Swift/QtUI/QtRosterHeader.h b/Swift/QtUI/QtRosterHeader.h
index 7fed2c0..72091cb 100644
--- a/Swift/QtUI/QtRosterHeader.h
+++ b/Swift/QtUI/QtRosterHeader.h
@@ -45,8 +45,6 @@ namespace Swift {
 //		void toggleExpanded();
 		QString name_;
 		QLabel* avatarLabel_;
-#warning FIXME - replace QLabel with override to do elide
-//http://lists.trolltech.com/pipermail/qt-interest/2010-January/018056.html
 		QLabel* nameLabel_;
 		QtTextEdit* statusEdit_;
 		QToolBar* toolBar_;
diff --git a/Swift/QtUI/QtStatusWidget.cpp b/Swift/QtUI/QtStatusWidget.cpp
index a5eda8b..e909f5c 100644
--- a/Swift/QtUI/QtStatusWidget.cpp
+++ b/Swift/QtUI/QtStatusWidget.cpp
@@ -93,13 +93,16 @@ void QtStatusWidget::handleApplicationFocusChanged(QWidget* /*old*/, QWidget* no
 	if (stack_->currentIndex() == 0) {
 		return;
 	}
-	if (now != menu_ && now != statusEdit_) {
+	if (!now || (now != menu_ && now != statusEdit_ && !now->isAncestorOf(statusEdit_) && !now->isAncestorOf(menu_) && !statusEdit_->isAncestorOf(now) && !menu_->isAncestorOf(now))) {
 		handleEditCancelled();
 	}
+	
 }
 
 void QtStatusWidget::mousePressEvent(QMouseEvent*) {
-	handleClicked();
+	if (stack_->currentIndex() == 0) {
+		handleClicked();
+	}
 }
 
 void QtStatusWidget::generateList() {
diff --git a/Swift/QtUI/QtStatusWidget.h b/Swift/QtUI/QtStatusWidget.h
index 7317ea5..ef8b397 100644
--- a/Swift/QtUI/QtStatusWidget.h
+++ b/Swift/QtUI/QtStatusWidget.h
@@ -4,8 +4,7 @@
  * See Documentation/Licenses/GPLv3.txt for more information.
  */
 
-#ifndef SWIFT_QtStatusWidget_H
-#define SWIFT_QtStatusWidget_H
+#pragma once
 
 #include "Swiften/Elements/StatusShow.h"
 
@@ -58,6 +57,3 @@ namespace Swift {
 	};
 }
 
-#endif
-
-
-- 
cgit v0.10.2-6-g49f6