Bug 283658

Summary: menu items created by kmenuedit are not visible in k-menu
Product: [Applications] kmenuedit Reporter: Gerhard <gstengel>
Component: generalAssignee: Ralf Jung <post>
Status: RESOLVED FIXED    
Severity: normal CC: andysem, b.gedzior, cfeck, cmatsuura, fitzcarraldo1, fred.brault, jay, JohnRCox, kitchm, ps3ps3ps3, rhavenn, sxxe, thilo, u.almasov
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed In: 4.7.3
Sentry Crash Report:

Description Gerhard 2011-10-09 17:57:20 UTC
Version:           4.7 (using KDE 4.7.1) 
OS:                Linux

When I create new menu items with kmenuedit, they don't show up in the in the k-menu!

Reproducible: Always

Steps to Reproduce:
1. create a new menu item with kmenuedit
2. save and close the menu editor
3. open k-menu

Actual Results:  
Then new item isn't displayed

Expected Results:  
It should be displayed excactly where it was created with kmenuedit

The root cause seems to be that kmenuedit creates an empty entry 
OnlyShowIn=
in the newly created .desktop file which seems to interpreted by the k-menu as not to show anything (if I change it to OnlyShowIn=KDE; it works).

I think an empty OnlyShowIn= line should be treated exactly as if the line wasn't there at all (as it is the case for most .desktop files). You may disagree, but if it is the desired behaviour not to show anything in the k-menu for an empty OnlyShowIn entry then it's wrong to create an empty OnlyShowIn entry by kmenuedit by default!
Comment 1 Jay LaCroix 2011-10-09 19:46:36 UTC
I have the exact same problem here. Further, if I edit an existing menu item, it will disappear from the KMenu. For example, I changed the name field of K3b to "test" (just to experiment) and it was then removed from the menu.

If I select the tickbox "only show in KDE" I don't have this behavior.

The last time I edited the kmenu in this way, it worked perfectly fine without having to check that box. I don't remember the last version I updated the Kmenu in. Probably 4.7.0.
Comment 2 Jay LaCroix 2011-10-09 19:53:47 UTC
(25821)/kdecore (services) KServicePrivate::init: The desktop entry file 
"/home/jlacroix/.local/share/applications/Test.desktop"  has Type=
"Application"  but no Exec line 

X Error: BadWindow (invalid Window parameter) 3
  Major opcode: 20 (X_GetProperty)
  Resource id:  0x5c03c6c
libpng warning: Malformed iTXt chunk
X Error: BadWindow (invalid Window parameter) 3
  Major opcode: 20 (X_GetProperty)
  Resource id:  0x5c09a3b
X Error: BadWindow (invalid Window parameter) 3
  Major opcode: 20 (X_GetProperty)
  Resource id:  0x5c0b7ba
kmenuedit(25821)/kdecore (services) KServicePrivate::init: The desktop entry
file  "/home/jlacroix/.local/share/applications/K3b.desktop"  has Type=
"Application"  but no Exec line 

X Error: BadWindow (invalid Window parameter) 3
  Major opcode: 20 (X_GetProperty)
  Resource id:  0x5c0d92f
libpng warning: Malformed iTXt chunk
X Error: BadWindow (invalid Window parameter) 3
  Major opcode: 20 (X_GetProperty)
  Resource id:  0x5c10f26
X Error: BadWindow (invalid Window parameter) 3
  Major opcode: 20 (X_GetProperty)
  Resource id:  0x5c1219d
kmenuedit(25821)/kdecore (services) KServicePrivate::init: The desktop entry
file  "/home/jlacroix/.local/share/applications/GParted-4.desktop"  has Type=
"Application"  but no Exec line 

X Error: BadWindow (invalid Window parameter) 3
  Major opcode: 20 (X_GetProperty)
  Resource id:  0x5c13286
libpng warning: Malformed iTXt chunk
X Error: BadWindow (invalid Window parameter) 3
  Major opcode: 20 (X_GetProperty)
  Resource id:  0x5c1627a
Comment 3 Stan 2011-10-10 17:43:14 UTC
Same thing happens to me when just changing an app's icon in kmenu.  =(
Comment 4 Fitzcarraldo 2011-10-10 19:17:59 UTC
his problem happened today to me, too. I'm using KDE 4.7.2.

$ uname -a
Linux meshedgedx 3.0.0-sabayon #1 SMP Tue Aug 30 17:17:33 BST 2011 x86_64 Intel(R) Core(TM) i7 CPU Q 720 @ 1.60GHz GenuineIntel GNU/Linux

