Bug 103502 - I mark feed to read all, but feed gets unread items from time to time
Summary: I mark feed to read all, but feed gets unread items from time to time
Status: RESOLVED FIXED
Alias: None
Product: akregator
Classification: Applications
Component: general (show other bugs)
Version: 1.0
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-04-08 17:47 UTC by icefox
Modified: 2005-07-22 11:51 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 icefox 2005-04-08 17:47:31 UTC
Version:           1.0 (using KDE 3.4.0, Debian Package 4:3.4.0-0pre2 (3.1))
Compiler:          gcc version 3.3.5 (Debian 1:3.3.5-8)
OS:                Linux (i686) release 2.6.8-1-686

http://cia.navi.cx/stats/project/kde/.rss with mark articles as read immediatly
Comment 1 Eckhart Wörner 2005-04-08 19:13:47 UTC
I can confirm this for Akregator 1.0.

Changed articles (other hashes but same <guid />s) are always marked as new, without respecting the "mark articles as read immediately" settings.
Comment 2 Frank Osterfeld 2005-04-09 10:43:51 UTC
CVS commit by osterfeld: 

fix some problems with deleted articles and unread. 
And don't mark changed articles as new when "mark articles read immediately" is used.

BUG: 103502


  M +7 -0      akregator_view.cpp   1.235
  M +13 -11    feed.cpp   1.90
  M +5 -2      myarticle.cpp   1.38
  M +3 -1      mk4storage/storagemk4impl.cpp   1.4


--- kdepim/akregator/src/akregator_view.cpp  #1.234:1.235
@@ -839,4 +839,11 @@ void View::slotMoveCurrentNodeRight()
 void View::slotNodeSelected(TreeNode* node)
 {
+    if (node)
+    {
+        kdDebug() << "node selected: " << node->title() << endl;
+        kdDebug() << "unread: " << node->unread() << endl;
+        kdDebug() << "total: " << node->totalCount() << endl;
+    }
+    
     if (m_displayingAboutPage)
     {

--- kdepim/akregator/src/feed.cpp  #1.89:1.90
@@ -272,12 +272,13 @@ void Feed::appendArticles(const Document
         if ( old == m_articles.end() ) // article not in list
         {
-            if (!markImmediatelyAsRead())
+            mya.offsetFetchTime(nudge);
+            nudge--;
+            appendArticle(mya);
+            
+            if (!mya.isDeleted() && !markImmediatelyAsRead())
                 mya.setStatus(MyArticle::New);
             else
                 mya.setStatus(MyArticle::Read);
 
-            mya.offsetFetchTime(nudge);
-            nudge--;
-            appendArticle(mya);
             changed = true;
         }
@@ -286,8 +287,9 @@ void Feed::appendArticles(const Document
         {
             mya.setKeep((*old).keep());
+            appendArticle(mya);
             // reset status to New
+            if (!mya.isDeleted() && !markImmediatelyAsRead())
             mya.setStatus(MyArticle::New);
             m_articles.remove(old);
-            appendArticle(mya);
             changed = true;
         }
@@ -339,10 +341,10 @@ void Feed::appendArticle(const MyArticle
     if ( a.keep() || ( !usesExpiryByAge() || !isExpired(a) ) ) // if not expired
     {
-        if (!a.isDeleted() && a.status() != MyArticle::Read)
+        if (!m_articles.contains(a))
         {
+            m_articles.append(a);
+            if (!a.isDeleted() && a.status() != MyArticle::Read)
             setUnread(unread()+1);
         }
-        if (!m_articles.contains(a))
-            m_articles.append(a);
     }
 }

--- kdepim/akregator/src/myarticle.cpp  #1.37:1.38
@@ -96,5 +96,5 @@ void MyArticle::initialize(RSS::Article 
         if (article.meta("deleted") == "true") 
         { // if article is in deleted state, we just add the status and omit the rest
-            d->status = Private::Deleted;
+            d->status = Private::Read | Private::Deleted;
             d->archive->setStatus(d->guid, d->status);
         }
@@ -151,4 +152,6 @@ MyArticle::MyArticle(RSS::Article articl
 void MyArticle::setDeleted()
 {
+    if (isDeleted())
+        return;
     setStatus(Read);
     d->status = Private::Deleted | Private::Read;
@@ -228,5 +231,5 @@ int MyArticle::status() const
 void MyArticle::setStatus(int stat)
 {
-    if (d->feed)
+    if (d->feed && !isDeleted())
     {
         if (stat == Read && status() != Read)

--- kdepim/akregator/src/mk4storage/storagemk4impl.cpp  #1.3:1.4
@@ -215,4 +215,6 @@ FeedStorage* StorageMK4Impl::archiveFor(
         {
             d->punread(findrow) = 0;
+            d->ptotalCount(findrow) = 0;
+            d->plastFetch(findrow) = 0;
             d->m_archiveView.Add(findrow);
             d->modified = true;
Comment 3 Frank Osterfeld 2005-04-09 10:54:56 UTC
CVS commit by osterfeld: 

backport of #103502 fix: respect markImmediatelyAsRead setting when updating modified articles (don't set them to 
New)
CCBUG: 103502


  M +10 -6     feed.cpp   1.84.2.2


--- kdepim/akregator/src/feed.cpp  #1.84.2.1:1.84.2.2
@@ -310,11 +310,15 @@ void Feed::appendArticles(const Document
             }
             // if the article's guid is no hash but an ID, we have to check if the article was updated. That's done by comparing the hash values.
-            else if (!mya.guidIsHash() && mya.hash() != (*old).hash() && !mya.isDeleted())
+            else if (!mya.guidIsHash() && mya.hash() != (*old).hash() && !(*old).isDeleted())
             {
                     mya.setKeep((*old).keep());
                     // reset status to New
+                if (!markImmediatelyAsRead())
+                {
                     mya.setStatus(MyArticle::New);
                     if ((*old).status() != MyArticle::Read)
                         m_unread--;
+                }
+
                     m_articles.remove(old);
                     appendArticle(mya);
Comment 4 F Reifenstahl 2005-07-22 11:51:21 UTC
Resolved? I'm running 1.1.1, and some of my feeds (e.g. golem.de) which are set to "immediately mark as read don't work that way