Bug 283579 - Every new app is hidden
Summary: Every new app is hidden
Status: RESOLVED DUPLICATE of bug 283658
Alias: None
Product: kmenuedit
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Unassigned bugs mailing-list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-08 03:55 UTC by bartek
Modified: 2011-11-07 00:11 UTC (History)
9 users (show)

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


Attachments
Only write out the OnlyShowIn field if we didn't empty it. (975 bytes, patch)
2011-10-31 11:12 UTC, Gard Spreemann
Details
Only write out the OnlyShowIn field if we didn't empty it. (1008 bytes, patch)
2011-10-31 18:47 UTC, Gard Spreemann
Details
Avoid writing out an empty OnlyShowIn field unless it was already explicitly empty. (1.02 KB, patch)
2011-11-01 07:45 UTC, Gard Spreemann
Details

Note You need to log in before you can comment on or make changes to this bug.
Description bartek 2011-10-08 03:55:11 UTC
Version:           unspecified (using KDE 4.7.1) 
OS:                Linux

First of all I'm using KDE 4.7.2 (latest version on the list shown on this site was 4.7.1).

When I add a new app in kmenuedit it is not shown in menu. After restarting kmenuedit added app is not shown also. I've found that after enabling in kmenuedit configuration option "show hidden positions" my added apps are shown - only in kmenuedit, in kickoff their are not shown anyway.

I have of course checked ~/.local/share/applications and found new *.desktop file added. I even tried to delete /var/tmp/kdecache-$USER dir and creating a new user. Problem existed every time.




Reproducible: Always

Steps to Reproduce:
- add a new app in kmenuedit
- close kmenuedit
- check kickoff
- open kmenuedit
- enable "show hidden positions" option
- close kmenuedit
- check kickoff


Expected Results:  
Possibility to add a new position to menu.
Comment 1 bartek 2011-10-08 04:13:48 UTC
I've forgotten important information. Moving and deleting existing entries works fine.
Comment 2 regi.hops 2011-10-13 16:30:06 UTC
Hi,

can confirm "bartek's" description, same here.
Manual added applications are not visible.

System: openSUSUE 11.4 x86_64, KDE 4.7.2 "release 9".
Comment 3 Pyroman 2011-10-18 19:20:39 UTC
I confirm this problem. Just edit any app in kmenuedit and it disappears from menu.
KDE 4.7.2, Kubuntu 11.10 32 bit.
Comment 4 Kirill 2011-10-18 19:31:51 UTC
*** This bug has been confirmed by popular vote. ***
Comment 5 Nikita Skovoroda 2011-10-19 01:41:43 UTC
I can reproduce this on git20111011.
Comment 6 Gard Spreemann 2011-10-24 21:07:51 UTC
I'm seeing the same thing (KDE 4.7.2, Kubuntu 11.10). Since the items do show up in kmenuedit (after enabling "show hidden positions" according to the reporter) and in .local/share/applications, is it not more likely that the bug resides within the application launcher?
Comment 7 Chris Rizzitello 2011-10-26 13:17:19 UTC
the bug appers to be in the menu applet itself. if you use the QML menu widget the entries are shown.

at first i suspected bug#99420 (below is the comment)

This Bug is affecting me on kde 4.7.2!

make a menu entry then save the menu, the entry doesn't show in the menu at
all. after saving it shows updating system dialog, but the entry is not in the
menu. if you open the menu editor the entry will be gone. i also edited a menu
entry of an installed program and after saving the menu editor the entry was in
my menu (with modified parts) but once again after a log out/ login the
modified entry is removed.
Comment 8 tja 2011-10-31 09:56:55 UTC
confirm.
i guess this is due new .desktop files get a whole bunch of settings including

OnlyShowIn=

if "only for KDE" is  NOT checked of course.
removing the line via editor will let kbuildsycoca4 generate the correct entry in the menu.

i found a patch/diff https://git.reviewboard.kde.org/r/102713/diff/ which seems wrong to me. if i read it correctly (no CPP guru here) line 458-462 would suggest that OnlyShowIn gets written even if its empty but if i interpret the freedesktop docs correctly this would be wrong.

