Bug 132823 - feedicon stays after deselecting plugin
Summary: feedicon stays after deselecting plugin
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: 2006-08-22 21:48 UTC by Johannes.Bergmeier
Modified: 2006-08-25 14:42 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 Johannes.Bergmeier 2006-08-22 21:48:56 UTC
Version:            (using KDE KDE 3.5.4)
Installed from:    Compiled From Sources

When disabling the konqfeedicon plugin while the icon in the lower right of the khtml view is shown, it doesn't hide.

After reenabling, and a reload of the page, a second icon shows up.

The icon should be removed when the plugin gets disabled.
Comment 1 Frank Osterfeld 2006-08-22 21:57:22 UTC
Confirmed.
Comment 2 Frank Osterfeld 2006-08-25 14:39:49 UTC
SVN commit 577054 by osterfeld:

add and remove feed icon correctly when plugin is enabled/disabled
BUG: 132823


 M  +10 -2     konqfeedicon.cpp  


--- branches/KDE/3.5/kdeaddons/konq-plugins/akregator/konqfeedicon.cpp #577053:577054
@@ -72,11 +72,17 @@
     connect(m_part, SIGNAL(completed()), this, SLOT(addFeedIcon()));
     connect(m_part, SIGNAL(completed(bool)), this, SLOT(addFeedIcon())); // to make pages with metarefresh to work
     connect(m_part, SIGNAL(started(KIO::Job *)), this, SLOT(removeFeedIcon()));
+    addFeedIcon();
 }
 
 KonqFeedIcon::~KonqFeedIcon()
 {
     KGlobal::locale()->removeCatalogue("akregator_konqplugin");
+    m_statusBarEx = KParts::StatusBarExtension::childObject(m_part);
+    if (m_statusBarEx)
+        m_statusBarEx->removeStatusBarItem(m_feedIcon);
+    delete m_feedIcon;
+    m_feedIcon = 0L;
     delete m_menu;
     m_menu = 0L;
 }
@@ -160,14 +166,16 @@
 void KonqFeedIcon::removeFeedIcon()
 {
     m_feedList.clear();
-    if(m_feedIcon) {
+    if(m_feedIcon) 
+    {
         m_statusBarEx->removeStatusBarItem(m_feedIcon);
         delete m_feedIcon;
-        m_feedIcon = 0;
+        m_feedIcon = 0L;
     }
 
     // Close the popup if it's open, otherwise we crash
     delete m_menu;
+    m_menu = 0L;
 }
 
 void KonqFeedIcon::addFeed(int id)
Comment 3 Frank Osterfeld 2006-08-25 14:42:12 UTC
SVN commit 577057 by osterfeld:

forward port #132823 (add/remove feed icon when plugin is enabled/disabled)
CCBUG: 132823


 M  +19 -8     konqfeedicon.cpp  


--- trunk/KDE/kdeaddons/konq-plugins/akregator/konqfeedicon.cpp #577056:577057
@@ -71,27 +71,33 @@
     connect(m_part, SIGNAL(completed()), this, SLOT(addFeedIcon()));
     connect(m_part, SIGNAL(completed(bool)), this, SLOT(addFeedIcon())); // to make pages with metarefresh to work
     connect(m_part, SIGNAL(started(KIO::Job *)), this, SLOT(removeFeedIcon()));
+    addFeedIcon();
 }
 
 KonqFeedIcon::~KonqFeedIcon()
 {
     KGlobal::locale()->removeCatalog("akregator_konqplugin");
+    m_statusBarEx = KParts::StatusBarExtension::childObject(m_part);
+        if (m_statusBarEx)
+            m_statusBarEx->removeStatusBarItem(m_feedIcon);
+    delete m_feedIcon;
+    m_feedIcon = 0;
     delete m_menu;
     m_menu = 0L;
 }
 
 bool KonqFeedIcon::feedFound()
 {
-	DOM::NodeList linkNodes = m_part->document().getElementsByTagName("link");
+    DOM::NodeList linkNodes = m_part->document().getElementsByTagName("link");
 
-	if (linkNodes.length() == 0)
+    if (linkNodes.length() == 0)
         return false;
 
     unsigned int i;
     QString doc = "";
 
-	for (i = 0; i < linkNodes.length(); i++)
-	{
+    for (i = 0; i < linkNodes.length(); i++)
+    {
         DOM::Node node = linkNodes.item(i);
         doc += "<link ";
         for (unsigned int j = 0; j < node.attributes().length(); j++)
@@ -111,15 +117,18 @@
 {
     delete m_menu;
     m_menu = new KMenu(m_part->widget());
-    if(m_feedList.count() == 1) {
+    if(m_feedList.count() == 1)
+    {
         m_menu->addTitle(m_feedList.first().title());
         m_menu->insertItem(SmallIcon("bookmark_add"), i18n("Add Feed to Akregator"), this, SLOT(addFeeds()) );
     }
-    else {
+    else
+    {
         m_menu->addTitle(i18n("Add Feeds to Akregator"));
         connect(m_menu, SIGNAL(activated(int)), this, SLOT(addFeed(int)));
         int id = 0;
-        for(FeedDetectorEntryList::Iterator it = m_feedList.begin(); it != m_feedList.end(); ++it) {
+        for(FeedDetectorEntryList::Iterator it = m_feedList.begin(); it != m_feedList.end(); ++it)
+        {
             m_menu->insertItem(SmallIcon("bookmark_add"), (*it).title(), id);
             id++;
         }
@@ -159,7 +168,8 @@
 void KonqFeedIcon::removeFeedIcon()
 {
     m_feedList.clear();
-    if(m_feedIcon) {
+    if(m_feedIcon)
+    {
         m_statusBarEx->removeStatusBarItem(m_feedIcon);
         delete m_feedIcon;
         m_feedIcon = 0;
@@ -167,6 +177,7 @@
 
     // Close the popup if it's open, otherwise we crash
     delete m_menu;
+    m_menu = 0L;
 }
 
 void KonqFeedIcon::addFeed(int id)