diff options
-rw-r--r-- | seriestreewidget.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/seriestreewidget.cpp b/seriestreewidget.cpp index 49d5792..eb8c587 100644 --- a/seriestreewidget.cpp +++ b/seriestreewidget.cpp @@ -481,6 +481,9 @@ SeriesTreeSortModel::SeriesTreeSortModel(QObject *parent) : QSortFilterProxyMode bool SeriesTreeSortModel::lessThan(const QModelIndex &left, const QModelIndex &right) const{ if(left.data(SeriesTreeModel::TypeRole).toInt() == SeriesTreeModel::Part && right.data(SeriesTreeModel::TypeRole).toInt() == SeriesTreeModel::Part){ + if(left.data(SeriesTreeModel::SubtitleRole).isValid()){ + return left.data(SeriesTreeModel::SubtitleRole).toString() < right.data(SeriesTreeModel::SubtitleRole).toString(); + } return left.data(SeriesTreeModel::SeriesPartRole).toInt() < right.data(SeriesTreeModel::SeriesPartRole).toInt(); } return QSortFilterProxyModel::lessThan(left, right); @@ -489,12 +492,7 @@ bool SeriesTreeSortModel::lessThan(const QModelIndex &left, const QModelIndex &r bool SeriesTreeSortModel::filterAcceptsRow(int source_row, const QModelIndex &source_parent) const { SeriesTreeModel *seriesModel = static_cast<SeriesTreeModel*>(sourceModel()); int rowFilter = seriesModel->rowFilter(); - /*QModelIndex parent = source_parent; - if(!parent.isValid()){ - parent = seriesModel->rootIndex(); - }*/ QModelIndex curIdx = sourceModel()->index(source_row, 0, source_parent); - //QModelIndex curIdx = source_parent; QString name = curIdx.data(SeriesTreeModel::NameRole).toString(); QRegExp filterRe = filterRegExp(); if(rowFilter == SeriesTreeModel::All){ |