Merge lp:~robertcarr/libunity/desktopfile-paths into lp:libunity

Proposed by Robert Carr
Status: Merged
Approved by: Alex Launi
Approved revision: no longer in the source branch.
Merged at revision: 71
Proposed branch: lp:~robertcarr/libunity/desktopfile-paths
Merge into: lp:libunity
Diff against target: 29 lines (+4/-1)
1 file modified
src/unity-appinfo-manager.vala (+4/-1)
To merge this branch: bzr merge lp:~robertcarr/libunity/desktopfile-paths
Reviewer Review Type Date Requested Status
Mikkel Kamstrup Erlandsen (community) Disapprove
Alex Launi (community) Approve
Review via email: mp+74447@code.launchpad.net

Description of the change

When loading the DesktopAppInfos we should construct it from the .desktop file rather than from the KeyFile we have already loaded. This is a little bad in terms of IO, but library users need to be able to call _get_filename on the returned AppInfo (i.e. application lens)

To post a comment you must log in.
Revision history for this message
Alex Launi (alexlauni) wrote :

+1

review: Approve
Revision history for this message
Mikkel Kamstrup Erlandsen (kamstrup) wrote :

Can we please back this out? We are already getting complaints about disk thrashing - we can't add any more.

review: Disapprove

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/unity-appinfo-manager.vala'
2--- src/unity-appinfo-manager.vala 2011-02-04 13:05:22 +0000
3+++ src/unity-appinfo-manager.vala 2011-09-07 14:55:24 +0000
4@@ -132,8 +132,10 @@
5 /* Look up by path or by desktop id */
6 AppInfo? appinfo;
7 KeyFile? keyfile = new KeyFile ();
8+ string desktop_file_path = null;
9 if (id.has_prefix("/"))
10 {
11+ desktop_file_path = id;
12 try {
13 keyfile.load_from_file (id, KeyFileFlags.NONE);
14 } catch (Error e) {
15@@ -167,12 +169,13 @@
16 if (!(e is IOError.NOT_FOUND || e is KeyFileError.NOT_FOUND))
17 warning ("Error loading '%s': %s", id, e.message);
18 }
19+ desktop_file_path = full_path;
20 }
21
22 /* If keyfile is null we had an error loading it */
23 if (keyfile != null)
24 {
25- appinfo = new DesktopAppInfo.from_keyfile (keyfile);
26+ appinfo = new DesktopAppInfo.from_filename (desktop_file_path);
27 try {
28 string[] categories = keyfile.get_string_list ("Desktop Entry",
29 "Categories");

Subscribers

People subscribed via source and target branches