Bug 156339 - Error message when closing Kwrite
Summary: Error message when closing Kwrite
Status: RESOLVED FIXED
Alias: None
Product: kdelibs
Classification: Frameworks and Libraries
Component: klauncher (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: David Faure
URL:
Keywords:
: 155905 167978 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-01-21 21:46 UTC by Sam
Modified: 2009-01-15 01:11 UTC (History)
5 users (show)

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 Sam 2008-01-21 21:46:21 UTC
Version:            (using Devel)
Installed from:    Compiled sources
OS:                Linux

When opening a text file in dolphin or konqueror Kwrite starts without problems.
But after a while an error message pops up which tells that "Klauncher is not reachable by D-Bus Error while accessing start_service_by_desktop_path: empty". Kwrite works still without problems.



But when i close Kwrite 2-3 seconds after is has been started another error pops up: "KDEinit can't start usr/bin/kwrite"
And Kwrite is beeing started automatically once again. 
When i close it the second time the last error pops up again but kwrite is beeing closed correctly.

Hope this is understandable.
Comment 1 Sam 2008-01-21 21:48:00 UTC
Oh I forgot to mention: I'm using the latest Opensuse-KDE4.0 RPMs
Comment 2 David Faure 2008-01-22 01:17:00 UTC
This is a setup problem, the wrong kwrite.desktop is being found.
Do you have a kwrite.desktop in ~/.kde (~/.kde4)?
Otherwise it's the system one that is being found, which is definitely a (OpenSuse?) setup problem.
Comment 3 Sam 2008-01-22 17:54:07 UTC
In opensuse all .desktop files are located in /usr/share/applications/kde4.
There is a kwrite.desktop file, too.

I noticed that the bug doesn't appear when kwrite is started from Konsole.
Comment 4 David Faure 2008-01-22 20:09:30 UTC
> In opensuse all .desktop files are located in /usr/share/applications/kde4.
> There is a kwrite.desktop file, too.

But there are KDE-3 desktop files around too, right?

You didn't explicitely answer about whether your KDE usage created a kwrite.desktop in ~/.kde or ~/.kde4, too.
Comment 5 Sam 2008-01-22 20:44:23 UTC
No i don't think there are kde3 .desktop files. At least there is no kontact.desktop, kmail.desktop etc. But i'm not 100% shure. How to find out?

No there are no .desktop files in ~/.kde or ~/.kde4.
Comment 6 David Faure 2008-01-23 10:22:46 UTC
find /usr/share -name kwrite.desktop
find ~/.kde* -name kwrite.desktop


Also, does /usr/share/applications/kde4/kwrite.desktop have those lines?
X-DBUS-StartupType=Multi
X-DBUS-ServiceName=org.kate-editor.kwrite
Comment 7 Sam 2008-01-24 00:31:27 UTC
There is just the kwrite.desktop in /usr/share/applications/kde4/.

Yes it has the two lines.
Comment 8 George Kiagiadakis 2008-03-21 11:59:37 UTC
Same bug here too with 4.0.2 on debian. It doesn't only happen with kwrite but also with kate, kword, krita and others, but there are some apps like okular that work fine.

Some notes:
- When I close kwrite, sometimes it respawns after I click ok on the error message but sometimes it doesn't. It's a totally random behaviour.
- The dbus error message only appears if I keep kwrite open for more than 20-30 seconds. During these 20-30 secs, the browser app (konq/dolphin) is not repainted, which means it is out of the event loop, probably waiting for a reply via dbus. If I close kwrite before 20-30 secs have passed, the message "Could not launch /usr/bin/kwrite" appears but the dbus error message doesn't and dolphin/konq is repainted imediately.
- These messages also appear when launching apps from the "Run command" dialog and from there, I can also confirm that the "Could not launch ..." message appears also when launching kde 3.5.9 apps like kmail or akregator.

About the kwrite.desktop, there is a kwrite.desktop in /usr/share/applications/kde4/ and it does have the two "X-DBUS..." lines.
Comment 9 David Faure 2008-03-21 12:39:34 UTC
On Friday 21 March 2008, George Kiagiadakis wrote:
> About the kwrite.desktop, there is a kwrite.desktop in /usr/share/applications/kde4/ and it does have the two "X-DBUS..." lines.

Yes but isn't there also a kwrite.desktop in /usr/share/applications/kde3, or somewhere else in the search path shown by "kde4-config --path xdgdata-apps" ?
Comment 10 George Kiagiadakis 2008-03-22 19:39:50 UTC
>Yes but isn't there also a kwrite.desktop in /usr/share/applications/kde3, or somewhere else in the search path shown by "kde4-config --path xdgdata-apps" ?

Nope... see yourself. Any other ideas?

gkiagia@gklaptop:~$ kde4-config --path xdgdata-apps
/home/gkiagia/.local/share/applications/:/usr/share/applications/:/usr/local/share/applications/
gkiagia@gklaptop:~$ find /home/gkiagia/.local/share/applications/ -name kwrite.desktop
gkiagia@gklaptop:~$ find /usr/share/applications/ -name kwrite.desktop
/usr/share/applications/kde4/kwrite.desktop
gkiagia@gklaptop:~$ find /usr/local/share/applications/ -name kwrite.desktop
gkiagia@gklaptop:~$
Comment 11 George Kiagiadakis 2008-03-22 20:36:18 UTC
Update: There was a kde3 version of kwrite.desktop in /usr/share/app-install/desktop but I replaced it with the kde4 version from /usr/share/applications/kde4 and restarted KDE, but there is still no difference.
Comment 12 George Kiagiadakis 2008-03-27 15:08:58 UTC
David, I solved it. You were right about the desktop file. There is indeed a file called ~/.local/share/applications/kde-kwrite.desktop which seems to be the kde3 version of kwrite.desktop. The mime type text/plain was associated with this file. What I did was that I removed the association with kwrite and then added it again. Voila! Problem solved. I wonder how I didn't notice that before...

The thing is that ~/.local/share/applications seems to have many wierd files...
For example, apart from kde-kwrite.desktop, there is also a kde4-kwrite.desktop and the same for kate, kword, kmplayer and also for amarok (kde4-amarok.dekstop), although I don't have ever installed the kde4 version of amarok. Which app creates all this crap?

Anyway, this bug seems to be invalid. Also, bug #155873 seems to be a duplicate ;)
Comment 13 David Faure 2008-03-27 18:37:30 UTC
On Thursday 27 March 2008, George Kiagiadakis wrote:
> Which app creates all this crap?


The filetypes association module, and the open-with dialog, used to create a local .desktop
file when the user added a new mimetype-application association.

This is fixed now, using the new mimeapps.list file instead of generating local .desktop file copies,
because of all the problems generated by such local .desktop files - your problem is one of them :)
Comment 14 David Faure 2008-05-09 19:32:15 UTC
SVN commit 805921 by dfaure:

