QTfrontend/model/ThemeModel.cpp
changeset 11754 2e4f0d0fec99
parent 11753 5c192a4751d8
child 11757 6874644a2d00
equal deleted inserted replaced
11753:5c192a4751d8 11754:2e4f0d0fec99
    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;
       
    49 }
    34 }
    50 
    35 
    51 int ThemeModel::rowCount(const QModelIndex &parent) const
    36 int ThemeModel::rowCount(const QModelIndex &parent) const
    52 {
    37 {
    53     if(parent.isValid())
    38     if(parent.isValid())