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.
Confirmed.
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)
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)