--- a/QTfrontend/ui/widget/mapContainer.cpp Tue May 01 19:56:55 2012 +0200
+++ b/QTfrontend/ui/widget/mapContainer.cpp Tue May 01 21:24:04 2012 +0200
@@ -376,24 +376,9 @@
void HWMapContainer::intSetMap(const QString & map)
{
- int id = 0;
- for(int i = 0; i < chooseMap->count(); i++)
- {
- QVariant data = chooseMap->itemData(i, Qt::UserRole + 1);
- // skip separators etc
- if (!data.isValid())
- continue;
- Q_ASSERT(data.canConvert<MapModel::MapInfo>());
- MapModel::MapInfo mapInfo = data.value<MapModel::MapInfo>();
+ int id = m_mapModel->indexOf(map);
- if (mapInfo.name == map)
- {
- id = i;
- break;
- }
- }
-
- if(id > 0)
+ if(id >= 0)
{
if (pMap)
{