Bug 124891 - Add feed to Akregator makes Konqueror crash
Summary: Add feed to Akregator makes Konqueror crash
Status: RESOLVED FIXED
Alias: None
Product: akregator
Classification: Applications
Component: akregator konqueror plugin (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR crash
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-04-04 10:25 UTC by Scott Blowers
Modified: 2006-08-20 20:16 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 Scott Blowers 2006-04-04 10:25:48 UTC
Version:            (using KDE KDE 3.5.1)
Installed from:    Compiled From Sources
Compiler:          GCC 3.2.3 
OS:                Linux

When you right click on a rss feed link in Konqueror and select "Add feed to Akregator", at the bottom of the menu, Konqueror crashes. Here is the backtrace output:

(no debugging symbols found)
Using host libthread_db library "/lib/libthread_db.so.1".
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
[Thread debugging using libthread_db enabled]
[New Thread -1231571280 (LWP 565)]
[KCrash handler]
#7  0xb5fdc9e2 in KHTMLPart::baseURL () from /usr/lib/libkhtml.so.4
#8  0xb5b6a0ea in Akregator::AkregatorMenu::slotAddFeed ()
   from /usr/lib/kde3/libakregatorkonqplugin.so
#9  0xb5b6a2e8 in Akregator::AkregatorMenu::qt_invoke ()
   from /usr/lib/kde3/libakregatorkonqplugin.so
#10 0xb71326e4 in QObject::activate_signal () from /usr/lib/libqt-mt.so.3
#11 0xb7132e7c in QObject::activate_signal () from /usr/lib/libqt-mt.so.3
#12 0xb7a24cd9 in KAction::activated () from /usr/lib/libkdeui.so.4
#13 0xb7a258aa in KAction::slotActivated () from /usr/lib/libkdeui.so.4
#14 0xb7a2b469 in KAction::slotPopupActivated () from /usr/lib/libkdeui.so.4
#15 0xb7a2b765 in KAction::qt_invoke () from /usr/lib/libkdeui.so.4
#16 0xb71326e4 in QObject::activate_signal () from /usr/lib/libqt-mt.so.3
#17 0xb7488b5d in QSignal::signal () from /usr/lib/libqt-mt.so.3
#18 0xb714d2c1 in QSignal::activate () from /usr/lib/libqt-mt.so.3
#19 0xb7242c17 in QPopupMenu::mouseReleaseEvent () from /usr/lib/libqt-mt.so.3
#20 0xb716c5c4 in QWidget::event () from /usr/lib/libqt-mt.so.3
#21 0xb70ce96f in QApplication::internalNotify () from /usr/lib/libqt-mt.so.3
#22 0xb70cebc6 in QApplication::notify () from /usr/lib/libqt-mt.so.3
#23 0xb7709bb5 in KApplication::notify () from /usr/lib/libkdecore.so.4
#24 0xb706907a in QETWidget::translateMouseEvent ()
   from /usr/lib/libqt-mt.so.3
#25 0xb7067291 in QApplication::x11ProcessEvent () from /usr/lib/libqt-mt.so.3
#26 0xb707a7d5 in QEventLoop::processEvents () from /usr/lib/libqt-mt.so.3
#27 0xb70e50a1 in QEventLoop::enterLoop () from /usr/lib/libqt-mt.so.3
#28 0xb70cdaff in QApplication::enter_loop () from /usr/lib/libqt-mt.so.3
#29 0xb72466cf in QPopupMenu::exec () from /usr/lib/libqt-mt.so.3
#30 0xb6672d19 in KonqMainWindow::slotPopupMenu ()
   from /usr/lib/libkdeinit_konqueror.so
#31 0xb6673bd9 in KonqMainWindow::slotPopupMenu ()
   from /usr/lib/libkdeinit_konqueror.so
#32 0xb668d8dd in KonqMainWindow::qt_invoke ()
   from /usr/lib/libkdeinit_konqueror.so
#33 0xb71326e4 in QObject::activate_signal () from /usr/lib/libqt-mt.so.3
#34 0xb7fd1c47 in KParts::BrowserExtension::popupMenu ()
   from /usr/lib/libkparts.so.2
#35 0xb5bc193f in KonqKfmIconView::slotContextMenuRequested ()
   from /usr/lib/kde3/konq_iconview.so
#36 0xb5bc47f0 in KonqKfmIconView::qt_invoke ()
   from /usr/lib/kde3/konq_iconview.so
#37 0xb71326e4 in QObject::activate_signal () from /usr/lib/libqt-mt.so.3
#38 0xb74b6049 in QIconView::contextMenuRequested ()
   from /usr/lib/libqt-mt.so.3
#39 0xb730c3d5 in QIconView::contentsContextMenuEvent ()
   from /usr/lib/libqt-mt.so.3
#40 0xb724f3f5 in QScrollView::viewportContextMenuEvent ()
   from /usr/lib/libqt-mt.so.3
#41 0xb7251429 in QScrollView::eventFilter () from /usr/lib/libqt-mt.so.3
#42 0xb7303f6f in QIconView::eventFilter () from /usr/lib/libqt-mt.so.3
#43 0xb712fadf in QObject::activate_filters () from /usr/lib/libqt-mt.so.3
#44 0xb712fbb4 in QObject::event () from /usr/lib/libqt-mt.so.3
#45 0xb716c03f in QWidget::event () from /usr/lib/libqt-mt.so.3
#46 0xb70ce96f in QApplication::internalNotify () from /usr/lib/libqt-mt.so.3
#47 0xb70cedc0 in QApplication::notify () from /usr/lib/libqt-mt.so.3
#48 0xb7709bb5 in KApplication::notify () from /usr/lib/libkdecore.so.4
#49 0xb7069205 in QETWidget::translateMouseEvent ()
   from /usr/lib/libqt-mt.so.3
#50 0xb7067291 in QApplication::x11ProcessEvent () from /usr/lib/libqt-mt.so.3
#51 0xb707a7d5 in QEventLoop::processEvents () from /usr/lib/libqt-mt.so.3
#52 0xb70e50a1 in QEventLoop::enterLoop () from /usr/lib/libqt-mt.so.3
#53 0xb70e4ff6 in QEventLoop::exec () from /usr/lib/libqt-mt.so.3
#54 0xb70cdacf in QApplication::exec () from /usr/lib/libqt-mt.so.3
#55 0xb660da7c in kdemain () from /usr/lib/libkdeinit_konqueror.so
#56 0xb761b744 in kdeinitmain () from /usr/lib/kde3/konqueror.so
#57 0x0804e480 in launch ()
#58 0x0804ec9b in handle_launcher_request ()
#59 0x0804f266 in handle_requests ()
#60 0x0804fa71 in main ()

Hope that is useful to anyone.

Theodred
Comment 1 Philip Rodrigues 2006-04-04 23:55:09 UTC
Does this happen for any feed, or just a particular one?
Comment 2 Scott Blowers 2006-04-05 10:03:00 UTC
I am not absolutely sure, I tried it on several different rss feeds, and it had the same outcome.
Comment 3 Frank Osterfeld 2006-04-07 22:24:01 UTC
Can you gave an example page+link where this happens reproducibly for you?
Comment 4 Frank Osterfeld 2006-08-20 20:08:59 UTC
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();
 }
Comment 5 Frank Osterfeld 2006-08-20 20:16:44 UTC
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;
 };