# HG changeset patch
# User unc0rr
# Date 1241168504 0
# Node ID a591afb4376846344c8120cd9fc56ff96992bc2c
# Parent  f8cd566204efddcd6e5a1284e0d3a18f6b5cef04
Some changes in try to fix issue when you enter
room with painted map, but frontend shows generated
one (most probably bug is triggered by template
filters)
Untested.

diff -r f8cd566204ef -r a591afb43768 QTfrontend/mapContainer.cpp
--- a/QTfrontend/mapContainer.cpp	Thu Apr 30 20:20:01 2009 +0000
+++ b/QTfrontend/mapContainer.cpp	Fri May 01 09:01:44 2009 +0000
@@ -229,6 +229,13 @@
 
 void HWMapContainer::changeImage()
 {
+	if (pMap)
+	{
+		disconnect(pMap, 0, this, SLOT(setImage(const QImage)));
+		disconnect(pMap, 0, this, SLOT(setHHLimit(int)));
+		pMap = 0;
+	}
+
 	pMap = new HWMap();
 	connect(pMap, SIGNAL(ImageReceived(const QImage)), this, SLOT(setImage(const QImage)));
 	connect(pMap, SIGNAL(HHLimitReceived(int)), this, SLOT(setHHLimit(int)));
@@ -293,13 +300,14 @@
 	
 	int id = chooseMap->findText(map);
 	if(id > 0) {
-		chooseMap->setCurrentIndex(id);
-		loadMap(id);
 		if (pMap)
 		{
 			disconnect(pMap, 0, this, SLOT(setImage(const QImage)));
+			disconnect(pMap, 0, this, SLOT(setHHLimit(int)));
 			pMap = 0;
 		}
+		chooseMap->setCurrentIndex(id);
+		loadMap(id);
 	}
 }
 
@@ -331,7 +339,7 @@
 
 void HWMapContainer::templateFilterChanged(int filter)
 {
+	emit newTemplateFilter(filter);
 	changeImage();
-	emit newTemplateFilter(filter);
 }