Bug 178561 - konqueror can't be added in file association
Summary: konqueror can't be added in file association
Status: RESOLVED FIXED
Alias: None
Product: kio
Classification: Unmaintained
Component: general (show other bugs)
Version: SVN
Platform: Compiled Sources Unspecified
: NOR crash
Target Milestone: ---
Assignee: David Faure
URL:
Keywords:
: 137143 179900 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-12-23 13:14 UTC by Nicolas L.
Modified: 2009-02-10 00:41 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
log of the test (242.99 KB, application/octet-stream)
2008-12-24 16:28 UTC, Nicolas L.
Details
log of the test (242.99 KB, application/octet-stream)
2008-12-24 16:28 UTC, Nicolas L.
Details
Result of the requested test (242.99 KB, application/octet-stream)
2008-12-24 16:32 UTC, Nicolas L.
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nicolas L. 2008-12-23 13:14:21 UTC
Version:            (using Devel)
Installed from:    Compiled sources

If i try to add konqueror as association ( in systemsettings -> advanced -> file association  )  systemsettings crash :

Thread 1 (Thread 0xb60cf6d0 (LWP 3155)):
[KCrash Handler]
#6  0xffffe424 in __kernel_vsyscall ()
#7  0xb69eed90 in raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#8  0xb69f07f8 in abort () at abort.c:88
#9  0xb7576445 in qt_message_output (msgType=QtFatalMsg, buf=0xbf866e10 "ASSERT: \"m_pService\" in file /home/mandrake/rpm/BUILD/kdelibs-4.1.85/kio/kfile/kopenwithdialog.cpp, line 780")
    at global/qglobal.cpp:2102
