QTfrontend/model/GameStyleModel.cpp
changeset 8466 29b891dbf2a0
parent 8419 d99f46b676b5
child 9080 9b42757d7e71
equal deleted inserted replaced
8464:c708b4f5cffc 8466:29b891dbf2a0
    23 
    23 
    24 #include <QTextStream>
    24 #include <QTextStream>
    25 
    25 
    26 #include "physfs.h"
    26 #include "physfs.h"
    27 #include "GameStyleModel.h"
    27 #include "GameStyleModel.h"
       
    28 #include "hwconsts.h"
    28 
    29 
    29 
    30 
    30 void GameStyleModel::loadGameStyles()
    31 void GameStyleModel::loadGameStyles()
    31 {
    32 {
    32     const QString appDir = QString(PHYSFS_getBaseDir());
       
    33 
       
    34     beginResetModel();
    33     beginResetModel();
    35 
    34 
    36     // empty list, so that we can (re)fill it
    35     // empty list, so that we can (re)fill it
    37     QStandardItemModel::clear();
    36     QStandardItemModel::clear();
    38 
    37 
    79                 weapons.replace("_", " ");
    78                 weapons.replace("_", " ");
    80         }
    79         }
    81 
    80 
    82         // detect if script is dlc
    81         // detect if script is dlc
    83         QString scriptPath = PHYSFS_getRealDir(QString("Scripts/Multiplayer/%1.lua").arg(script).toLocal8Bit().data());
    82         QString scriptPath = PHYSFS_getRealDir(QString("Scripts/Multiplayer/%1.lua").arg(script).toLocal8Bit().data());
    84         bool isDLC = !scriptPath.startsWith(appDir);
    83         bool isDLC = !scriptPath.startsWith(datadir->absolutePath());
    85 
    84 
    86         QStandardItem * item = new QStandardItem((isDLC ? "*" : "") + name);
    85         QStandardItem * item = new QStandardItem((isDLC ? "*" : "") + name);
    87 
    86 
    88         item->setData(script, ScriptRole);
    87         item->setData(script, ScriptRole);
    89         item->setData(scheme, SchemeRole);
    88         item->setData(scheme, SchemeRole);