i guess the patch is applied in kubuntu 11.10 already as the original source would not behave like that (again im no CPP guy).
Comment 9 Gard Spreemann 2011-10-31 10:21:02 UTC
(In reply to comment #8)
> confirm.
> i guess this is due new .desktop files get a whole bunch of settings including
> 
> OnlyShowIn=
> 
> if "only for KDE" is  NOT checked of course.
> removing the line via editor will let kbuildsycoca4 generate the correct entry
> in the menu.
> 
> i found a patch/diff https://git.reviewboard.kde.org/r/102713/diff/ which seems
> wrong to me. if i read it correctly (no CPP guru here) line 458-462 would
> suggest that OnlyShowIn gets written even if its empty but if i interpret the
> freedesktop docs correctly this would be wrong.

Interesting. I agree with your interpretation: If a .desktop file has an OnlyShowIn=KDE field and the only show in KDE box is not checked in KMenuEdit, then it will write an *empty* OnlyShowIn field. If I read the Freedesktop specification [1] correctly, this means the entry described by the .desktop file should *not be shown by any* desktop environment. Thus KDE's menu (correctly) does not show it.

[1] http://standards.freedesktop.org/menu-spec/latest/ar01s03.html
Comment 10 tja 2011-10-31 10:35:25 UTC
> Interesting. I agree with your interpretation: If a .desktop file has an
> OnlyShowIn=KDE field and the only show in KDE box is not checked in KMenuEdit,
> then it will write an *empty* OnlyShowIn field. If I read the Freedesktop
> specification [1] correctly, this means the entry described by the .desktop
> file should *not be shown by any* desktop environment. Thus KDE's menu
> (correctly) does not show it.

yeah, additionally new empty entries with initially unchecked "only show in KDE" will be written with OnlyShowIn= too so it doesnt depend on setting the checkbox once and revert it later, the wrong line gets added either way.
Comment 11 Gard Spreemann 2011-10-31 11:12:38 UTC
Created attachment 65068 [details]
Only write out the OnlyShowIn field if we didn't empty it.

Patch against KDE 4.7.2. Based on comment #8. I don't have time to test the patch yet.
Comment 12 Gard Spreemann 2011-10-31 18:47:20 UTC
Created attachment 65087 [details]
Only write out the OnlyShowIn field if we didn't empty it.

I just got around to testing the previous patch, and I made a mistake in it. Here's another attempt, which I won't have time to test right away either. I know sending out these untested patches isn't the best way to do things, but I'll do it once more just in case someone suddenly finds the time to test this (or come up with something better). 

Hopefully this patch avoids writing an empty OnlyShowIn field *unless* the .desktop file already had such a thing (I guess it's valid to have such an empty field according to the specification, so we shouldn't just remove it?).
Comment 13 tja 2011-11-01 07:15:22 UTC
> Hopefully this patch avoids writing an empty OnlyShowIn field *unless* the
> .desktop file already had such a thing (I guess it's valid to have such an
> empty field according to the specification, so we shouldn't just remove it?).

i would remove it if its empty as
a) i see no reasonable use-case for an empty OnlyShowIn
b) the user would have no way to remove it via the current menuedit GUI if he desires so
. but the specs are unclear on this topic.
Comment 14 Gard Spreemann 2011-11-01 07:45:01 UTC
Created attachment 65103 [details]
Avoid writing out an empty OnlyShowIn field unless it was already explicitly empty.

I've now had the time to test this version of the patch, and it works as desired: If an entry has a present and empty OnlyShowIn field, we don't touch it (this isn't relevant, as such entries won't even show up in kmenuedit, but I'm just making sure). Else, if we empty out an OnlyShowIn field, then we delete it from the .desktop file.

(Ubuntu users can also get a prebuilt KDE with only this patch added from my PPA: https://launchpad.net/~gspreemann/+archive/experimental )
Comment 15 Gard Spreemann 2011-11-01 07:51:45 UTC
(In reply to comment #13)
> i would remove it if its empty as
> a) i see no reasonable use-case for an empty OnlyShowIn
> b) the user would have no way to remove it via the current menuedit GUI if he
> desires so

I think the specs are pretty clear (the empty list is a list, afterall), but I also agree that it makes little sense to have an empty OnlyShowIn, and that kmenuedit won't even be able to see such entries. However, I guess it's possible that at some point kmenuedit gets an option to forcibly ignore OnlyShowIn when listing entries (maybe for people who'd like to edit every DE's menu from kmenuedit?). Not handling the explicitly empty OnlyShowIn list would break such entries in that case.
Comment 16 Lorenzo Ferretti 2011-11-01 18:15:19 UTC
(In reply to comment #14)
> Created an attachment (id=65103) [details]
> Avoid writing out an empty OnlyShowIn field unless it was already explicitly
> empty.
> 
> I've now had the time to test this version of the patch, and it works as
> desired: If an entry has a present and empty OnlyShowIn field, we don't touch
> it (this isn't relevant, as such entries won't even show up in kmenuedit, but
> I'm just making sure). Else, if we empty out an OnlyShowIn field, then we
> delete it from the .desktop file.
> 
> (Ubuntu users can also get a prebuilt KDE with only this patch added from my
> PPA: https://launchpad.net/~gspreemann/+archive/experimental )

Please let me know the name (in the suggested PPA) of the package  containing 
the patch. Based on the release date may be "kde-workspace", but the presence of the kmenuedit executable is not visible.
Comment 17 Gard Spreemann 2011-11-01 21:10:18 UTC
(In reply to comment #16)
> Please let me know the name (in the suggested PPA) of the package  containing 
> the patch. Based on the release date may be "kde-workspace", but the presence
> of the kmenuedit executable is not visible.

It's kde-workspace-bin (source package kde-workspace). If you have further questions regarding stuff in the PPA, I suggest you e-mail me directly, as we probably shouldn't use the KDE bugzilla to discuss Ubuntu packages.
Comment 18 regi.hops 2011-11-05 20:18:20 UTC
Hi,

I just updated KDE to version 4.7.3 "release 10" on openSUSE 11.4 x86-64 and it works fine now.

I added a new menu entry and it shows up like it should.

Thanks a lot
Cheers Regi
Comment 19 Nikita Skovoroda 2011-11-05 20:30:03 UTC
Everything is all right for me now on git20111031, was broken on git20111011.
Comment 20 bartek 2011-11-06 00:00:35 UTC
I can confirm it's fixed in 4.7.3.
Comment 21 Christoph Feck 2011-11-07 00:11:26 UTC

*** This bug has been marked as a duplicate of bug 283658 ***