# HG changeset patch # User Wuzzy # Date 1521509087 -3600 # Node ID 66dd7b5f7d33b45b1eb0ebece74e97b9edd122c5 # Parent 7d7eb27dab31b6c2d269edd84377da60acd02df7 Fix incorrect preview when selecting image map the first time in session diff -r 7d7eb27dab31 -r 66dd7b5f7d33 QTfrontend/ui/widget/mapContainer.cpp --- a/QTfrontend/ui/widget/mapContainer.cpp Mon Mar 19 18:58:49 2018 +0100 +++ b/QTfrontend/ui/widget/mapContainer.cpp Tue Mar 20 02:24:47 2018 +0100 @@ -399,7 +399,7 @@ void HWMapContainer::askForGeneratedPreview() { pMap = new HWMap(this); - connect(pMap, SIGNAL(ImageReceived(QPixmap)), this, SLOT(setImage(QPixmap))); + connect(pMap, SIGNAL(ImageReceived(QPixmap)), this, SLOT(setImage(const QPixmap))); connect(pMap, SIGNAL(HHLimitReceived(int)), this, SLOT(setHHLimit(int))); connect(pMap, SIGNAL(destroyed(QObject *)), this, SLOT(onPreviewMapDestroyed(QObject *))); pMap->getImage(m_seed, @@ -563,7 +563,7 @@ if (m_mapInfo.type != MapModel::StaticMap && m_mapInfo.type != MapModel::MissionMap) { m_mapInfo.type = MapModel::StaticMap; - changeMapType(MapModel::StaticMap, QModelIndex()); + changeMapType(m_mapInfo.type, QModelIndex()); } updatePreview(); } @@ -1112,9 +1112,18 @@ { QListView * mapList; - if (type == 0) mapList = staticMapList; - else if (type == 1) mapList = missionMapList; - else return; + if (type == 0) + { + mapList = staticMapList; + m_mapInfo.type = MapModel::StaticMap; + } + else if (type == 1) + { + mapList = missionMapList; + m_mapInfo.type = MapModel::MissionMap; + } + else + return; // Make sure it is a valid index if (!map.isValid())