#10 0xb7576535 in qFatal (msg=0xb76c9b78 "ASSERT: \"%s\" in file %s, line %d") at global/qglobal.cpp:2303
#11 0xb75765e5 in qt_assert (assertion=0xb7f7a238 "m_pService", file=0xb7f7a424 "/home/mandrake/rpm/BUILD/kdelibs-4.1.85/kio/kfile/kopenwithdialog.cpp", line=780) at global/qglobal.cpp:1872
#12 0xb7f0677b in KOpenWithDialogPrivate::addToMimeAppsList (this=0x8467a50, serviceId=@0xbf869020) at /usr/src/debug/kdelibs-4.1.85/kio/kfile/kopenwithdialog.cpp:780
#13 0xb7f07825 in KOpenWithDialogPrivate::checkAccept (this=0x8467a50) at /usr/src/debug/kdelibs-4.1.85/kio/kfile/kopenwithdialog.cpp:908
#14 0xb7f07985 in KOpenWithDialog::accept (this=0xbf86a300) at /usr/src/debug/kdelibs-4.1.85/kio/kfile/kopenwithdialog.cpp:918
#15 0xb7ac3d60 in KDialog::slotButtonClicked (this=0xbf86a300, button=4) at /usr/src/debug/kdelibs-4.1.85/kdeui/dialogs/kdialog.cpp:851
#16 0xb7ac6127 in KDialog::qt_metacall (this=0xbf86a300, _c=QMetaObject::InvokeMetaMethod, _id=33, _a=0xbf869250) at /usr/src/debug/kdelibs-4.1.85/build/kdeui/kdialog.moc:181
#17 0xb7f08402 in KOpenWithDialog::qt_metacall (this=0xbf86a300, _c=QMetaObject::InvokeMetaMethod, _id=68, _a=0xbf869250) at /usr/src/debug/kdelibs-4.1.85/build/kio/kopenwithdialog.moc:69
#18 0xb768cc8d in QMetaObject::activate (sender=0x8468720, from_signal_index=4, to_signal_index=4, argv=0xbf869250) at kernel/qobject.cpp:3031
#19 0xb768da95 in QMetaObject::activate (sender=0x8468720, m=0xb775dc58, local_signal_index=0, argv=0xbf869250) at kernel/qobject.cpp:3101
#20 0xb7690cb5 in QSignalMapper::mapped (this=0x8468720, _t1=4) at .moc/release-shared/moc_qsignalmapper.cpp:93
#21 0xb76915ab in QSignalMapper::map (this=0x8468720, sender=0x841e1a8) at kernel/qsignalmapper.cpp:271
#22 0xb769177e in QSignalMapper::map (this=0x8468720) at kernel/qsignalmapper.cpp:262
#23 0xb7692034 in QSignalMapper::qt_metacall (this=0x8468720, _c=QMetaObject::InvokeMetaMethod, _id=4, _a=0xbf8693b0) at .moc/release-shared/moc_qsignalmapper.cpp:80
#24 0xb768cc8d in QMetaObject::activate (sender=0x841e1a8, from_signal_index=29, to_signal_index=30, argv=0xbf8693b0) at kernel/qobject.cpp:3031
#25 0xb768d0bb in QMetaObject::activate (sender=0x841e1a8, m=0xb751f824, from_local_signal_index=2, to_local_signal_index=3, argv=0xbf8693b0) at kernel/qobject.cpp:3121
#26 0xb734b475 in QAbstractButton::clicked (this=0x841e1a8, _t1=false) at .moc/release-shared/moc_qabstractbutton.cpp:185
#27 0xb708802d in QAbstractButtonPrivate::emitClicked (this=0x8349938) at widgets/qabstractbutton.cpp:538
#28 0xb708814c in QAbstractButton::click (this=0x841e1a8) at widgets/qabstractbutton.cpp:975
#29 0xb71bc75d in QDialog::keyPressEvent (this=0xbf86a300, e=0xbf8698ec) at dialogs/qdialog.cpp:573
#30 0xb7ac4fa8 in KDialog::keyPressEvent (this=0xbf86a300, event=0xbf8698ec) at /usr/src/debug/kdelibs-4.1.85/kdeui/dialogs/kdialog.cpp:393
#31 0xb6d85850 in QWidget::event (this=0xbf86a300, event=0xbf8698ec) at kernel/qwidget.cpp:7198
#32 0xb6d2afac in QApplicationPrivate::notify_helper (this=0x812f588, receiver=0xbf86a300, e=0xbf8698ec) at kernel/qapplication.cpp:3803
#33 0xb6d34337 in QApplication::notify (this=0xbf86b284, receiver=0x84b6da0, e=0xbf8698ec) at kernel/qapplication.cpp:3447
#34 0xb7b519b0 in KApplication::notify (this=0xbf86b284, receiver=0x84b6da0, event=0xbf8698ec) at /usr/src/debug/kdelibs-4.1.85/kdeui/kernel/kapplication.cpp:307
#35 0xb7677853 in QCoreApplication::notifyInternal (this=0xbf86b284, receiver=0x84b6da0, event=0xbf8698ec) at kernel/qcoreapplication.cpp:587
#36 0xb6d8e4ad in qt_sendSpontaneousEvent (receiver=0x84b6da0, event=0x6) at ../../src/corelib/kernel/qcoreapplication.h:212
#37 0xb6dc43f9 in QKeyMapper::sendKeyEvent (keyWidget=0x84b6da0, grab=false, type=QEvent::KeyPress, code=16777220, modifiers={i = -1081697736}, text=@0xbf869a64, autorepeat=false, count=1, 
    nativeScanCode=36, nativeVirtualKey=65293, nativeModifiers=16) at kernel/qkeymapper_x11.cpp:1652
