QTfrontend/mapContainer.cpp
changeset 1348 0eb0b3a955b8
parent 1333 b0b0510eb82d
child 1365 2ffe20744a4a
equal deleted inserted replaced
1347:1102e19780b9 1348:0eb0b3a955b8
   130 }
   130 }
   131 
   131 
   132 void HWMapContainer::loadMap(int index)
   132 void HWMapContainer::loadMap(int index)
   133 {
   133 {
   134   QPixmap mapImage;
   134   QPixmap mapImage;
   135   if(!mapImage.load(datadir->absolutePath() + "/Maps/" + chooseMap->currentText() + "/map.png")) {
   135   if(!mapImage.load(datadir->absolutePath() + "/Maps/" + chooseMap->currentText() + "/preview.png")) {
   136     changeImage();
   136     changeImage();
   137     chooseMap->setCurrentIndex(0);
   137     chooseMap->setCurrentIndex(0);
   138     return;
   138     return;
   139   }
   139   }
   140   imageButt->setIcon(mapImage.scaled(256, 128));
   140   imageButt->setIcon(mapImage);
   141   QFile mapCfgFile(datadir->absolutePath() + "/Maps/" + chooseMap->currentText() + "/map.cfg");
   141   QFile mapCfgFile(datadir->absolutePath() + "/Maps/" + chooseMap->currentText() + "/map.cfg");
   142   if (mapCfgFile.open(QFile::ReadOnly)) {
   142   if (mapCfgFile.open(QFile::ReadOnly)) {
   143     QTextStream input(&mapCfgFile);
   143     QTextStream input(&mapCfgFile);
   144     input >> theme;
   144     input >> theme;
   145     mapCfgFile.close();
   145     mapCfgFile.close();