QTfrontend/model/MapModel.cpp
changeset 11901 291d53985dcd
parent 11900 d71448338ac2
child 11902 38d27c1645eb
equal deleted inserted replaced
11900:d71448338ac2 11901:291d53985dcd
   126                     locale = QLocale::system().name();
   126                     locale = QLocale::system().name();
   127 
   127 
   128                 QSettings descSettings(QString("physfs://Maps/%1/desc.txt").arg(map), QSettings::IniFormat);
   128                 QSettings descSettings(QString("physfs://Maps/%1/desc.txt").arg(map), QSettings::IniFormat);
   129                 descSettings.setIniCodec("UTF-8");
   129                 descSettings.setIniCodec("UTF-8");
   130                 desc = descSettings.value(locale, QString()).toString().replace("|", "\n").replace("\\,", ",");
   130                 desc = descSettings.value(locale, QString()).toString().replace("|", "\n").replace("\\,", ",");
       
   131                 // If not found, try with lanague-only code
       
   132                 if (desc.isEmpty())
       
   133                 {
       
   134                     QString localeSimple = locale.remove(QRegExp("_.*$"));
       
   135                     desc = descSettings.value(localeSimple, QString()).toString().replace("|", "\n").replace("\\,", ",");
       
   136                 }
   131             }
   137             }
   132 
   138 
   133             // detect if map is dlc
   139             // detect if map is dlc
   134             QString mapDir = PHYSFS_getRealDir(QString("Maps/%1/map.cfg").arg(map).toLocal8Bit().data());
   140             QString mapDir = PHYSFS_getRealDir(QString("Maps/%1/map.cfg").arg(map).toLocal8Bit().data());
   135             dlc = !mapDir.startsWith(datadir->absolutePath());
   141             dlc = !mapDir.startsWith(datadir->absolutePath());