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
=== modified file 'panel/applets/CMakeLists.txt'
--- panel/applets/CMakeLists.txt 2011-02-10 01:10:19 +0000
+++ panel/applets/CMakeLists.txt 2011-03-01 10:07:38 +0000
@@ -1,5 +1,14 @@
1project(uqapplets)1project(uqapplets)
22
3macro(read_pkg_variable cmake_var pkg pkg_var)
4 execute_process(
5 COMMAND pkg-config --variable=${pkg_var} ${pkg}
6 OUTPUT_VARIABLE tmp
7 )
8 # Remove trailing newline from ${tmp}
9 string(STRIP "${tmp}" ${cmake_var})
10endmacro(read_pkg_variable)
11
3# Dependencies12# Dependencies
4include(FindPkgConfig)13include(FindPkgConfig)
514
@@ -11,6 +20,11 @@
1120
12find_package(X11 REQUIRED)21find_package(X11 REQUIRED)
1322
23# Get indicator dirs from pkgconfig
24read_pkg_variable(INDICATOR_DIR indicator indicatordir)
25read_pkg_variable(INDICATOR_ICONS_DIR indicator iconsdir)
26configure_file(indicator-config.h.in indicator-config.h)
27
14# Sources28# Sources
15set(uqapplets_SRCS29set(uqapplets_SRCS
16 appindicator/appindicatorapplet.cpp30 appindicator/appindicatorapplet.cpp
1731
=== added file 'panel/applets/indicator-config.h.in'
--- panel/applets/indicator-config.h.in 1970-01-01 00:00:00 +0000
+++ panel/applets/indicator-config.h.in 2011-03-01 10:07:38 +0000
@@ -0,0 +1,7 @@
1#ifndef INDICATOR_CONFIG_H
2#define INDICATOR_CONFIG_H
3
4#define INDICATOR_ICONS_DIR "${INDICATOR_ICONS_DIR}"
5#define INDICATOR_DIR "${INDICATOR_DIR}"
6
7#endif /* INDICATOR_CONFIG_H */
08
=== modified file 'panel/applets/indicator/indicator.c'
--- panel/applets/indicator/indicator.c 2010-11-22 16:30:41 +0000
+++ panel/applets/indicator/indicator.c 2011-03-01 10:07:38 +0000
@@ -22,12 +22,12 @@
2222
23#include "indicator.h"23#include "indicator.h"
2424
25#include "indicator-config.h"
26
25/* default settings */27/* default settings */
26#define DEFAULT_SETTING1 NULL28#define DEFAULT_SETTING1 NULL
27#define DEFAULT_SETTING2 129#define DEFAULT_SETTING2 1
28#define DEFAULT_SETTING3 FALSE30#define DEFAULT_SETTING3 FALSE
29#define ICONS_DIR "/usr/share/libindicator/icons/"
30#define INDICATOR_DIR "/usr/lib/indicators/4/"
3131
32typedef enum {32typedef enum {
33 PANEL_APPLET_ORIENT_LEFT,33 PANEL_APPLET_ORIENT_LEFT,
@@ -391,8 +391,7 @@
391 g_object_set (gtk_settings_get_default(), "gtk-theme-name", "Ambiance", NULL);391 g_object_set (gtk_settings_get_default(), "gtk-theme-name", "Ambiance", NULL);
392 g_object_set (gtk_settings_get_default(), "gtk-icon-theme-name", "ubuntu-mono-dark", NULL);392 g_object_set (gtk_settings_get_default(), "gtk-icon-theme-name", "ubuntu-mono-dark", NULL);
393 gtk_icon_theme_append_search_path(gtk_icon_theme_get_default(),393 gtk_icon_theme_append_search_path(gtk_icon_theme_get_default(),
394 ICONS_DIR);394 INDICATOR_ICONS_DIR);
395 /* g_debug("Icons directory: %s", ICONS_DIR); */
396 gtk_rc_parse_string (395 gtk_rc_parse_string (
397 "widget \"indicator-applet*\" style \"panel\"\n"396 "widget \"indicator-applet*\" style \"panel\"\n"
398 "style \"indicator-applet-style\"\n"397 "style \"indicator-applet-style\"\n"

Subscribers

People subscribed via source and target branches