Merge lp:~nonamenoname/slingshot/fix-1084101 into lp:~elementary-pantheon/slingshot/trunk

Proposed by No Name
Status: Merged
Approved by: Danielle Foré
Approved revision: 421
Merged at revision: 416
Proposed branch: lp:~nonamenoname/slingshot/fix-1084101
Merge into: lp:~elementary-pantheon/slingshot/trunk
Diff against target: 102 lines (+31/-1)
4 files modified
data/pantheon-applications.menu (+14/-0)
src/Backend/App.vala (+2/-0)
src/Backend/AppSystem.vala (+10/-1)
src/Widgets/CategoryView.vala (+5/-0)
To merge this branch: bzr merge lp:~nonamenoname/slingshot/fix-1084101
Reviewer Review Type Date Requested Status
Corentin Noël Approve
Danielle Foré Approve
David Gomes (community) Needs Fixing
Review via email: mp+217023@code.launchpad.net

Commit message

Allows plugs to display in Slingshot search

Description of the change

Allows plugs display in slingshot. Only available in serach and category view. Part of #1084101

To post a comment you must log in.
Revision history for this message
Corentin Noël (tintou) wrote :

This should take the OnlyShowIn parameter in account, here the gnome-region-panel.desktop is shown even if
OnlyShowIn=GNOME;

review: Needs Fixing
Revision history for this message
Corentin Noël (tintou) wrote :

Okay after talking, this is a problem from other packages that ships desktop files with NotShowIn

review: Approve
Revision history for this message
David Gomes (davidgomes) wrote :

Add newline after diff line 75.

review: Needs Fixing
Revision history for this message
Corentin Noël (tintou) wrote :

The elementary UX team has to review this, I'm not sure the System Settings section was the aim of this bug

Revision history for this message
Danielle Foré (danrabbit) wrote :

After some discussion with Corentin, let's please remove the entry from the category view. We want these to show up in search but since they aren't apps we don't want them mixed in with apps.

review: Needs Fixing
Revision history for this message
No Name (nonamenoname) wrote :

Removed application menu, are we good to go?

Revision history for this message
Danielle Foré (danrabbit) wrote :

Yep, let's do this!

review: Approve
Revision history for this message
Danielle Foré (danrabbit) wrote :

Wait, actually, they still show in "Other" any way around that?

Revision history for this message
No Name (nonamenoname) wrote :

> Wait, actually, they still show in "Other" any way around that?

When not having the items in a category GMenu won't load them. I think i revert the change and then hide the "System Settings" category in the UI only.

420. By No Name

hide Switchboard Plugs in category view

Revision history for this message
No Name (nonamenoname) wrote :

I think i achieved the correct behaviour. On my fresh install there is no system settings category and also no "Other". Corentin can you verify and then approve?

421. By No Name

forgot removing debug output

Revision history for this message
Corentin Noël (tintou) wrote :

That's the intended behavior indeed !

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'data/pantheon-applications.menu'
2--- data/pantheon-applications.menu 2013-10-05 11:42:23 +0000
3+++ data/pantheon-applications.menu 2014-04-27 21:12:14 +0000
4@@ -220,4 +220,18 @@
5 <Directory>Debian.directory</Directory>
6 </Menu>
7
8+ <!-- Switchboard menu -->
9+ <Menu>
10+ <Name>switchboard</Name>
11+ <Directory>Switchboard.directory</Directory>
12+ <Include>
13+ <And>
14+ <Or>
15+ <Category>X-PANTHEON-Switchboard-Plugs</Category>
16+ <Category>X-GNOME-Settings-Panel</Category>
17+ </Or>
18+ </And>
19+ </Include>
20+ </Menu>
21+
22 </Menu> <!-- End Applications -->
23
24=== modified file 'src/Backend/App.vala'
25--- src/Backend/App.vala 2013-01-10 16:53:50 +0000
26+++ src/Backend/App.vala 2014-04-27 21:12:14 +0000
27@@ -28,6 +28,7 @@
28 public double popularity { get; set; }
29 public double relevancy { get; set; }
30 public string desktop_path { get; private set; }
31+ public string categories { get; private set; }
32 public string generic_name { get; private set; default = ""; }
33
34 private bool is_command = false;
35@@ -45,6 +46,7 @@
36 #if HAVE_UNITY
37 keywords = Unity.AppInfoManager.get_default ().get_keywords (desktop_id);
38 #endif
39+ categories = info.get_categories ();
40 generic_name = info.get_generic_name ();
41
42 if (info.get_icon () is ThemedIcon) {
43
44=== modified file 'src/Backend/AppSystem.vala'
45--- src/Backend/AppSystem.vala 2014-03-01 15:19:12 +0000
46+++ src/Backend/AppSystem.vala 2014-04-27 21:12:14 +0000
47@@ -18,6 +18,9 @@
48
49 public class Slingshot.Backend.AppSystem : Object {
50
51+ const string GCC_PANEL_CATEGORY = "X-GNOME-Settings-Panel";
52+ const string SWITCHBOARD_PLUG_CATEGORY = "X-PANTHEON-Switchboard-Plug";
53+
54 private Gee.ArrayList<GMenu.TreeDirectory> categories = null;
55 private Gee.HashMap<string, Gee.ArrayList<App>> apps = null;
56 private GMenu.Tree apps_menu = null;
57@@ -93,8 +96,9 @@
58
59 apps.clear ();
60
61- foreach (var cat in categories)
62+ foreach (var cat in categories) {
63 apps.set (cat.get_name (), get_apps_by_category (cat));
64+ }
65
66 }
67
68@@ -156,6 +160,11 @@
69
70 foreach (Gee.ArrayList<App> category in apps.values) {
71 foreach (App app in category) {
72+
73+ if (GCC_PANEL_CATEGORY in app.categories || SWITCHBOARD_PLUG_CATEGORY in app.categories)
74+ continue;
75+
76+
77 if (!(app.exec in sorted_apps_execs)) {
78 sorted_apps.insert_sorted_with_data (app, Utils.sort_apps_by_name);
79 sorted_apps_execs += app.exec;
80
81=== modified file 'src/Widgets/CategoryView.vala'
82--- src/Widgets/CategoryView.vala 2014-03-01 15:19:12 +0000
83+++ src/Widgets/CategoryView.vala 2014-04-27 21:12:14 +0000
84@@ -28,6 +28,8 @@
85
86 private const string ALL_APPLICATIONS = _("All Applications");
87 private const string NEW_FILTER = _("Create a new Filter");
88+ private const string SWITCHBOARD_CATEGORY = "switchboard";
89+
90 private int current_position = 0;
91
92 public Gee.HashMap<int, string> category_ids = new Gee.HashMap<int, string> ();
93@@ -71,6 +73,9 @@
94 int n = 0;
95
96 foreach (string cat_name in view.apps.keys) {
97+ if (cat_name == SWITCHBOARD_CATEGORY)
98+ continue;
99+
100 category_ids.set (n, cat_name);
101 category_switcher.add_category (GLib.dgettext ("gnome-menus-3.0", cat_name).dup ());
102 n++;

Subscribers

People subscribed via source and target branches