QTfrontend/mapContainer.cpp
changeset 2021 a591afb43768
parent 1874 1b145e099b75
child 2377 f3fab2b09e0c
--- 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);
 }