Merge lp:~agateau/unity-2d/fix-indicator-dir into lp:unity-2d/3.0

Proposed by Aurélien Gâteau
Status: Merged
Approved by: Ugo Riboni
Approved revision: 419
Merged at revision: 418
Proposed branch: lp:~agateau/unity-2d/fix-indicator-dir
Merge into: lp:unity-2d/3.0
Diff against target: 71 lines (+24/-4)
3 files modified
panel/applets/CMakeLists.txt (+14/-0)
panel/applets/indicator-config.h.in (+7/-0)
panel/applets/indicator/indicator.c (+3/-4)
To merge this branch: bzr merge lp:~agateau/unity-2d/fix-indicator-dir
Reviewer Review Type Date Requested Status
Ugo Riboni (community) Approve
Review via email: mp+51718@code.launchpad.net

Description of the change

[panel] Fix broken indicators

Instead of hardcoding path to indicator dirs, get them from pkg-config, as suggested here:

https://bugs.launchpad.net/ubuntu/+source/unity-2d/+bug/724717/comments/5

To post a comment you must log in.
419. By Aurélien Gâteau

Remove commented-out code

Revision history for this message
Ugo Riboni (uriboni) wrote :

As discussed in IRC all changed that I suggested were implemented. Good to go, and welcome back indicators :)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'panel/applets/CMakeLists.txt'
2--- panel/applets/CMakeLists.txt 2011-02-10 01:10:19 +0000
3+++ panel/applets/CMakeLists.txt 2011-03-01 10:07:38 +0000
4@@ -1,5 +1,14 @@
5 project(uqapplets)
6
7+macro(read_pkg_variable cmake_var pkg pkg_var)
8+ execute_process(
9+ COMMAND pkg-config --variable=${pkg_var} ${pkg}
10+ OUTPUT_VARIABLE tmp
11+ )
12+ # Remove trailing newline from ${tmp}
13+ string(STRIP "${tmp}" ${cmake_var})
14+endmacro(read_pkg_variable)
15+
16 # Dependencies
17 include(FindPkgConfig)
18
19@@ -11,6 +20,11 @@
20
21 find_package(X11 REQUIRED)
22
23+# Get indicator dirs from pkgconfig
24+read_pkg_variable(INDICATOR_DIR indicator indicatordir)
25+read_pkg_variable(INDICATOR_ICONS_DIR indicator iconsdir)
26+configure_file(indicator-config.h.in indicator-config.h)
27+
28 # Sources
29 set(uqapplets_SRCS
30 appindicator/appindicatorapplet.cpp
31
32=== added file 'panel/applets/indicator-config.h.in'
33--- panel/applets/indicator-config.h.in 1970-01-01 00:00:00 +0000
34+++ panel/applets/indicator-config.h.in 2011-03-01 10:07:38 +0000
35@@ -0,0 +1,7 @@
36+#ifndef INDICATOR_CONFIG_H
37+#define INDICATOR_CONFIG_H
38+
39+#define INDICATOR_ICONS_DIR "${INDICATOR_ICONS_DIR}"
40+#define INDICATOR_DIR "${INDICATOR_DIR}"
41+
42+#endif /* INDICATOR_CONFIG_H */
43
44=== modified file 'panel/applets/indicator/indicator.c'
45--- panel/applets/indicator/indicator.c 2010-11-22 16:30:41 +0000
46+++ panel/applets/indicator/indicator.c 2011-03-01 10:07:38 +0000
47@@ -22,12 +22,12 @@
48
49 #include "indicator.h"
50
51+#include "indicator-config.h"
52+
53 /* default settings */
54 #define DEFAULT_SETTING1 NULL
55 #define DEFAULT_SETTING2 1
56 #define DEFAULT_SETTING3 FALSE
57-#define ICONS_DIR "/usr/share/libindicator/icons/"
58-#define INDICATOR_DIR "/usr/lib/indicators/4/"
59
60 typedef enum {
61 PANEL_APPLET_ORIENT_LEFT,
62@@ -391,8 +391,7 @@
63 g_object_set (gtk_settings_get_default(), "gtk-theme-name", "Ambiance", NULL);
64 g_object_set (gtk_settings_get_default(), "gtk-icon-theme-name", "ubuntu-mono-dark", NULL);
65 gtk_icon_theme_append_search_path(gtk_icon_theme_get_default(),
66- ICONS_DIR);
67- /* g_debug("Icons directory: %s", ICONS_DIR); */
68+ INDICATOR_ICONS_DIR);
69 gtk_rc_parse_string (
70 "widget \"indicator-applet*\" style \"panel\"\n"
71 "style \"indicator-applet-style\"\n"

Subscribers

People subscribed via source and target branches