#38 0xb6dc670b in QKeyMapperPrivate::translateKeyEvent (this=0x815f0b0, keyWidget=0x84b6da0, event=0xbf86a03c, grab=false) at kernel/qkeymapper_x11.cpp:1623
#39 0xb6d9e381 in QApplication::x11ProcessEvent (this=0xbf86b284, event=0xbf86a03c) at kernel/qapplication_x11.cpp:3053
#40 0xb6dc81d4 in x11EventSourceDispatch (s=0x8132670, callback=0, user_data=0x0) at kernel/qguieventdispatcher_glib.cpp:142
#41 0xb63eccba in IA__g_main_context_dispatch (context=0x8131838) at gmain.c:1814
#42 0xb63f03d8 in g_main_context_iterate (context=0x8131838, block=1, dispatch=1, self=0x812f680) at gmain.c:2448
#43 0xb63f0598 in IA__g_main_context_iteration (context=0x8131838, may_block=1) at gmain.c:2511
#44 0xb76a334a in QEventDispatcherGlib::processEvents (this=0x813cd48, flags={i = -1081695768}) at kernel/qeventdispatcher_glib.cpp:319
#45 0xb6dc792a in QGuiEventDispatcherGlib::processEvents (this=0x813cd48, flags={i = -1081695720}) at kernel/qguieventdispatcher_glib.cpp:198
#46 0xb7675ec3 in QEventLoop::processEvents (this=0xbf86a28c, flags={i = -1081695656}) at kernel/qeventloop.cpp:143
#47 0xb7676081 in QEventLoop::exec (this=0xbf86a28c, flags={i = -1081695596}) at kernel/qeventloop.cpp:194
#48 0xb71bc551 in QDialog::exec (this=0xbf86a300) at dialogs/qdialog.cpp:447
#49 0xb45da80d in KServiceListWidget::addService (this=0x83f6390) at /usr/src/debug/kdebase-4.1.85/apps/konqueror/settings/filetypes/kservicelistwidget.cpp:249
#50 0xb45db018 in KServiceListWidget::qt_metacall (this=0x83f6390, _c=QMetaObject::InvokeMetaMethod, _id=3, _a=0xbf86a450)
    at /usr/src/debug/kdebase-4.1.85/build/apps/konqueror/settings/filetypes/kservicelistwidget.moc:79
#51 0xb768cc8d in QMetaObject::activate (sender=0x83fa8e8, from_signal_index=29, to_signal_index=30, argv=0xbf86a450) at kernel/qobject.cpp:3031
#52 0xb768d0bb in QMetaObject::activate (sender=0x83fa8e8, m=0xb751f824, from_local_signal_index=2, to_local_signal_index=3, argv=0xbf86a450) at kernel/qobject.cpp:3121
#53 0xb734b475 in QAbstractButton::clicked (this=0x83fa8e8, _t1=false) at .moc/release-shared/moc_qabstractbutton.cpp:185
#54 0xb708802d in QAbstractButtonPrivate::emitClicked (this=0x83fb370) at widgets/qabstractbutton.cpp:538
#55 0xb7089ceb in QAbstractButtonPrivate::click (this=0x83fb370) at widgets/qabstractbutton.cpp:531
#56 0xb7089f86 in QAbstractButton::mouseReleaseEvent (this=0x83fa8e8, e=0xbf86aa08) at widgets/qabstractbutton.cpp:1110
#57 0xb6d8599a in QWidget::event (this=0x83fa8e8, event=0xbf86aa08) at kernel/qwidget.cpp:7163
#58 0xb7087eb0 in QAbstractButton::event (this=0x83fa8e8, e=0xbf86aa08) at widgets/qabstractbutton.cpp:1072
#59 0xb7132fd3 in QPushButton::event (this=0x83fa8e8, e=0xbf86aa08) at widgets/qpushbutton.cpp:652
#60 0xb6d2afac in QApplicationPrivate::notify_helper (this=0x812f588, receiver=0x83fa8e8, e=0xbf86aa08) at kernel/qapplication.cpp:3803
#61 0xb6d33bbf in QApplication::notify (this=0xbf86b284, receiver=0x83fa8e8, e=0xbf86aa08) at kernel/qapplication.cpp:3528
#62 0xb7b519b0 in KApplication::notify (this=0xbf86b284, receiver=0x83fa8e8, event=0xbf86aa08) at /usr/src/debug/kdelibs-4.1.85/kdeui/kernel/kapplication.cpp:307
#63 0xb7677853 in QCoreApplication::notifyInternal (this=0xbf86b284, receiver=0x83fa8e8, event=0xbf86aa08) at kernel/qcoreapplication.cpp:587
#64 0xb6d32de1 in QApplicationPrivate::sendMouseEvent (receiver=0x83fa8e8, event=0xbf86aa08, alienWidget=0x0, nativeWidget=0x83fa8e8, buttonDown=0xb752b3b0, lastMouseReceiver=@0xb752b3b4)
    at ../../src/corelib/kernel/qcoreapplication.h:212
