Merge lp:~pimvullers/slingshot/fix-1274950 into lp:~elementary-pantheon/slingshot/trunk

Proposed by Pim Vullers
Status: Merged
Merged at revision: 402
Proposed branch: lp:~pimvullers/slingshot/fix-1274950
Merge into: lp:~elementary-pantheon/slingshot/trunk
Diff against target: 117 lines (+26/-3)
3 files modified
CMakeLists.txt (+13/-2)
src/Backend/AppSystem.vala (+10/-0)
src/Backend/RelevancyService.vala (+3/-1)
To merge this branch: bzr merge lp:~pimvullers/slingshot/fix-1274950
Reviewer Review Type Date Requested Status
elementary Pantheon team Pending
Review via email: mp+204319@code.launchpad.net

Description of the change

Made zeitgeist integration optional

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:40:26 +0000
4@@ -34,8 +34,18 @@
5
6 # Slingshot
7
8+option (USE_ZEITGEIST "Use Zeitgeist integration" ON)
9+
10+if (USE_ZEITGEIST)
11+ message ("-- Zeitgeist integration enabled")
12+ set (ZEITGEIST_DEPS zeitgeist-2.0)
13+ set (ZEITGEIST_OPTIONS --define=HAVE_ZEITGEIST)
14+else ()
15+ message ("-- Zeitgeist integration disabled")
16+endif ()
17+
18 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;")
19-set (UI_DEPS "gtk+-3.0>=3.2.0;granite;zeitgeist-2.0;")
20+set (UI_DEPS "gtk+-3.0>=3.2.0;granite;${ZEITGEIST_DEPS};")
21
22 find_package (PkgConfig)
23 pkg_check_modules (DEPS REQUIRED "${CORE_DEPS}${UI_DEPS}" gthread-2.0)
24@@ -69,6 +79,7 @@
25 OPTIONS
26 --thread
27 -g
28+ ${ZEITGEIST_OPTIONS}
29 )
30
31 # Comment this out to enable C compiler warnings
32@@ -92,4 +103,4 @@
33 add_schema ("org.pantheon.desktop.slingshot.gschema.xml")
34
35 # Translations
36-add_subdirectory (po)
37\ No newline at end of file
38+add_subdirectory (po)
39
40=== modified file 'src/Backend/AppSystem.vala'
41--- src/Backend/AppSystem.vala 2013-12-26 00:08:04 +0000
42+++ src/Backend/AppSystem.vala 2014-01-31 18:40:26 +0000
43@@ -22,15 +22,19 @@
44 private Gee.HashMap<string, Gee.ArrayList<App>> apps = null;
45 private GMenu.Tree apps_menu = null;
46
47+#if HAVE_ZEITGEIST
48 private RelevancyService rl_service;
49+#endif
50
51 public signal void changed ();
52 private bool index_changed = false;
53
54 construct {
55
56+#if HAVE_ZEITGEIST
57 rl_service = new RelevancyService ();
58 rl_service.update_complete.connect (update_popularity);
59+#endif
60
61 apps_menu = GMenu.Tree.lookup ("pantheon-applications.menu", GMenu.TreeFlags.INCLUDE_EXCLUDED);
62 apps_menu.add_monitor ((menu) => {
63@@ -49,7 +53,9 @@
64
65 private void update_app_system () {
66
67+#if HAVE_ZEITGEIST
68 rl_service.refresh_popularity ();
69+#endif
70
71 update_categories_index ();
72 update_apps ();
73@@ -72,12 +78,14 @@
74
75 }
76
77+#if HAVE_ZEITGEIST
78 private void update_popularity () {
79
80 foreach (Gee.ArrayList<App> category in apps.values)
81 foreach (App app in category)
82 app.popularity = rl_service.get_app_popularity (app.desktop_id);
83 }
84+#endif
85
86 private void update_apps () {
87
88@@ -118,7 +126,9 @@
89 case GMenu.TreeItemType.ENTRY:
90 if (is_entry ((GMenu.TreeEntry) item)) {
91 app = new App ((GMenu.TreeEntry) item);
92+#if HAVE_ZEITGEIST
93 app.launched.connect (rl_service.app_launched);
94+#endif
95 app_list.add (app);
96 }
97 break;
98
99=== modified file 'src/Backend/RelevancyService.vala'
100--- src/Backend/RelevancyService.vala 2013-12-26 00:08:04 +0000
101+++ src/Backend/RelevancyService.vala 2014-01-31 18:40:26 +0000
102@@ -17,6 +17,7 @@
103 //
104 // Thanks to Synapse Developers for this class
105
106+#if HAVE_ZEITGEIST
107 public class Slingshot.Backend.RelevancyService : Object {
108
109 private Zeitgeist.Log zg_log;
110@@ -177,4 +178,5 @@
111 critical (e.message);
112 }
113 }
114-}
115\ No newline at end of file
116+}
117+#endif

Subscribers

People subscribed via source and target branches