QTfrontend/mapContainer.cpp
changeset 314 83773ccf4f09
parent 251 e4058e1ba394
child 320 1ee7f087195a
equal deleted inserted replaced
313:b26dbb909c4e 314:83773ccf4f09
   115   QFile mapCfgFile(datadir->absolutePath()+"/Maps/"+chooseMap->currentText()+"/map.cfg");
   115   QFile mapCfgFile(datadir->absolutePath()+"/Maps/"+chooseMap->currentText()+"/map.cfg");
   116   if (mapCfgFile.open(QFile::ReadOnly)) {
   116   if (mapCfgFile.open(QFile::ReadOnly)) {
   117     QTextStream input(&mapCfgFile);
   117     QTextStream input(&mapCfgFile);
   118     QString theme;
   118     QString theme;
   119     input >> theme;
   119     input >> theme;
       
   120     mapCfgFile.close();
   120     if(theme.length()>256) throw MapFileErrorException(); // theme name too long
   121     if(theme.length()>256) throw MapFileErrorException(); // theme name too long
   121     return theme;
   122     return theme;
   122     mapCfgFile.close();
       
   123   } else {
   123   } else {
   124     throw MapFileErrorException();
   124     throw MapFileErrorException();
   125   }
   125   }
   126 }
   126 }
   127 
   127