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

List:       kde-pim
Subject:    [Kde-pim] akregator: disable archive
From:       "Gerd v. Egidy" <lists () egidy ! de>
Date:       2009-07-05 23:44:18
Message-ID: 200907060144.19750.lists () egidy ! de
[Download RAW message or body]

Hi,

I know you developers are currently enjoying the sun in Gran Canaria and 
otherwise are busy with krss so I'm sorry to distract you with a question 
about the code in 4.2/4.3:

I tried the "disable archive"-mode in akregator for a special feed and could 
not find any functional difference than the default "keep all articles": all 
articles that are not included into the feed anymore are still visible in the 
same session and are loaded again after terminating (not just reducing into 
tray) and restarting akregator.

So how is the "disable archiving"-mode expected to work? When should articles 
be removed and where is the code doing it?

What I'm looking for is a mode where articles that are not contained in the 
feed anymore vanish instantly. I'm using an issue tracker which has an rss 
feed showing all open issues and I'd like all resolved issues to be removed.

Just in case my idea matches what you intended this mode to do I created a 
patch which implements it.

Kind regards,

Gerd


["kdepim-4.2.4-akregator_noarchive.patch" (text/x-patch)]

diff -r -u kdepim-4.2.4.orig/akregator/src/feed.cpp \
                kdepim-4.2.4/akregator/src/feed.cpp
--- kdepim-4.2.4.orig/akregator/src/feed.cpp	2009-05-28 21:22:07.000000000 +0200
+++ kdepim-4.2.4/akregator/src/feed.cpp	2009-07-06 00:50:53.000000000 +0200
@@ -474,6 +474,36 @@
 
     QList<Article> deletedArticles = d->deletedArticles;
 
+    if ((d->archiveMode == globalDefault && Settings::archiveMode() == \
Settings::EnumArchiveMode::disableArchiving) +        || (d->archiveMode == \
disableArchiving)) +    {
+        // when archiving disabled: immediately delete articles not in feed anymore
+
+        QHash<QString,Article>::Iterator current_art, articles_end = \
d->articles.end(); +        for (current_art = d->articles.begin(); current_art != \
articles_end; ++current_art) +        {
+            // check old article list against current list from feed
+            bool found_old = false;
+            for (it = items.constBegin(); it != en; ++it)
+            {
+                Article new_article(*it, this);
+                if (new_article.guid() == current_art->guid())
+                {
+                    found_old = true;
+                    break;
+                }
+            }
+
+            if (!found_old)
+            {
+                current_art->setStatus(Read);
+                deletedArticles.append(*current_art);
+            }
+        }
+
+        it = items.constBegin();
+    }
+
     for ( ; it != en; ++it)
     {
         if ( !d->articles.contains((*it)->id()) ) // article not in list
Only in kdepim-4.2.4/akregator/src: feed.cpp~



_______________________________________________
KDE PIM mailing list kde-pim@kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/

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

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