#65 0xb6d9fced in QETWidget::translateMouseEvent (this=0x83fa8e8, event=0xbf86afbc) at kernel/qapplication_x11.cpp:4042
#66 0xb6d9f150 in QApplication::x11ProcessEvent (this=0xbf86b284, event=0xbf86afbc) at kernel/qapplication_x11.cpp:3038
#67 0xb6dc81d4 in x11EventSourceDispatch (s=0x8132670, callback=0, user_data=0x0) at kernel/qguieventdispatcher_glib.cpp:142
#68 0xb63eccba in IA__g_main_context_dispatch (context=0x8131838) at gmain.c:1814
#69 0xb63f03d8 in g_main_context_iterate (context=0x8131838, block=1, dispatch=1, self=0x812f680) at gmain.c:2448
#70 0xb63f0598 in IA__g_main_context_iteration (context=0x8131838, may_block=1) at gmain.c:2511
#71 0xb76a334a in QEventDispatcherGlib::processEvents (this=0x813cd48, flags={i = -1081691800}) at kernel/qeventdispatcher_glib.cpp:319
#72 0xb6dc792a in QGuiEventDispatcherGlib::processEvents (this=0x813cd48, flags={i = -1081691752}) at kernel/qguieventdispatcher_glib.cpp:198
#73 0xb7675ec3 in QEventLoop::processEvents (this=0xbf86b210, flags={i = -1081691688}) at kernel/qeventloop.cpp:143
#74 0xb7676081 in QEventLoop::exec (this=0xbf86b210, flags={i = -1081691624}) at kernel/qeventloop.cpp:194
#75 0xb76787f2 in QCoreApplication::exec () at kernel/qcoreapplication.cpp:845
#76 0xb6d2ae14 in QApplication::exec () at kernel/qapplication.cpp:3331
#77 0x08056a7b in main (argc=-1081691196, argv=0xb806e7d4) at /usr/src/debug/kdebase-workspace-4.1.85/systemsettings/main.cpp:67
Comment 1 David Faure 2008-12-23 20:14:07 UTC
Same problem as 178560: your kbuildsycoca4 doesn't see the changes you make on the system (this time a new .desktop file, as opposed to changes in mimeapps.list). Same way of debugging it, adding debug output to kbuildsycoca4...

For instance, kDebug() << file; at the beginning of KBuildServiceFactory::createEntry...
Comment 2 Nicolas L. 2008-12-24 14:48:00 UTC
what exact test do you want me to do ?
Comment 3 Nicolas L. 2008-12-24 14:48:21 UTC
btw i have kdelibs with the debug you asked
Comment 4 David Faure 2008-12-24 15:25:33 UTC
1) Take the konqueror-2.desktop created by kopenwithdialog and move it out of the way (/tmp).
2) kbuildsycoca4 --noincremental
3) move konqueror-2.desktop back to ~/.local/share/applications
4) kbuildsycoca4 2>&1 | tee log
Check if the log file talks about konqueror-2.

[don't wait too much between 3 and 4 otherwise kded might detect the new file and launch kbuildsycoca4 on its own].
Well, alternatively,
5) kbuildsycoca4 --noincremental 2>&1 | tee logfull
and look for konqueror-2 in logfull.

If everything seems fine there (the new file is noticed and no warning about it), then it might be a timing problem (kopenwithdialog is supposed to wait for kbuildsycoca4 to finish...)
Comment 5 Nicolas L. 2008-12-24 16:28:17 UTC
Created attachment 29607 [details]
log of the test

btw  konqueror is not available where i wanted to add it.
for information here is the konqueror-2.desktop

