summaryrefslogtreecommitdiff
path: root/src/modlistsortproxy.cpp
diff options
context:
space:
mode:
authorTannin <devnull@localhost>2013-03-22 18:46:40 +0100
committerTannin <devnull@localhost>2013-03-22 18:46:40 +0100
commit0a19f0433992be5f9791c8869380d09cd06b66b8 (patch)
tree12399954f7c1156ed1cacb24dac3a8574a513e7f /src/modlistsortproxy.cpp
parent8b4e11060b37ad70754aa665ad59744eadd2dd1e (diff)
- support for grouping filters for mod list (incomplete)
- offering multiple options for mod names during installation - support for renaming profiles - updated installer plugins - minor bugfixes
Diffstat (limited to 'src/modlistsortproxy.cpp')
-rw-r--r--src/modlistsortproxy.cpp14
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
{