QTfrontend/model/MapModel.cpp
changeset 12690 ad1fd7ae479d
parent 11907 38d27c1645eb
child 12691 d5e09024d722
equal deleted inserted replaced
12689:5f68b259305c 12690:ad1fd7ae479d
    78 
    78 
    79     //QList<QStandardItem *> staticMaps;
    79     //QList<QStandardItem *> staticMaps;
    80     //QList<QStandardItem *> missionMaps;
    80     //QList<QStandardItem *> missionMaps;
    81     QList<QStandardItem *> mapList;
    81     QList<QStandardItem *> mapList;
    82 
    82 
       
    83 
       
    84     QIcon dlcIcon;
       
    85     dlcIcon.addFile(":/res/dlcMarker.png", QSize(), QIcon::Normal, QIcon::On);
       
    86     QPixmap emptySpace = QPixmap(7, 15);
       
    87     emptySpace.fill(QColor(0, 0, 0, 0));
       
    88     QIcon notDlcIcon = QIcon(emptySpace);
       
    89 
    83     // add mission/static maps to lists
    90     // add mission/static maps to lists
    84     foreach (QString map, maps)
    91     foreach (QString map, maps)
    85     {
    92     {
    86         // only 2 map relate files are relevant:
    93         // only 2 map relate files are relevant:
    87         // - the cfg file that contains the settings/info of the map
    94         // - the cfg file that contains the settings/info of the map
   161             }
   168             }
   162 
   169 
   163             // caption
   170             // caption
   164             caption = map;
   171             caption = map;
   165 
   172 
       
   173             QIcon icon;
       
   174             if (dlc)
       
   175                 icon = dlcIcon;
       
   176             else
       
   177                 icon = notDlcIcon;
       
   178 
   166             // we know everything there is about the map, let's get am item for it
   179             // we know everything there is about the map, let's get am item for it
   167             QStandardItem * item = MapModel::infoToItem(
   180             QStandardItem * item = MapModel::infoToItem(
   168                 QIcon(), caption, type, map, theme, limit, scheme, weapons, desc, dlc);
   181                 icon, caption, type, map, theme, limit, scheme, weapons, desc, dlc);
   169 
   182 
   170             // append item to the list
   183             // append item to the list
   171             mapList.append(item);
   184             mapList.append(item);
   172         }
   185         }
   173 
   186 
   223     QString scheme,
   236     QString scheme,
   224     QString weapons,
   237     QString weapons,
   225     QString desc,
   238     QString desc,
   226     bool dlc)
   239     bool dlc)
   227 {
   240 {
   228     QStandardItem * item = new QStandardItem(icon, (dlc ? "*" : "") + caption);
   241     QStandardItem * item = new QStandardItem(icon, caption);
   229     MapInfo mapInfo;
   242     MapInfo mapInfo;
   230     QVariant qvar(QVariant::UserType);
   243     QVariant qvar(QVariant::UserType);
   231 
   244 
   232     mapInfo.type = type;
   245     mapInfo.type = type;
   233     mapInfo.name = name;
   246     mapInfo.name = name;