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

Proposed by Pim Vullers
Status: Merged
Approved by: David Gomes
Approved revision: 416
Merged at revision: 417
Proposed branch: lp:~pimvullers/switchboard/unity-optional
Merge into: lp:~elementary-pantheon/switchboard/switchboard
Diff against target: 111 lines (+23/-4)
3 files modified
CMakeLists.txt (+13/-2)
src/CategoryView.vala (+3/-1)
src/Switchboard.vala (+7/-1)
To merge this branch: bzr merge lp:~pimvullers/switchboard/unity-optional
Reviewer Review Type Date Requested Status
David Gomes (community) Approve
Cody Garver (community) Needs Fixing
Review via email: mp+204317@code.launchpad.net

Commit message

Unity integration is now optional. Default is ON.

Description of the change

Made unity integration optionala

To post a comment you must log in.
Revision history for this message
Cody Garver (codygarver) :
review: Approve
Revision history for this message
Cody Garver (codygarver) wrote :

It doesn't work if libunity-dev is missing

Build log: http://pastebin.com/nPXn0RA0

review: Needs Fixing
Revision history for this message
Cody Garver (codygarver) wrote :

Sorry, build log I gave was too long, updated: http://pastebin.com/Q9Zw5B4q

Revision history for this message
Pim Vullers (pimvullers) wrote :

@codygarver, this is because Unity integration is enabled, as you can see in the log, I made it print an info entry.

To disable you should add -DUSE_UNITY=OFF to the cmake command (which is not done now):
cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo

Revision history for this message
Pim Vullers (pimvullers) wrote :

@codygarver, or do you mean that it should automatically build without unity integration when libunity is not found?

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

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-23 23:32:28 +0000
3+++ CMakeLists.txt 2014-01-31 18:38:59 +0000
4@@ -68,6 +68,16 @@
5
6 #
7
8+option (USE_UNITY "Use Unity integration" ON)
9+
10+if (USE_UNITY)
11+ message ("-- Unity integration enabled")
12+ set (UNITY_DEPS unity)
13+ set (UNITY_OPTIONS --define=HAVE_UNITY)
14+else ()
15+ message ("-- Unity integration disabled")
16+endif ()
17+
18 set (LIB_PACKAGES
19 glib-2.0
20 gio-2.0
21@@ -93,6 +103,7 @@
22 --vapidir=${CMAKE_BINARY_DIR}/lib
23 --target-glib=2.32
24 --thread
25+ ${UNITY_OPTIONS}
26 )
27
28 find_package (Vala REQUIRED)
29@@ -106,12 +117,12 @@
30 ${LIB_NAME}
31 ${LIB_PACKAGES} # this is needed until we provide a ${CMAKE_PROJECT_NAME}.deps file
32 granite
33- unity
34+ ${UNITY_DEPS}
35 )
36
37 set (DEPS_PKG
38 granite
39- unity
40+ ${UNITY_DEPS}
41 )
42
43 pkg_check_modules (DEPS REQUIRED ${DEPS_PKG} ${LIB_PKG})
44
45=== modified file 'src/CategoryView.vala'
46--- src/CategoryView.vala 2014-01-02 20:29:12 +0000
47+++ src/CategoryView.vala 2014-01-31 18:38:59 +0000
48@@ -211,7 +211,9 @@
49 }
50 }
51
52+#if HAVE_UNITY
53 app.update_libunity_quicklist ();
54+#endif
55 }
56 }
57
58@@ -332,4 +334,4 @@
59 return null;
60 }
61 }
62-}
63\ No newline at end of file
64+}
65
66=== modified file 'src/Switchboard.vala'
67--- src/Switchboard.vala 2014-01-10 12:54:39 +0000
68+++ src/Switchboard.vala 2014-01-31 18:38:59 +0000
69@@ -119,6 +119,7 @@
70 switch_to_plug (plug);
71 }
72
73+#if HAVE_UNITY
74 // Updates items in quicklist menu using the Unity quicklist api.
75 public void update_libunity_quicklist () {
76 var launcher = Unity.LauncherEntry.get_for_desktop_id (app_launcher);
77@@ -143,6 +144,7 @@
78 if (personal_item != null && hardware_item != null && network_item != null && system_item != null)
79 launcher.quicklist = quicklist;
80 }
81+#endif
82
83 private void build () {
84 main_window = new Gtk.Window();
85@@ -201,7 +203,9 @@
86 show_alert (_("No settings found"), _("Install some and re-launch Switchboard"), Gtk.MessageType.WARNING);
87 search_box.sensitive = false;
88 } else {
89+#if HAVE_UNITY
90 update_libunity_quicklist ();
91+#endif
92 }
93 }
94
95@@ -286,6 +290,7 @@
96 headerbar.pack_end (search_box);
97 }
98
99+#if HAVE_UNITY
100 private Dbusmenu.Menuitem? add_quicklist_for_category (Switchboard.Plug.Category category) {
101 // Create menuitem for this category
102 var category_item = new Dbusmenu.Menuitem ();
103@@ -334,5 +339,6 @@
104
105 return (empty ? null : category_item);
106 }
107+#endif
108 }
109-}
110\ No newline at end of file
111+}

Subscribers

People subscribed via source and target branches

to all changes: