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:09:47 (GMT)
commite95e0f8e3687137f02e19d3ecf5ea0a9463f5962 (patch)
tree41c2e3b7ff7687f71f94902932d866c66b87bd8b
parent33819e91c742e36adac688b96b268188393b6b2d (diff)
Maintain sort order when new articles are added
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. BUG: 247473 FIXED-IN: 4.6.0
-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 bf2219d..c558390 100644
--- a/akregator/src/articlelistview.cpp
+++ b/akregator/src/articlelistview.cpp
@@ -158,9 +158,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 );
@@ -169,6 +171,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 );