Bug 121999 - Combined View -> All Feeds -> Next Unread Article -> Crash
Summary: Combined View -> All Feeds -> Next Unread Article -> Crash
Status: RESOLVED FIXED
Alias: None
Product: akregator
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR crash
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-02-15 04:38 UTC by Christiaan Hees
Modified: 2006-02-15 08:55 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christiaan Hees 2006-02-15 04:38:36 UTC
Version:           1.1.3 (using KDE 3.5.1, Debian Package 4:3.5.1-2 (testing/unstable))
Compiler:          Target: i486-linux-gnu
OS:                Linux (i686) release 2.6.13.2

If you click Combined View, then select All Feeds in the Feeds list on the left and then hit the '+' key (Next Unread Article) Akregator crashes. I tried it multiple times and it always happens...it's reproducable.
Comment 1 Frank Osterfeld 2006-02-15 08:55:04 UTC
SVN commit 509576 by osterfeld:

Fix crash in View::slotNext/PrevUnreadArticle()
Combined View: do slotNext/PrevUnreadFeed() in slotNext/PrevUnreadArticle(),
as selecting the next article does not make much sense... (at least not now)

BUG: 121999


 M  +6 -0      akregator_view.cpp  
 M  +23 -13    articlelistview.cpp  


--- branches/KDE/3.5/kdepim/akregator/src/akregator_view.cpp #509575:509576
@@ -990,6 +990,9 @@
 
 void View::slotNextUnreadArticle()
 {
+    if (m_viewMode == CombinedView)
+        m_listTabWidget->activeView()->slotNextUnreadFeed();
+    
     TreeNode* sel = m_listTabWidget->activeView()->selectedNode();
     if (sel && sel->unread() > 0)
         m_articleList->slotNextUnreadArticle();
@@ -999,6 +1002,9 @@
 
 void View::slotPrevUnreadArticle()
 {
+    if (m_viewMode == CombinedView)
+        m_listTabWidget->activeView()->slotPrevUnreadFeed();
+    
     TreeNode* sel = m_listTabWidget->activeView()->selectedNode();
     if (sel && sel->unread() > 0)
         m_articleList->slotPreviousUnreadArticle();
--- branches/KDE/3.5/kdepim/akregator/src/articlelistview.cpp #509575:509576
@@ -608,21 +608,26 @@
 
 void ArticleListView::slotNextUnreadArticle()
 {
-    ArticleItem* start = 0;
+    ArticleItem* start = 0L;
     if (!currentItem() || selectedItems().isEmpty())
         start = dynamic_cast<ArticleItem*>(firstChild());
     else
         start = dynamic_cast<ArticleItem*>(currentItem()->itemBelow() ? currentItem()->itemBelow() : firstChild());
 
     ArticleItem* i = start;
-    ArticleItem* unread = 0;
+    ArticleItem* unread = 0L;
     
     do
     {
-        if (i && i->article().status() != Article::Read)
-            unread = i;
-        else 
-            i = dynamic_cast<ArticleItem*>(i && i->itemBelow() ? i->itemBelow() : firstChild());
+        if (i == 0L)
+            i = static_cast<ArticleItem*>(lastChild());
+        else
+        {
+            if (i->article().status() != Article::Read)
+                unread = i;
+            else 
+                i = static_cast<ArticleItem*>(i && i->itemBelow() ? i->itemBelow() : firstChild());
+        }
     }
     while (!unread && i != start);
 
@@ -638,23 +643,28 @@
 
 void ArticleListView::slotPreviousUnreadArticle()
 {
-    ArticleItem* start = 0;
+    ArticleItem* start = 0L;
     if (!currentItem() || selectedItems().isEmpty())
         start = dynamic_cast<ArticleItem*>(firstChild());
     else
         start = dynamic_cast<ArticleItem*>(currentItem()->itemAbove() ? currentItem()->itemAbove() : firstChild());
 
     ArticleItem* i = start;
-    ArticleItem* unread = 0;
+    ArticleItem* unread = 0L;
     
     do
     {
-        if (i && i->article().status() != Article::Read)
-            unread = i;
-        else 
-            i = dynamic_cast<ArticleItem*>(i->itemAbove() ? i->itemAbove() : lastChild());
+        if (i == 0L)
+            i = static_cast<ArticleItem*>(lastChild());
+        else
+        {
+            if (i->article().status() != Article::Read)
+                unread = i;
+            else 
+                i = static_cast<ArticleItem*>(i->itemAbove() ? i->itemAbove() : lastChild());
+        }
     }
-    while ( !(unread != 0 || i == start) );
+    while ( !(unread != 0L || i == start) );
 
     if (unread)
     {