Merge lp:~ted/libappindicator/app_name into lp:libappindicator/0.5

Proposed by Ted Gould
Status: Merged
Approved by: Charles Kerr
Approved revision: 240
Merged at revision: 240
Proposed branch: lp:~ted/libappindicator/app_name
Merge into: lp:libappindicator/0.5
Diff against target: 23 lines (+12/-1)
1 file modified
src/app-indicator.c (+12/-1)
To merge this branch: bzr merge lp:~ted/libappindicator/app_name
Reviewer Review Type Date Requested Status
Charles Kerr (community) Approve
Review via email: mp+102161@code.launchpad.net

Description of the change

If we don't get the title set, try the application name.

To post a comment you must log in.
Revision history for this message
Charles Kerr (charlesk) wrote :

Nice idea :)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/app-indicator.c'
2--- src/app-indicator.c 2012-03-16 22:15:50 +0000
3+++ src/app-indicator.c 2012-04-16 18:55:21 +0000
4@@ -1123,7 +1123,18 @@
5 } else if (g_strcmp0(property, "AttentionIconName") == 0) {
6 return g_variant_new_string(priv->attention_icon_name ? priv->attention_icon_name : "");
7 } else if (g_strcmp0(property, "Title") == 0) {
8- return g_variant_new_string(priv->title ? priv->title : "");
9+ const gchar * output = NULL;
10+ if (priv->title == NULL) {
11+ const gchar * name = g_get_application_name();
12+ if (name != NULL) {
13+ output = name;
14+ } else {
15+ output = "";
16+ }
17+ } else {
18+ output = priv->title;
19+ }
20+ return g_variant_new_string(output);
21 } else if (g_strcmp0(property, "IconThemePath") == 0) {
22 return g_variant_new_string(priv->icon_theme_path ? priv->icon_theme_path : "");
23 } else if (g_strcmp0(property, "Menu") == 0) {

Subscribers

People subscribed via source and target branches