Merge lp:~pimvullers/slingshot/unity-optional into lp:~elementary-pantheon/slingshot/trunk

Proposed by Pim Vullers
Status: Merged
Approved by: Cody Garver
Approved revision: 403
Merged at revision: 402
Proposed branch: lp:~pimvullers/slingshot/unity-optional
Merge into: lp:~elementary-pantheon/slingshot/trunk
Diff against target: 143 lines (+40/-4)
4 files modified
CMakeLists.txt (+25/-3)
src/Backend/App.vala (+2/-0)
src/Backend/AppSystem.vala (+10/-0)
src/Backend/RelevancyService.vala (+3/-1)
To merge this branch: bzr merge lp:~pimvullers/slingshot/unity-optional
Reviewer Review Type Date Requested Status
elementary Pantheon team Pending
Review via email: mp+204315@code.launchpad.net

Commit message

Unity and Zeitgeist integration is now optional. Default is ON.

Description of the change

Made unity integration optionala

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'CMakeLists.txt'
2--- CMakeLists.txt 2013-12-26 00:08:04 +0000
3+++ CMakeLists.txt 2014-01-31 18:38:13 +0000
4@@ -34,8 +34,28 @@
5
6 # Slingshot
7
8-set (CORE_DEPS "gobject-2.0;glib-2.0;gio-2.0;gio-unix-2.0;gee-1.0;libgnome-menu;libwnck-3.0;gdk-x11-3.0;unity;")
9-set (UI_DEPS "gtk+-3.0>=3.2.0;granite;zeitgeist-2.0;")
10+option (USE_UNITY "Use Unity integration" ON)
11+
12+if (USE_UNITY)
13+ message ("-- Unity integration enabled")
14+ set (UNITY_DEPS unity)
15+ set (UNITY_OPTIONS --define=HAVE_UNITY)
16+else ()
17+ message ("-- Unity integration disabled")
18+endif ()
19+
20+option (USE_ZEITGEIST "Use Zeitgeist integration" ON)
21+
22+if (USE_ZEITGEIST)
23+ message ("-- Zeitgeist integration enabled")
24+ set (ZEITGEIST_DEPS zeitgeist-2.0)
25+ set (ZEITGEIST_OPTIONS --define=HAVE_ZEITGEIST)
26+else ()
27+ message ("-- Zeitgeist integration disabled")
28+endif ()
29+
30+set (CORE_DEPS "gobject-2.0;glib-2.0;gio-2.0;gio-unix-2.0;gee-1.0;libgnome-menu;libwnck-3.0;gdk-x11-3.0;${UNITY_DEPS};")
31+set (UI_DEPS "gtk+-3.0>=3.2.0;granite;${ZEITGEIST_DEPS};")
32
33 find_package (PkgConfig)
34 pkg_check_modules (DEPS REQUIRED "${CORE_DEPS}${UI_DEPS}" gthread-2.0)
35@@ -69,6 +89,8 @@
36 OPTIONS
37 --thread
38 -g
39+ ${UNITY_OPTIONS}
40+ ${ZEITGEIST_OPTIONS}
41 )
42
43 # Comment this out to enable C compiler warnings
44@@ -92,4 +114,4 @@
45 add_schema ("org.pantheon.desktop.slingshot.gschema.xml")
46
47 # Translations
48-add_subdirectory (po)
49\ No newline at end of file
50+add_subdirectory (po)
51
52=== modified file 'src/Backend/App.vala'
53--- src/Backend/App.vala 2013-12-26 00:08:04 +0000
54+++ src/Backend/App.vala 2014-01-31 18:38:13 +0000
55@@ -42,7 +42,9 @@
56 desktop_id = entry.get_desktop_file_id ();
57 icon_name = entry.get_icon () ?? "application-default-icon";
58 desktop_path = entry.get_desktop_file_path ();
59+#if HAVE_UNITY
60 keywords = Unity.AppInfoManager.get_default ().get_keywords (desktop_id);
61+#endif
62 generic_name = entry.get_generic_name ();
63
64 update_icon ();
65
66=== modified file 'src/Backend/AppSystem.vala'
67--- src/Backend/AppSystem.vala 2013-12-26 00:08:04 +0000
68+++ src/Backend/AppSystem.vala 2014-01-31 18:38:13 +0000
69@@ -22,15 +22,19 @@
70 private Gee.HashMap<string, Gee.ArrayList<App>> apps = null;
71 private GMenu.Tree apps_menu = null;
72
73+#if HAVE_ZEITGEIST
74 private RelevancyService rl_service;
75+#endif
76
77 public signal void changed ();
78 private bool index_changed = false;
79
80 construct {
81
82+#if HAVE_ZEITGEIST
83 rl_service = new RelevancyService ();
84 rl_service.update_complete.connect (update_popularity);
85+#endif
86
87 apps_menu = GMenu.Tree.lookup ("pantheon-applications.menu", GMenu.TreeFlags.INCLUDE_EXCLUDED);
88 apps_menu.add_monitor ((menu) => {
89@@ -49,7 +53,9 @@
90
91 private void update_app_system () {
92
93+#if HAVE_ZEITGEIST
94 rl_service.refresh_popularity ();
95+#endif
96
97 update_categories_index ();
98 update_apps ();
99@@ -72,12 +78,14 @@
100
101 }
102
103+#if HAVE_ZEITGEIST
104 private void update_popularity () {
105
106 foreach (Gee.ArrayList<App> category in apps.values)
107 foreach (App app in category)
108 app.popularity = rl_service.get_app_popularity (app.desktop_id);
109 }
110+#endif
111
112 private void update_apps () {
113
114@@ -118,7 +126,9 @@
115 case GMenu.TreeItemType.ENTRY:
116 if (is_entry ((GMenu.TreeEntry) item)) {
117 app = new App ((GMenu.TreeEntry) item);
118+#if HAVE_ZEITGEIST
119 app.launched.connect (rl_service.app_launched);
120+#endif
121 app_list.add (app);
122 }
123 break;
124
125=== modified file 'src/Backend/RelevancyService.vala'
126--- src/Backend/RelevancyService.vala 2013-12-26 00:08:04 +0000
127+++ src/Backend/RelevancyService.vala 2014-01-31 18:38:13 +0000
128@@ -17,6 +17,7 @@
129 //
130 // Thanks to Synapse Developers for this class
131
132+#if HAVE_ZEITGEIST
133 public class Slingshot.Backend.RelevancyService : Object {
134
135 private Zeitgeist.Log zg_log;
136@@ -177,4 +178,5 @@
137 critical (e.message);
138 }
139 }
140-}
141\ No newline at end of file
142+}
143+#endif

Subscribers

People subscribed via source and target branches