Summary: | Add feed to Akregator makes Konqueror crash | ||
---|---|---|---|
Product: | [Applications] akregator | Reporter: | Scott Blowers <scott> |
Component: | akregator konqueror plugin | Assignee: | kdepim bugs <kdepim-bugs> |
Status: | RESOLVED FIXED | ||
Severity: | crash | ||
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Compiled Sources | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: |
Description
Scott Blowers
2006-04-04 10:25:48 UTC
Does this happen for any feed, or just a particular one? I am not absolutely sure, I tried it on several different rss feeds, and it had the same outcome. Can you gave an example page+link where this happens reproducibly for you? SVN commit 575065 by osterfeld: This should fix the crash when using the akregator plugin in a file manager icon view (KonqKfmIconView). I can't reproduce the bug, so I'm not 100% sure if it really fixes the problem. Please test with >= 3.5.5 and reopen if the bug is still there. BUG: 124891 M +13 -9 akregatorplugin.cpp M +1 -2 pluginbase.cpp --- branches/KDE/3.5/kdeaddons/konq-plugins/akregator/akregatorplugin.cpp #575064:575065 @@ -57,17 +57,20 @@ // Do nothing if user has turned us off. // TODO: Not yet implemented in aKregator settings. - m_conf = new KConfig( "akregatorrc" ); + /*m_conf = new KConfig( "akregatorrc" ); m_conf->setGroup( "AkregatorKonqPlugin" ); if ( !m_conf->readBoolEntry( "Enable", true ) ) return; - - KHTMLView *view=(KHTMLView *)popupmenu->parent()->qt_cast("KHTMLView"); + */ + + KHTMLView* view = 0L; + + if (popupmenu && popupmenu->parent() && popupmenu->parent()->inherits("KHTMLView")) + view = static_cast<KHTMLView*>(popupmenu->parent()); + if (view) - m_part=view->part(); - if(!m_part) - return; - + m_part = view->part(); + KGlobal::locale()->insertCatalogue("akregator_konqplugin"); m_feedMimeTypes << "text/rss" << "text/rdf" << "text/xml"; // Get the list of URLs clicked on from Konqi. @@ -122,10 +125,11 @@ void AkregatorMenu::slotAddFeed() { + QString url = m_part ? fixRelativeURL(m_feedURL, m_part->baseURL()) : m_feedURL; if(akregatorRunning()) - addFeedsViaDCOP(QStringList(fixRelativeURL(m_feedURL, m_part->baseURL()))); + addFeedsViaDCOP(QStringList(url)); else - addFeedViaCmdLine(fixRelativeURL(m_feedURL, m_part->baseURL())); + addFeedViaCmdLine(url); } #include "akregatorplugin.moc" --- branches/KDE/3.5/kdeaddons/konq-plugins/akregator/pluginbase.cpp #575064:575065 @@ -97,7 +97,6 @@ u=s2; u.cleanPath(); - //kdDebug() << "AKREGATOR_PLUGIN_FIXURL: " << "url=" << s << " baseurl=" << baseurl.url() << " fixed=" << u.url() << -endl; + //kdDebug() << "AKREGATOR_PLUGIN_FIXURL: " << "url=" << s << " baseurl=" << baseurl.url() << " fixed=" << u.url() << endl; return u.url(); } SVN commit 575069 by osterfeld: forwardport 124891 (better check for cases where the calling part is not a KHTMLPart (like in the file manager)) CCBUG: 124891 M +16 -10 akregatorplugin.cpp M +1 -1 akregatorplugin.h --- trunk/KDE/kdeaddons/konq-plugins/akregator/akregatorplugin.cpp #575068:575069 @@ -50,7 +50,7 @@ K_EXPORT_COMPONENT_FACTORY( libakregatorkonqplugin, AkregatorMenuFactory("akregatorkonqplugin") ) AkregatorMenu::AkregatorMenu( KonqPopupMenu * popupmenu, const QStringList& /* list */ ) - : KonqPopupMenuPlugin( popupmenu), PluginBase(), m_conf(0), m_part(0) + : KonqPopupMenuPlugin( popupmenu), PluginBase(), /*m_conf(0),*/ m_part(0) { kDebug() << "AkregatorMenu::AkregatorMenu()" << endl; if ( QByteArray( kapp->name() ) == "kdesktop" && !KAuthorized::authorizeKAction("editable_desktop_icons" ) ) @@ -58,17 +58,21 @@ // Do nothing if user has turned us off. // TODO: Not yet implemented in aKregator settings. + + /* m_conf = new KConfig( "akregatorrc" ); m_conf->setGroup( "AkregatorKonqPlugin" ); if ( !m_conf->readEntry( "Enable", true ) ) return; - - KHTMLView *view=qobject_cast<KHTMLView*>(popupmenu->parent()); + */ + KHTMLView* view = 0L; + + if (popupmenu && popupmenu->parent() && popupmenu->parent()->inherits("KHTMLView")) + view = static_cast<KHTMLView*>(popupmenu->parent()); + if (view) - m_part=view->part(); - if(!m_part) - return; - + m_part = view->part(); + KGlobal::locale()->insertCatalog("akregator_konqplugin"); m_feedMimeTypes << "text/rss" << "text/rdf" << "text/xml"; // Get the list of URLs clicked on from Konqi. @@ -93,7 +97,7 @@ AkregatorMenu::~AkregatorMenu() { KGlobal::locale()->removeCatalog("akregator_konqplugin"); - delete m_conf; + //delete m_conf; } bool AkregatorMenu::isFeedUrl(const QString &url) @@ -120,10 +124,12 @@ void AkregatorMenu::slotAddFeed() { + QString url = m_part ? fixRelativeURL(m_feedURL, m_part->baseURL()) : m_feedURL(); + if(akregatorRunning()) - addFeedsViaDBUS(QStringList(fixRelativeURL(m_feedURL, m_part->baseURL()))); + addFeedsViaDBUS(QStringList(url)); else - addFeedViaCmdLine(fixRelativeURL(m_feedURL, m_part->baseURL())); + addFeedViaCmdLine(url); } #include "akregatorplugin.moc" --- trunk/KDE/kdeaddons/konq-plugins/akregator/akregatorplugin.h #575068:575069 @@ -49,7 +49,7 @@ private: QStringList m_feedMimeTypes; - KConfig *m_conf; +// KConfig *m_conf; KHTMLPart *m_part; QString m_feedURL; }; |