[SCM] ktp-common-internals packaging branch, master, updated. debian/15.12.1-2-1839-gf0635e9
Maximiliano Curia
maxy at moszumanska.debian.org
Mon May 9 09:08:28 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-common-internals.git;a=commitdiff;h=46167a4
The following commit has been merged in the master branch:
commit 46167a4970ea69c3f1b48c0fb3ce48a3ed2dd4f1
Author: David Edmundson <kde at davidedmundson.co.uk>
Date: Tue Oct 21 16:54:27 2014 +0200
Remove horrendous hack needed to keep lists sorted in Qt <5.2
Remove workaround for https://bugreports.qt-
project.org/browse/QTBUG-30662. This is now merged
---
KTp/Models/contacts-filter-model.cpp | 37 +-----------------------------------
KTp/Models/contacts-filter-model.h | 2 --
2 files changed, 1 insertion(+), 38 deletions(-)
diff --git a/KTp/Models/contacts-filter-model.cpp b/KTp/Models/contacts-filter-model.cpp
index ee083e3..f5e6973 100644
--- a/KTp/Models/contacts-filter-model.cpp
+++ b/KTp/Models/contacts-filter-model.cpp
@@ -43,8 +43,7 @@ public:
nicknameFilterMatchFlags(Qt::MatchContains),
aliasFilterMatchFlags(Qt::MatchContains),
groupsFilterMatchFlags(Qt::MatchContains),
- idFilterMatchFlags(Qt::MatchContains),
- m_qtSortHack(false)
+ idFilterMatchFlags(Qt::MatchContains)
{
}
@@ -76,8 +75,6 @@ public:
void sourceModelParentIndexChanged(const QModelIndex &sourceIndex);
void sourceModelIndexChanged(const QModelIndex &sourceIndex);
-
- bool m_qtSortHack;
};
using namespace KTp;
@@ -767,41 +764,9 @@ bool ContactsFilterModel::filterAcceptsRow(int sourceRow, const QModelIndex &sou
rc = true;
}
- //START HORRENDOUS HACK
- //remove in 5.2.1 +
-
- //This is a horrendous hack around https://bugreports.qt-project.org/browse/QTBUG-30662
- //if sort is enabled and nothing passes the filter
- //the proxy model is unable to map the proxy column to the source model if all items are filtered
- //this patch causes it to call sort after the first items is added
-
- //calling sort whilst we are currently filtering seems unsafe, so we do this on a delay
- //we need to const cast to emit a signal, but that should be safe
- if (!d->m_qtSortHack && rc && !sourceParent.isValid()) {
- KTp::ContactsFilterModel *nonConstThis = const_cast<KTp::ContactsFilterModel*>(this);
- QTimer::singleShot(0, nonConstThis, SLOT(delayedSortFix()));
- d->m_qtSortHack = true;
- }
- //END HORRENDOUS HACK
-
-
return rc;
}
-//START HORRENDOUS HACK
-//remove in 5.2.1 +
-void ContactsFilterModel::delayedSortFix()
-{
- //we need to sort twice
- //calling sort(0) will do nothing as the QSortFilterProxyModel::proxy_sort_column is already 0
- //we need to change it to update the QSortFilterProxyModel::source_sort_column
- sort(-1);
- sort(0);
-}
-//END HORRENDOUS HACK
-
-
-
bool ContactsFilterModel::lessThan(const QModelIndex &left, const QModelIndex &right) const
{
diff --git a/KTp/Models/contacts-filter-model.h b/KTp/Models/contacts-filter-model.h
index fff2d5d..b95c93d 100644
--- a/KTp/Models/contacts-filter-model.h
+++ b/KTp/Models/contacts-filter-model.h
@@ -291,8 +291,6 @@ public:
QString sortRoleString() const;
Q_SLOT void setSortRoleString(const QString &role);
- Q_SLOT void delayedSortFix();
-
protected:
bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const;
bool lessThan (const QModelIndex &left, const QModelIndex &right) const;
--
ktp-common-internals packaging
More information about the pkg-kde-commits
mailing list