QTfrontend/model/ThemeModel.cpp
changeset 13252 5200231eb120
parent 13249 d2b58cf339fe
child 13267 48b23e6f26d9
equal deleted inserted replaced
13251:edb2f654f8f6 13252:5200231eb120
   143 
   143 
   144         // set displayed name
   144         // set displayed name
   145         dataset.insert(Qt::DisplayRole, (isDLC ? "*" : "") + theme);
   145         dataset.insert(Qt::DisplayRole, (isDLC ? "*" : "") + theme);
   146 
   146 
   147         // load and set preview icon
   147         // load and set preview icon
   148         QIcon preview(QString("physfs://Themes/%1/icon@2x.png").arg(theme));
   148         iconpath = QString("physfs://Themes/%1/icon@2x.png").arg(theme);
   149         dataset.insert(Qt::DecorationRole, preview);
   149         if (QFile::exists(iconpath))
       
   150         {
       
   151             QIcon preview(QString("physfs://Themes/%1/icon@2x.png").arg(theme));
       
   152             dataset.insert(Qt::DecorationRole, preview);
       
   153         }
   150 
   154 
   151         m_data.append(dataset);
   155         m_data.append(dataset);
   152     }
   156     }
   153 }
   157 }