[Desktop Entry]
Exec=konqueror
MimeType=interface/x-winamp-skin;
Name=konqueror
NoDisplay=true
Type=Application
Comment 6 Nicolas L. 2008-12-24 16:28:30 UTC
Created attachment 29608 [details]
log of the test

btw  konqueror is not available where i wanted to add it.
for information here is the konqueror-2.desktop

[Desktop Entry]
Exec=konqueror
MimeType=interface/x-winamp-skin;
Name=konqueror
NoDisplay=true
Type=Application
Comment 7 Nicolas L. 2008-12-24 16:32:24 UTC
Created attachment 29609 [details]
Result of the requested test

btw  konqueror is not available where i wanted to add it.
for information here is the konqueror-2.desktop

[Desktop Entry]
Exec=konqueror
MimeType=interface/x-winamp-skin;
Name=konqueror
NoDisplay=true
Type=Application
Comment 8 Nicolas L. 2008-12-24 16:32:53 UTC
ooops sorry :/ i had a connection pb
Comment 9 David Faure 2008-12-24 17:27:30 UTC
OK, the file is seen but has the wrong menuId. More debug needed.
Leave konqueror-2.desktop in place (no need to move it out this time), apply this patch to kdelibs.
http://www.davidfaure.fr/tmp/moredebug.diff
Ensure area 7021 is enabled in kdebugdialog.
Then run
kbuildsycoca4 --noincremental 2>&1 | grep konqueror-2

Here I see:
kbuildsycoca4(7674) KBuildServiceFactory::createEntry: Creating KService from "/home/dfaure/.local/share/applications/konqueror-2.desktop" entryPath= "/home/dfaure/.local/share/applications/konqueror-2.desktop"
kbuildsycoca4(7674) KService::setMenuId: "/home/dfaure/.local/share/applications/konqueror-2.desktop" menuId= "konqueror-2.desktop"
kbuildsycoca4(7674) KBuildServiceFactory::addEntry: adding service "konqueror-2.desktop" name= "konqueror-2" relName= "/home/dfaure/.local/share/applications/konqueror-2.desktop"
kbuildsycoca4(7674) KBuildServiceFactory::findServiceByMenuId: "konqueror-2.desktop" true

