diff options
Diffstat (limited to 'src/modlistsortproxy.cpp')
| -rw-r--r-- | src/modlistsortproxy.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/modlistsortproxy.cpp b/src/modlistsortproxy.cpp index bf70f238..a5f2ee82 100644 --- a/src/modlistsortproxy.cpp +++ b/src/modlistsortproxy.cpp @@ -119,8 +119,8 @@ void ModListSortProxy::disableAllVisible() bool ModListSortProxy::lessThan(const QModelIndex &left, const QModelIndex &right) const { - int leftIndex = left.internalId(); - int rightIndex = right.internalId(); + int leftIndex = left.row(); + int rightIndex = right.row(); ModInfo::Ptr leftMod = ModInfo::getByIndex(leftIndex); ModInfo::Ptr rightMod = ModInfo::getByIndex(rightIndex); @@ -196,9 +196,17 @@ bool ModListSortProxy::filterMatches(ModInfo::Ptr info, bool enabled) const ((m_CategoryFilter == CategoryFactory::CATEGORY_SPECIAL_UNCHECKED) && !enabled) || ((m_CategoryFilter == CategoryFactory::CATEGORY_SPECIAL_UPDATEAVAILABLE) && info->updateAvailable()) || ((m_CategoryFilter == CategoryFactory::CATEGORY_SPECIAL_NOCATEGORY) && (info->getCategories().size() == 0)) || - ((m_CategoryFilter == CategoryFactory::CATEGORY_SPECIAL_CONFLICT) && (hasConflictFlag(info->getFlags())))); + ((m_CategoryFilter == CategoryFactory::CATEGORY_SPECIAL_CONFLICT) && (hasConflictFlag(info->getFlags())))); } +/*QModelIndex ModListSortProxy::mapToSource(const QModelIndex &proxyIndex) const +{ +if (proxyIndex.model() && (proxyIndex.model() != this)) { + qDebug("%p - %p - %p - %d - %d - %d", proxyIndex.model(), this, this->sourceModel(), proxyIndex.row(), proxyIndex.column(), proxyIndex.parent().isValid()); +} + return QSortFilterProxyModel::mapToSource(proxyIndex); +}*/ + bool ModListSortProxy::filterAcceptsRow(int row, const QModelIndex&) const { |