Remove reading of X-DCOP-ServiceType from desktop files -- this was a bad idea.
When launching a kde3 application, it's going to register to DCOP, not to DBUS, so if
klauncher waits for DBUS registration (because of this key being parsed as if it was X-DBUS-StartupType),
it will show a "could not start" error message...
BUG: 156339, 155873


 M  +0 -6      kservice.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=805921
Comment 15 David Faure 2008-05-16 18:49:10 UTC
*** Bug 155905 has been marked as a duplicate of this bug. ***
Comment 16 f.pezzato 2008-07-04 10:06:23 UTC
The same problem appears when opening a text file in dolphin using Kate (invoked with "open with").
The problem occurred in version 4.0.83, kubuntu packages. 
Comment 17 George Kiagiadakis 2008-08-01 16:34:39 UTC
*** Bug 167978 has been marked as a duplicate of this bug. ***
Comment 18 George Kiagiadakis 2008-08-01 16:42:12 UTC
I don't really think this is fixed in 4.0.5 and 4.1 as David says in bug 155905 comment 15. The last report I marked as duplicate was from a 4.0.5 user and I can also confirm that bug 155873 (which should have been fixed by that patch in comment 14) is still valid in 4.1.0.
Comment 19 George Kiagiadakis 2008-08-13 23:07:11 UTC
Reopening. I found a standard way to reproduce it in KDE 4.1.0. I have kword 2.0 alpha 9 installed from debian packages. If I try to open a file in dolphin with kword or open kword from krunner, this klauncher error message appears.

The affecting .desktop file is this one (I have only removed the various localization messages as they are probably not relevant):

