[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    branches/KDE/4.1/kdepim/akregator/src
From:       Frank Osterfeld <frank.osterfeld () kdemail ! net>
Date:       2008-11-30 22:48:41
Message-ID: 1228085321.756586.32116.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 891012 by osterfeld:

improve prev/next unread article behavior when a filter is set
Not exactly 138935 (which is fixed since 4.1) but similar
BUG:138935


 M  +12 -4     articlelistview.cpp  
 M  +4 -3      articlelistview.h  
 M  +3 -8      mainwidget.cpp  


--- branches/KDE/4.1/kdepim/akregator/src/articlelistview.cpp #891011:891012
@@ -437,12 +437,15 @@
     selectIndex( newIdx );
 }
 
-void ArticleListView::slotNextUnreadArticle()
+bool ArticleListView::selectNextUnreadArticle()
 {
     if (!model())
-        return;
+        return false;
 
     const int rowCount = model()->rowCount();
+    if ( rowCount == 0 )
+        return false;
+
     const int startRow = qMin( rowCount - 1, ( currentIndex().isValid() ? \
currentIndex().row() + 1 : 0 ) );  
     int i = startRow;
@@ -461,6 +464,7 @@
     {
         selectIndex( model()->index( i, 0 ) );
     }
+    return foundUnread;
 }
 
 void ArticleListView::selectIndex( const QModelIndex& idx )
@@ -476,12 +480,15 @@
     }
 }
 
-void ArticleListView::slotPreviousUnreadArticle()
+bool ArticleListView::selectPreviousUnreadArticle()
 {
     if ( !model() )
-        return;
+        return false;
 
     const int rowCount = model()->rowCount();
+    if ( rowCount == 0 )
+        return false;
+
     const int startRow = qMax( 0, ( currentIndex().isValid() ? currentIndex().row() \
: rowCount ) - 1 );  
     int i = startRow;
@@ -500,6 +507,7 @@
     {
         selectIndex( model()->index( i, 0 ) );
     }
+    return foundUnread;
 }
 
 
--- branches/KDE/4.1/kdepim/akregator/src/articlelistview.h #891011:891012
@@ -121,6 +121,10 @@
 
     void saveHeaderSettings();
 
+    bool selectPreviousUnreadArticle();
+
+    bool selectNextUnreadArticle();
+
 protected:
     void mousePressEvent( QMouseEvent *ev );
 
@@ -135,10 +139,7 @@
 
     void slotNextArticle();
 
-    void slotPreviousUnreadArticle();
 
-    void slotNextUnreadArticle();
-
 private:
     void loadHeaderSettings();
 
--- branches/KDE/4.1/kdepim/akregator/src/mainwidget.cpp #891011:891012
@@ -756,10 +756,8 @@
         m_feedListView->slotNextUnreadFeed();
         return;
     }
-    TreeNode* sel = m_selectionController->selectedSubscription();
-    if (sel && sel->unread() > 0)
-        m_articleListView->slotNextUnreadArticle();
-    else
+
+    if (!m_articleListView->selectNextUnreadArticle())
         m_feedListView->slotNextUnreadFeed();
 }
 
@@ -770,10 +768,7 @@
         m_feedListView->slotPrevUnreadFeed();
         return;
     }
-    TreeNode* sel = m_selectionController->selectedSubscription();
-    if (sel && sel->unread() > 0)
-        m_articleListView->slotPreviousUnreadArticle();
-    else
+    if (!m_articleListView->selectPreviousUnreadArticle())
         m_feedListView->slotPrevUnreadFeed();
 }
 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic