QTfrontend/model/ThemeModel.cpp
branchphysfslayer
changeset 8049 133e22b5c410
parent 7955 85b3970b402a
child 8377 869f80966a77
equal deleted inserted replaced
8046:4d3415927d2c 8049:133e22b5c410
    64 #endif
    64 #endif
    65 
    65 
    66     foreach (QString theme, themes)
    66     foreach (QString theme, themes)
    67     {
    67     {
    68         // themes without icon are supposed to be hidden
    68         // themes without icon are supposed to be hidden
    69         QString iconpath =
    69         QString iconpath = QString("physfs://Themes/%1/icon.png").arg(theme);
    70             datamgr.findFileForRead(QString("Themes/%1/icon.png").arg(theme));
       
    71 
    70 
    72         if (!QFile::exists(iconpath))
    71         if (!QFile::exists(iconpath))
    73             continue;
    72             continue;
    74 
    73 
    75         QMap<int, QVariant> dataset;
    74         QMap<int, QVariant> dataset;
    81         QIcon icon(iconpath);
    80         QIcon icon(iconpath);
    82 
    81 
    83         dataset.insert(Qt::DecorationRole, icon);
    82         dataset.insert(Qt::DecorationRole, icon);
    84 
    83 
    85         // load and set preview icon
    84         // load and set preview icon
    86         QIcon preview(datamgr.findFileForRead(QString("Themes/%1/icon@2x.png").arg(theme)));
    85         QIcon preview(QString("physfs://Themes/%1/icon@2x.png").arg(theme));
    87         dataset.insert(Qt::UserRole, preview);
    86         dataset.insert(Qt::UserRole, preview);
    88 
    87 
    89         m_data.append(dataset);
    88         m_data.append(dataset);
    90     }
    89     }
    91 
    90