I wanted to edit the KDE Menu entries for LibreOffice Calc, to add an export command (export OOO_FORCE_DESKTOP=gnome) to the existing command, as it is not possible to scroll horizontally with LibreOffice Calc in KDE (see e.g. https://bbs.archlinux.org/viewtopic.php?pid=971718#p971718). However, when I made the change to the KDE Menu entries for LibreOffice Calc and LibreOffice Base using kmenuedit, LibreOffice Calc and LibreOffice Base then disappeared from the KDE Menu completely. And the file associations have disappeared from System Settings > File Associations, too.

I have tried kbuildsycoca4 --noincremental but it made no difference.
Comment 5 Gerhard 2011-10-11 19:08:49 UTC
I suppose that any time you touch a menu entry of the k-menu a new .desktop file is written containing the empty OnlyShowIn= entry.
Comment 6 Andy 2011-10-13 13:22:08 UTC
Same here, archlinux KDE 4.7.2
Comment 7 ewa3000 2011-10-15 10:02:22 UTC
I can confirm this bug on KDE 4.7.2 (using Kubuntu 11.10).
The cause appears to be, exactly as Gerhard pointed out, the line "OnlyShowIn=" present in any .desktop file created by KDE Menu Editor (editing or creating a menu entry causes KDE Menu Editor to create a new .desktop file in ~/.local/share/applications; these .desktop files always seem to contain the problematic line). Editing the line to read "OnlyShowIn=KDE;" or simply removing it altogether fixes the problem (that is, the menu item appears as/where it should, with all changes applied).
Since removing this line doesn't seem to cause any problems (and fixes the menu items), perhaps .desktop files created by KDE Menu Editor shouldn't contain it at all?
Comment 8 Andy 2011-10-15 11:08:05 UTC
(In reply to comment #7)
> I can confirm this bug on KDE 4.7.2 (using Kubuntu 11.10).
> The cause appears to be, exactly as Gerhard pointed out, the line "OnlyShowIn="
> present in any .desktop file created by KDE Menu Editor (editing or creating a
> menu entry causes KDE Menu Editor to create a new .desktop file in
> ~/.local/share/applications; these .desktop files always seem to contain the
> problematic line). Editing the line to read "OnlyShowIn=KDE;" or simply
> removing it altogether fixes the problem (that is, the menu item appears
> as/where it should, with all changes applied).
> Since removing this line doesn't seem to cause any problems (and fixes the menu
> items), perhaps .desktop files created by KDE Menu Editor shouldn't contain it
> at all?

This works for me too, thx.
Comment 9 Christoph Feck 2011-10-15 13:13:22 UTC
Regression caused by the patch for bug 190081.
Comment 10 Ralf Jung 2011-10-15 13:47:01 UTC
Git commit 4e19dc1e457aa93ae2ee4e75a8215cf9f2ee3f86 by Ralf Jung.
Committed on 15/10/2011 at 15:42.
Pushed by ralfjung into branch 'master'.

kmenuedit: When the "Only show in" list is empty, remove the item from the .desktop file
An empty list means "show nowhere", a missing item means "show everywhere"

BUG: 283658

M  +9    -2    kmenuedit/basictab.cpp

http://commits.kde.org/kde-workspace/4e19dc1e457aa93ae2ee4e75a8215cf9f2ee3f86
Comment 11 Ralf Jung 2011-10-15 13:49:54 UTC
Git commit d5024022b4e3e976dab63712ff4a2498cdaca507 by Ralf Jung.
Committed on 15/10/2011 at 15:42.
Pushed by ralfjung into branch 'KDE/4.7'.

kmenuedit: When the "Only show in" list is empty, remove the item from the .desktop file An empty list means "show nowhere", a missing item means "show everywhere"

BUG: 283658
FIXED-IN: 4.7.3

M  +9    -2    kmenuedit/basictab.cpp

http://commits.kde.org/kde-workspace/d5024022b4e3e976dab63712ff4a2498cdaca507
Comment 12 Christoph Feck 2011-10-19 02:23:03 UTC
*** Bug 284421 has been marked as a duplicate of this bug. ***
Comment 13 Christoph Feck 2011-10-21 08:15:24 UTC
*** Bug 284593 has been marked as a duplicate of this bug. ***
Comment 14 Christoph Feck 2011-10-22 22:24:12 UTC
*** Bug 284737 has been marked as a duplicate of this bug. ***
Comment 15 Christoph Feck 2011-10-27 13:01:52 UTC
*** Bug 285067 has been marked as a duplicate of this bug. ***
Comment 16 Christoph Feck 2011-10-27 17:36:48 UTC
*** Bug 285099 has been marked as a duplicate of this bug. ***
Comment 17 Dongie Dong 2011-11-05 13:28:43 UTC
*** This bug has been confirmed by popular vote. ***
Comment 18 Christoph Feck 2011-11-07 00:11:26 UTC
*** Bug 283579 has been marked as a duplicate of this bug. ***
Comment 19 Christoph Feck 2011-11-19 16:59:47 UTC
*** Bug 287009 has been marked as a duplicate of this bug. ***
Comment 20 KitchM 2012-01-01 00:58:57 UTC
Using KDE 4.7.4 and KMenuEdit 4.7.4.  The menu items I create and the apps I move into them all disappear.  Don't know where they went, and don't understand why kmenuedit could allow this to happen.  Very annoying and unproductive.  As you can imagine, I have tried a number of times to reach success, but still no joy.
Comment 21 Ralf Jung 2012-01-01 12:55:27 UTC
Could you please describe exactly what you are doing, what happened, and what you expected to happen instead? I actually verified that creating a new menu entry with KDE 4.7.4 works, so I think this is a different bug.
Comment 22 KitchM 2012-01-01 17:41:59 UTC
Yes, I'd be glad to.  I was trying to create new menus, items and rearrange existing menus and items.  During the process, I created, for example, a new group or menu (?) that was entitled "Network & Internet".  I then began moving some things into that menu from other places.  It all looks great in kmenuedit.

I save and close.  Then I look at the menu system and find that it does not exist.

This, as I understand it, is exactly the same problem as the initial reported described.

But it gets worse.  That menu grouping shows up under "Multimedia", instead of the root area.  Opening up kmenuedit clearly shows the Network & Internet group with nothing in it as well as the same one under Multimedia with everything in that one.

I am very worried that kmenuedit is not keeping things as they should be.  What is causing this lack of dependability and accuracy in the application?  If we can see the items in the program, then why does that not show what will actually be?

And it gets still worse.  I had other menus that just disappeared.  I did not delete them.

Hope that helps.
Comment 23 Dongie Dong 2012-01-01 20:24:28 UTC
@tech@frontrowcomputer : did you try to tick 'Only show in KDE' on the items you want to display ? this did the trick for me..
Comment 24 KitchM 2012-01-02 00:17:20 UTC
The problem with that would be that I want them to appear anywhere, everywhere and at any time.

The selection to "Only show in KDE" is one of those extremely odd and meaningless selections users often run across.  I'd first need to know what it is there for and what it actually means.  At this stage, one can only assume the above response to be correct.

Thanks.
Comment 25 Jay LaCroix 2012-01-02 00:49:05 UTC
My understanding is that "show only in KDE" means exactly that, if you have XFCE or another desktop environment, the option will make the icon exclusive to KDE. This is hardly a solution, because a lot people have multiple environments.
Comment 26 KitchM 2012-01-02 02:32:27 UTC
Right you are.  And worse, no one desktop has everything we need, so we end up piecing together bits and pieces from various places until we get something usable.  The good part is that Linux gives us that option.  The bad part is that every programmer does not make their stuff standalone.  And working with KDE appears to be, IMHO, one of the latter problem.
Comment 27 KitchM 2012-01-02 02:38:55 UTC
Also, while your point is a good supposition, I also assume the items become invisible.  However, I am using KDE, so the issue is moot.

Thanks.
Comment 28 KitchM 2012-01-02 18:00:38 UTC
We need this bug reopened.  It is most certainly not resolved.  The program fails to run on its own and I believe its interrelationship with other DE components is causing this problem.
Comment 29 Ralf Jung 2012-01-02 18:07:36 UTC
This bug is (was) about newly created items (not submenus) would not appear. That one is fixed, as I just verified again.
I am still unable to reproduce the problem you describe, since you did not give me a step-by-step list of instructions. I created various submenus, added items to them, and they would all show up in the K-Menu.
Comment 30 KitchM 2012-01-02 20:24:11 UTC
Okay, I get it.  This is about items (meaning program listings) rather than sub-menus (items that hold other items.).

Thanks for  pointing out that distinction.  I will start another bug.