summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Merry <kde@randomguy3.me.uk>2011-04-11 21:09:47 (GMT)
committerAlex Merry <kde@randomguy3.me.uk>2011-04-11 21:14:20 (GMT)
commita70973b91b6dd2b14462a114ce2c0b520e41b3af (patch)
tree954be355210e0711da0e712384c81ec7f4436339
parentaf8b03c2267b7b940be7f0b6bbd5191c8402717f (diff)
Maintain sort order when new articles are added
Backport of e95e0f8e3687137f02e19d3ecf5ea0a9463f5962 In Qt 4.7, QSortFilterProxyModels no longer maintain their sort order unless explicitly told to. This meant that new articles would always end up at the bottom of the list being displayed, even if the list was sorted newest-first. Incidentally, I could have sworn I tried this fix already and it didn't work. CCBUG: 247473 FIXED-IN: 4.4.11
-rw-r--r--akregator/src/articlelistview.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/akregator/src/articlelistview.cpp b/akregator/src/articlelistview.cpp
index cccc6fa..38a3e6e 100644
--- a/akregator/src/articlelistview.cpp
+++ b/akregator/src/articlelistview.cpp
@@ -156,9 +156,11 @@ void ArticleListView::setArticleModel( ArticleModel* model )
m_proxy->setSourceModel( model );
m_proxy->setSortRole( ArticleModel::SortRole );
m_proxy->setFilters( m_matchers );
+ m_proxy->setDynamicSortFilter( true );
FilterDeletedProxyModel* const proxy2 = new FilterDeletedProxyModel( model );
proxy2->setSortRole( ArticleModel::SortRole );
proxy2->setSourceModel( m_proxy );
+ proxy2->setDynamicSortFilter( true );
FilterColumnsProxyModel* const columnsProxy = new FilterColumnsProxyModel( model );
columnsProxy->setSortRole( ArticleModel::SortRole );
@@ -167,6 +169,7 @@ void ArticleListView::setArticleModel( ArticleModel* model )
columnsProxy->setColumnEnabled( ArticleModel::FeedTitleColumn );
columnsProxy->setColumnEnabled( ArticleModel::DateColumn );
columnsProxy->setColumnEnabled( ArticleModel::AuthorColumn );
+ columnsProxy->setDynamicSortFilter( true );
setModel( columnsProxy );
header()->setContextMenuPolicy( Qt::CustomContextMenu );