Merge lp:~therigu/unity-lens-applications/menu-entries-without-categories into lp:unity-lens-applications

Proposed by Adam Guthrie
Status: Rejected
Rejected by: Mikkel Kamstrup Erlandsen
Proposed branch: lp:~therigu/unity-lens-applications/menu-entries-without-categories
Merge into: lp:unity-lens-applications
Diff against target: 79 lines (+33/-20)
1 file modified
src/unity-package-search.cc (+33/-20)
To merge this branch: bzr merge lp:~therigu/unity-lens-applications/menu-entries-without-categories
Reviewer Review Type Date Requested Status
Mikkel Kamstrup Erlandsen (community) Disapprove
Review via email: mp+35922@code.launchpad.net

Description of the change

Allow gmenu entries without categories in their respective .desktop files to be indexed whilst still protecting against the case where unity cannot retrieve information from said .desktop file. LP: #635223

To post a comment you must log in.
Revision history for this message
Mikkel Kamstrup Erlandsen (kamstrup) wrote :

Considering the conclusions on the linked bug - i'll re-review this once we are out of Maverick release frenzy.

Sorry to keep you waiting. I assure you that your work is much appreciated!

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

Finally some updates! :-)

I need to disapprove this branch as the underlying codebase for the apps place has shifted somewhat since this branch' inception. The good news is that I have applied the same approach in another branch, and together with the a patch to Unity have Wine apps working here now :-)

So thanks for pioneering this Adam!

review: Disapprove

Unmerged revisions

100. By Adam Guthrie

Allow gmenu entries without categories in their respective .desktop files to indexed whilst still protecting against the case where unity cannot retrieve information from said .desktop file.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/unity-package-search.cc'
--- src/unity-package-search.cc 2010-09-14 11:30:09 +0000
+++ src/unity-package-search.cc 2010-09-18 13:41:47 +0000
@@ -92,6 +92,7 @@
92 GMenuTreeEntry *entry;92 GMenuTreeEntry *entry;
93 UnityAppInfoManager *appman;93 UnityAppInfoManager *appman;
94 GeeList *cats;94 GeeList *cats;
95 GAppInfo *appinfo;
95 GeeIterator *cats_iter;96 GeeIterator *cats_iter;
96 gchar *dum1, *dum2, *dum3;97 gchar *dum1, *dum2, *dum3;
9798
@@ -138,35 +139,47 @@
138 139
139 /* Index the XDG categories */140 /* Index the XDG categories */
140 appman = unity_app_info_manager_get_instance ();141 appman = unity_app_info_manager_get_instance ();
141 cats = unity_app_info_manager_get_categories (appman,142 appinfo = unity_app_info_manager_lookup (appman,
142 gmenu_tree_entry_get_desktop_file_id (entry));143 gmenu_tree_entry_get_desktop_file_id (entry));
143 144
144 /* For unknown desktop ids the app info manager returns NULL.145 /* For unknown desktop ids the app info manager returns NULL.
145 * Also happens for many NoDisplay app infos, so it's not an error146 * Also happens for many NoDisplay app infos, so it's not an error
146 * case as such */147 * case as such */
147 if (cats == NULL)148 if (appinfo == NULL)
148 {149 {
149 //g_debug ("Unable to probe XDG categories for %s",150 g_debug ("Unable to probe info for %s",
150 // gmenu_tree_entry_get_desktop_file_id (entry));151 gmenu_tree_entry_get_desktop_file_id (entry));
151 g_object_unref (appman);152 g_object_unref (appman);
152 break;153 break;
153 }154 }
154 155
155 cats_iter = GEE_ITERATOR (gee_list_list_iterator (cats));156 cats = unity_app_info_manager_get_categories (appman,
156 while (gee_iterator_next (cats_iter))157 gmenu_tree_entry_get_desktop_file_id (entry));
157 {158
158 // FIXME: Free dum1?159 if (cats == NULL)
159 dum1 = (gchar*) gee_iterator_get (cats_iter);160 {
160 dum2 = g_ascii_strdown (dum1, -1);161 //g_debug ("Unable to probe XDG categories for %s",
161 dum3 = g_strconcat ("AC", dum2, NULL);162 // gmenu_tree_entry_get_desktop_file_id (entry));
162 doc.add_term (dum3);163 g_object_unref (appman);
163 g_free (dum1);164 }
164 g_free (dum2);165 else
165 g_free (dum3);166 {
166 }167 cats_iter = GEE_ITERATOR (gee_list_list_iterator (cats));
167 g_object_unref (cats_iter);168 while (gee_iterator_next (cats_iter))
168 g_object_unref (cats);169 {
169 g_object_unref (appman);170 // FIXME: Free dum1?
171 dum1 = (gchar*) gee_iterator_get (cats_iter);
172 dum2 = g_ascii_strdown (dum1, -1);
173 dum3 = g_strconcat ("AC", dum2, NULL);
174 doc.add_term (dum3);
175 g_free (dum1);
176 g_free (dum2);
177 g_free (dum3);
178 }
179 g_object_unref (cats_iter);
180 g_object_unref (cats);
181 g_object_unref (appman);
182 }
170 183
171 /* Always assume Type=Application for items in a menu... */184 /* Always assume Type=Application for items in a menu... */
172 doc.add_term ("ATapplication");185 doc.add_term ("ATapplication");

Subscribers

People subscribed via source and target branches