[Desktop Entry]
Type=Application
Name=KWord
Exec=kword %u
GenericName=Word Processor
Comment=Write text documents
MimeType=application/vnd.oasis.opendocument.text;application/x-kword;application/msword;application/rtf;text/plain;application/x-mswrite;
Icon=kword
X-KDE-NativeMimeType=application/vnd.oasis.opendocument.text
#X-KDE-NativeMimeType=application/x-kword
X-DocPath=kword/index.html
X-KDE-StartupNotify=true
X-DBUS-StartupType=Multi
Categories=Qt;KDE;Office;
InitialPreference=3


PS: this time I checked it, it's *that* file and not some other in my ~/.local. Even if I go to /usr/share/applications/kde4 in dolphin and click on this kword.desktop, the error message appears.
Comment 20 David Faure 2008-08-14 11:23:20 UTC
See bug 157853.
Double-check which dbus name kword registers as (simply type "qdbus" in a terminal)
and try adding X-DBUS-ServiceName=org.kde.kword (or whatever the name is, without the PID)
to the dekstop file.
Comment 21 George Kiagiadakis 2008-08-14 14:38:59 UTC
Ok, adding X-DBUS-ServiceName=org.koffice.kword fixes it. I guess that should be fixed in all koffice applications as they all do not seem to have such a line in their .desktop files.

However, I still don't understand why we need this dbus check. kword and most applications that I have seen will launch fine even without the check.

PS: I am not really sure if I should close again that bug. Do as you wish, David.
Comment 22 Dario Andres 2008-08-16 15:28:05 UTC
May be bug 164864 is related/duplicate to this.
Comment 23 A. Spehr 2008-10-26 23:13:15 UTC
bug #122604 generates this error, if you need something slightly more complicated to test
Comment 24 Dario Andres 2008-12-28 15:54:41 UTC
Have anyone experienced this bug again with a recent KDE version recently? (4.1.3 / 4.2beta2 / 4.2svn) ?  Thanks :)
Comment 25 Sam 2008-12-30 15:17:02 UTC
No. It works for me. At least with 4.1.3(In reply to comment #24)
> Have anyone experienced this bug again with a recent KDE version recently?
> (4.1.3 / 4.2beta2 / 4.2svn) ?  Thanks :)
> 

No. It works for me. 
At least with 4.1.3. But I've not tested 4.2 until now.
Comment 26 David Faure 2009-01-09 02:08:42 UTC
The answer to "However, I still don't understand why we need this dbus check." is now up at http://techbase.kde.org/Development/Architecture/KDE4/Starting_Other_Programs#klauncher

About the koffice apps, you're right, they register as org.koffice.*, and don't specify that in their desktop file... so indeed they should lead to the klauncher error message, but here I can't seem to reproduce that bug... strange, I'll have to look into it more...
Comment 27 David Faure 2009-01-09 02:14:59 UTC
Ah the wrong kword desktop file was used. Indeed, I can reproduce the bug now. Will fix.
Comment 28 David Faure 2009-01-09 02:58:33 UTC
SVN commit 907990 by dfaure:

Add missing X-DBUS-ServiceName=org.koffice.kmyapp lines in order to fix the klauncher error msg when starting
koffice apps by clicking on a file in a filemanager for instance. (I did kword and kpresenter in a separate commit).
Fix will be in koffice-2.0-beta6
BUG: 156339


 M  +1 -0      filters/krita/bmp/krita_bmp.desktop  
 M  +1 -0      filters/krita/openexr/krita_openexr.desktop  
 M  +1 -0      filters/krita/png/krita_png.desktop  
 M  +1 -0      filters/krita/raw/krita_raw.desktop  
 M  +1 -0      kchart/kchart.desktop  
 M  +1 -0      kformula/kformula.desktop  
 M  +1 -0      kivio/src/part/kivio.desktop  
 M  +1 -0      krita/krita.desktop  
 M  +1 -1      krita/sdk/templates/filefilter/krita_APPNAMELC.desktop  
 M  +1 -0      kspread/kspread.desktop  


WebSVN link: http://websvn.kde.org/?view=rev&revision=907990
Comment 29 David Faure 2009-01-15 01:11:55 UTC
For info: for kde-4.2 I also made klauncher more tolerant so that kword registering as org.koffice.kword works even without the key in the desktop file, i.e. klauncher expects something of the form "*.kword", any domainname works -- see bug 75492 comment 32.