Bug 95717 - Multiple feed detection is broken
Summary: Multiple feed detection is broken
Status: RESOLVED FIXED
Alias: None
Product: akregator
Classification: Applications
Component: akregator konqueror plugin (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-12-23 14:25 UTC by Ismail Donmez
Modified: 2004-12-23 20:49 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 Ismail Donmez 2004-12-23 14:26:00 UTC
Version:            (using KDE Devel)
Installed from:    Compiled sources
Compiler:          gcc 3.4.3 
OS:                Linux

http://www.kde-look.org/ has multiple feeds and only one of them is detected.
Comment 1 Teemu Rytilahti 2004-12-23 20:26:11 UTC
CVS commit by rytilahti: 

*Don't take only the first found feed but all of them.
*Don't stop checking other link tags when unproper type found (break->continue)

BUG:95717


  M +3 -4      feeddetector.cpp   1.5


--- kdeaddons/konq-plugins/akregator/feeddetector.cpp  #1.4:1.5
@@ -55,10 +55,10 @@ FeedDetectorEntryList FeedDetector::extr
         int pos = reType.search(*it, 0);
         if (pos != -1)
-            type = reHref.cap(1).lower();
+            type = reHref.cap(pos).lower();
 
         // we accept only type attributes indicating a feed or omitted type attributes
         if ( !type.isEmpty() && type != "application/rss+xml" && type != "application/rdf+xml"
              && type != "application/atom+xml" )
-            break;
+            continue;
                 
         QString title;


Comment 2 Teemu Rytilahti 2004-12-23 20:49:39 UTC
CVS commit by rytilahti: 

Fix 95717 properly. Now id 50000 is used for "add all feeds", hopefully no site has this many of them...
Any ideas if there's a better way to do this?

CCBUG:95717


  M +1 -1      feeddetector.cpp   1.6
  M +3 -2      konqfeedicon.cpp   1.19


--- kdeaddons/konq-plugins/akregator/feeddetector.cpp  #1.5:1.6
@@ -55,5 +55,5 @@ FeedDetectorEntryList FeedDetector::extr
         int pos = reType.search(*it, 0);
         if (pos != -1)
-            type = reHref.cap(pos).lower();
+            type = reType.cap(1).lower();
 
         // we accept only type attributes indicating a feed or omitted type attributes

--- kdeaddons/konq-plugins/akregator/konqfeedicon.cpp  #1.18:1.19
@@ -85,7 +85,7 @@ void KonqFeedIcon::contextMenu()
             id++;
         }
-        disconnect(m_menu, SIGNAL(activated(int)), this, SLOT(addFeed(int)));
+        //disconnect(m_menu, SIGNAL(activated(int)), this, SLOT(addFeed(int)));
         m_menu->insertSeparator();
-        m_menu->insertItem(SmallIcon("bookmark_add"), i18n("Add All Found Feeds to aKregator"), this, SLOT(addFeeds()) );
+        m_menu->insertItem(SmallIcon("bookmark_add"), i18n("Add All Found Feeds to aKregator"), this, SLOT(addFeeds()), 0, 50000 );
     }
     m_menu->popup(QCursor::pos());
@@ -135,4 +135,5 @@ void KonqFeedIcon::removeFeedIcon()
 void KonqFeedIcon::addFeed(int id)
 {
+    if(id == 50000) return;
     if(akregatorRunning())
         addFeedViaDCOP(fixRelativeURL(m_feedList[id].url(), m_part->baseURL()));