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
=== modified file 'CMakeLists.txt'
--- CMakeLists.txt 2013-12-26 00:08:04 +0000
+++ CMakeLists.txt 2014-01-31 18:40:26 +0000
@@ -34,8 +34,18 @@
3434
35# Slingshot35# Slingshot
3636
37option (USE_ZEITGEIST "Use Zeitgeist integration" ON)
38
39if (USE_ZEITGEIST)
40 message ("-- Zeitgeist integration enabled")
41 set (ZEITGEIST_DEPS zeitgeist-2.0)
42 set (ZEITGEIST_OPTIONS --define=HAVE_ZEITGEIST)
43else ()
44 message ("-- Zeitgeist integration disabled")
45endif ()
46
37set (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;")47set (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;")
38set (UI_DEPS "gtk+-3.0>=3.2.0;granite;zeitgeist-2.0;")48set (UI_DEPS "gtk+-3.0>=3.2.0;granite;${ZEITGEIST_DEPS};")
3949
40find_package (PkgConfig)50find_package (PkgConfig)
41pkg_check_modules (DEPS REQUIRED "${CORE_DEPS}${UI_DEPS}" gthread-2.0)51pkg_check_modules (DEPS REQUIRED "${CORE_DEPS}${UI_DEPS}" gthread-2.0)
@@ -69,6 +79,7 @@
69OPTIONS79OPTIONS
70 --thread80 --thread
71 -g81 -g
82 ${ZEITGEIST_OPTIONS}
72)83)
7384
74# Comment this out to enable C compiler warnings85# Comment this out to enable C compiler warnings
@@ -92,4 +103,4 @@
92add_schema ("org.pantheon.desktop.slingshot.gschema.xml")103add_schema ("org.pantheon.desktop.slingshot.gschema.xml")
93104
94# Translations105# Translations
95add_subdirectory (po)
96\ No newline at end of file106\ No newline at end of file
107add_subdirectory (po)
97108
=== modified file 'src/Backend/AppSystem.vala'
--- src/Backend/AppSystem.vala 2013-12-26 00:08:04 +0000
+++ src/Backend/AppSystem.vala 2014-01-31 18:40:26 +0000
@@ -22,15 +22,19 @@
22 private Gee.HashMap<string, Gee.ArrayList<App>> apps = null;22 private Gee.HashMap<string, Gee.ArrayList<App>> apps = null;
23 private GMenu.Tree apps_menu = null;23 private GMenu.Tree apps_menu = null;
2424
25#if HAVE_ZEITGEIST
25 private RelevancyService rl_service;26 private RelevancyService rl_service;
27#endif
2628
27 public signal void changed ();29 public signal void changed ();
28 private bool index_changed = false;30 private bool index_changed = false;
2931
30 construct {32 construct {
3133
34#if HAVE_ZEITGEIST
32 rl_service = new RelevancyService ();35 rl_service = new RelevancyService ();
33 rl_service.update_complete.connect (update_popularity);36 rl_service.update_complete.connect (update_popularity);
37#endif
3438
35 apps_menu = GMenu.Tree.lookup ("pantheon-applications.menu", GMenu.TreeFlags.INCLUDE_EXCLUDED);39 apps_menu = GMenu.Tree.lookup ("pantheon-applications.menu", GMenu.TreeFlags.INCLUDE_EXCLUDED);
36 apps_menu.add_monitor ((menu) => {40 apps_menu.add_monitor ((menu) => {
@@ -49,7 +53,9 @@
4953
50 private void update_app_system () {54 private void update_app_system () {
5155
56#if HAVE_ZEITGEIST
52 rl_service.refresh_popularity ();57 rl_service.refresh_popularity ();
58#endif
5359
54 update_categories_index ();60 update_categories_index ();
55 update_apps ();61 update_apps ();
@@ -72,12 +78,14 @@
7278
73 }79 }
7480
81#if HAVE_ZEITGEIST
75 private void update_popularity () {82 private void update_popularity () {
7683
77 foreach (Gee.ArrayList<App> category in apps.values)84 foreach (Gee.ArrayList<App> category in apps.values)
78 foreach (App app in category)85 foreach (App app in category)
79 app.popularity = rl_service.get_app_popularity (app.desktop_id);86 app.popularity = rl_service.get_app_popularity (app.desktop_id);
80 }87 }
88#endif
8189
82 private void update_apps () {90 private void update_apps () {
8391
@@ -118,7 +126,9 @@
118 case GMenu.TreeItemType.ENTRY:126 case GMenu.TreeItemType.ENTRY:
119 if (is_entry ((GMenu.TreeEntry) item)) {127 if (is_entry ((GMenu.TreeEntry) item)) {
120 app = new App ((GMenu.TreeEntry) item);128 app = new App ((GMenu.TreeEntry) item);
129#if HAVE_ZEITGEIST
121 app.launched.connect (rl_service.app_launched);130 app.launched.connect (rl_service.app_launched);
131#endif
122 app_list.add (app);132 app_list.add (app);
123 }133 }
124 break;134 break;
125135
=== modified file 'src/Backend/RelevancyService.vala'
--- src/Backend/RelevancyService.vala 2013-12-26 00:08:04 +0000
+++ src/Backend/RelevancyService.vala 2014-01-31 18:40:26 +0000
@@ -17,6 +17,7 @@
17//17//
18// Thanks to Synapse Developers for this class18// Thanks to Synapse Developers for this class
1919
20#if HAVE_ZEITGEIST
20public class Slingshot.Backend.RelevancyService : Object {21public class Slingshot.Backend.RelevancyService : Object {
2122
22 private Zeitgeist.Log zg_log;23 private Zeitgeist.Log zg_log;
@@ -177,4 +178,5 @@
177 critical (e.message);178 critical (e.message);
178 }179 }
179 }180 }
180}
181\ No newline at end of file181\ No newline at end of file
182}
183#endif

Subscribers

People subscribed via source and target branches