QTfrontend/model/ThemeModel.cpp
changeset 11753 5c192a4751d8
parent 11046 47a8c19ecb60
child 11754 2e4f0d0fec99
equal deleted inserted replaced
11752:3c66845947a8 11753:5c192a4751d8
    29     QAbstractListModel(parent)
    29     QAbstractListModel(parent)
    30 {
    30 {
    31     m_data = QList<QMap<int, QVariant> >();
    31     m_data = QList<QMap<int, QVariant> >();
    32 
    32 
    33     m_themesLoaded = false;
    33     m_themesLoaded = false;
       
    34 
       
    35     m_filteredNoDLC = NULL;
       
    36 }
       
    37 
       
    38 QSortFilterProxyModel * ThemeModel::withoutDLC()
       
    39 {
       
    40     if (m_filteredNoDLC == NULL)
       
    41     {
       
    42         m_filteredNoDLC = new QSortFilterProxyModel(this);
       
    43         m_filteredNoDLC->setSourceModel(this);
       
    44         // filtering based on IsDlcRole would be nicer
       
    45         // but seems this model can only do string-based filtering :|
       
    46         m_filteredNoDLC->setFilterRegExp(QRegExp("^[^*]"));
       
    47     }
       
    48     return m_filteredNoDLC;
    34 }
    49 }
    35 
    50 
    36 int ThemeModel::rowCount(const QModelIndex &parent) const
    51 int ThemeModel::rowCount(const QModelIndex &parent) const
    37 {
    52 {
    38     if(parent.isValid())
    53     if(parent.isValid())