I suspect the menuId is not set in your case, which would then come from the XDG VFolder stuff [which I don't know much about...]. Try removing the Mandriva vfolder customizations, does it work then?
Comment 10 Nicolas L. 2008-12-25 06:18:19 UTC
I obtained this with mandriva applications.menu

$ kbuildsycoca4 --noincremental 2>&1 | grep konqueror-2
kbuildsycoca4(9280) KBuildServiceFactory::createEntry: "/home/test/.local/share/applications/konqueror-2.desktop"
kbuildsycoca4(9280) KBuildServiceFactory::createEntry: "/home/test/.local/share/applications/konqueror-2.desktop"
kbuildsycoca4(9280) KBuildServiceFactory::createEntry: Creating KService from "/home/test/.local/share/applications/konqueror-2.desktop" entryPath= "/home/test/.local/share/applications/konqueror-2.desktop"
kbuildsycoca4(9280) KService::setMenuId: "/home/test/.local/share/applications/konqueror-2.desktop" menuId= "konqueror-2.desktop"
kbuildsycoca4(9280) KBuildServiceFactory::findServiceByMenuId: "konqueror-2.desktop" false
kbuildsycoca4(9280) KBuildServiceFactory::findServiceByDesktopPath: "konqueror-2.desktop" false
kbuildsycoca4(9280) KBuildServiceFactory::findServiceByDesktopName: "kde4-konqueror-2" false
kbuildsycoca4(9280) KBuildServiceFactory::findServiceByDesktopName: "konqueror-2" false
kbuildsycoca4(9280) KMimeAssociations::parseAddedAssociations: "/home/test/.local/share/applications/mimeapps.list" specifies unknown service "konqueror-2.desktop" in "Added Associations"
Comment 11 Nicolas L. 2008-12-25 06:19:37 UTC
i obtain the same with kde  applications.menu

$ kbuildsycoca4 --noincremental 2>&1 | grep konqueror-2
kbuildsycoca4(9372) KBuildServiceFactory::createEntry: "/home/test/.local/share/applications/konqueror-2.desktop"
kbuildsycoca4(9372) KBuildServiceFactory::createEntry: "/home/test/.local/share/applications/konqueror-2.desktop"
kbuildsycoca4(9372) KBuildServiceFactory::createEntry: Creating KService from "/home/test/.local/share/applications/konqueror-2.desktop" entryPath= "/home/test/.local/share/applications/konqueror-2.desktop"
kbuildsycoca4(9372) KService::setMenuId: "/home/test/.local/share/applications/konqueror-2.desktop" menuId= "konqueror-2.desktop"
kbuildsycoca4(9372) KBuildServiceFactory::findServiceByMenuId: "konqueror-2.desktop" false
kbuildsycoca4(9372) KBuildServiceFactory::findServiceByDesktopPath: "konqueror-2.desktop" false
kbuildsycoca4(9372) KBuildServiceFactory::findServiceByDesktopName: "kde4-konqueror-2" false
kbuildsycoca4(9372) KBuildServiceFactory::findServiceByDesktopName: "konqueror-2" false
kbuildsycoca4(9372) KMimeAssociations::parseAddedAssociations: "/home/test/.local/share/applications/mimeapps.list" specifies unknown service "konqueror-2.desktop" in "Added Associations"
Comment 12 David Faure 2008-12-26 12:52:47 UTC
OK, the call to KBuildServiceFactory::addEntry is missing, and I found out why.
It works here because the VFolder stuff puts konqueror-2.desktop into the "Lost & Found" category. This can be seen by removing the NoDisplay=true from the desktop file, and then doing
kbuildsycoca4 --menutest 2>&1 | grep konqueror-2
which shows
Lost & Found/   konqueror-2.desktop 

So this shows that it's indeed the mandriva vfolder setup that causes this bug, and it also shows that kbuildsycoca4 is a bit too fragile about this; I have to find a way to make desktop files "exist" even if they are not categorized as "Lost & Found" (especially since desktop files generated by the "open with" dialog have NoDisplay=true anyway...).
Comment 13 David Faure 2008-12-26 12:56:53 UTC
FWIW, the Lost & Found submenu comes from this code in kde's applications.menu:

                <Name>Applications</Name>
                <Directory>kde-unknown.directory</Directory>
                <OnlyUnallocated/>

(the string "Lost & Found" is in that $prefix/share/desktop-directories/kde-unknown.directory file)
Comment 14 David Faure 2008-12-26 13:50:19 UTC
SVN commit 901685 by dfaure:

Fix a VERY old bug which prevents creating new desktop files in order to associate them with mimetypes.
Lately the symptom was the ASSERT(m_pService) in kopenwithdialog; before that (including in kde-3.x) it would just not work.
The cause for all this: distro-modified applications.menu where "Lost & Found" was removed.
The fix: adding the service to the factory as soon as we parse the .desktop file, independenly from whether it matches
a menu category or not.

BUG: 178561


 M  +3 -0      kbuildservicefactory.cpp  
 M  +1 -2      kbuildsycoca.cpp  
 M  +5 -1      vfolder_menu.cpp  
 M  +9 -2      vfolder_menu.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=901685
Comment 15 David Faure 2008-12-26 13:56:00 UTC
SVN commit 901693 by dfaure:

Backport fix for user-created desktop files not being useable on some distros (r901685)  --> the fix will be in KDE-4.1.4.
CCBUG: 178561


 M  +1 -2      kbuildsycoca.cpp  
 M  +5 -1      vfolder_menu.cpp  
 M  +9 -2      vfolder_menu.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=901693
Comment 16 David Faure 2009-01-07 22:45:48 UTC
*** Bug 179900 has been marked as a duplicate of this bug. ***
Comment 17 David Faure 2009-02-10 00:41:45 UTC
*** Bug 137143 has been marked as a duplicate of this bug. ***