Commit 38d27d1b authored by Rafael Fernández López's avatar Rafael Fernández López
Browse files

Update the view when the sorting role changes.

svn path=/trunk/KDE/kdebase/apps/; revision=677356
parent c5c3256e
...@@ -34,6 +34,8 @@ void KSortFilterProxyModel::sort(int column, Qt::SortOrder order) ...@@ -34,6 +34,8 @@ void KSortFilterProxyModel::sort(int column, Qt::SortOrder order)
QSortFilterProxyModel::sort(column, order); QSortFilterProxyModel::sort(column, order);
m_sortOrder = order; m_sortOrder = order;
emit sortingRoleChanged();
} }
Qt::SortOrder KSortFilterProxyModel::sortOrder() const Qt::SortOrder KSortFilterProxyModel::sortOrder() const
...@@ -46,3 +48,5 @@ bool KSortFilterProxyModel::lessThanCategoryPurpose(const QModelIndex &left, ...@@ -46,3 +48,5 @@ bool KSortFilterProxyModel::lessThanCategoryPurpose(const QModelIndex &left,
{ {
return lessThan(left, right); return lessThan(left, right);
} }
#include "ksortfilterproxymodel.moc"
...@@ -28,6 +28,8 @@ ...@@ -28,6 +28,8 @@
class LIBDOLPHINPRIVATE_EXPORT KSortFilterProxyModel class LIBDOLPHINPRIVATE_EXPORT KSortFilterProxyModel
: public QSortFilterProxyModel : public QSortFilterProxyModel
{ {
Q_OBJECT
public: public:
KSortFilterProxyModel(QObject *parent = 0); KSortFilterProxyModel(QObject *parent = 0);
~KSortFilterProxyModel(); ~KSortFilterProxyModel();
...@@ -42,6 +44,9 @@ public: ...@@ -42,6 +44,9 @@ public:
virtual bool lessThanCategoryPurpose(const QModelIndex &left, virtual bool lessThanCategoryPurpose(const QModelIndex &left,
const QModelIndex &right) const; const QModelIndex &right) const;
Q_SIGNALS:
void sortingRoleChanged();
private: private:
Qt::SortOrder m_sortOrder; Qt::SortOrder m_sortOrder;
}; };
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment