diff options
author | Michael Terry <mike@mterry.name> | 2011-02-23 15:13:42 -0500 |
---|---|---|
committer | Michael Terry <mike@mterry.name> | 2011-02-23 15:13:42 -0500 |
commit | 02a56bbe87dba95388735c9961345b5166940b1c (patch) | |
tree | 097c709b75092f9093778c0a58f45f0e61ba3e1f /src/utils.c | |
parent | 3488f85406e03ebdbecfcc25f520689f300f8f9a (diff) | |
download | ayatana-indicator-datetime-02a56bbe87dba95388735c9961345b5166940b1c.tar.gz ayatana-indicator-datetime-02a56bbe87dba95388735c9961345b5166940b1c.tar.bz2 ayatana-indicator-datetime-02a56bbe87dba95388735c9961345b5166940b1c.zip |
disable clicking on locations; use pretty zone names in indicator
Diffstat (limited to 'src/utils.c')
-rw-r--r-- | src/utils.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/utils.c b/src/utils.c index 89c499b..20ae958 100644 --- a/src/utils.c +++ b/src/utils.c @@ -79,11 +79,16 @@ split_settings_location (const gchar * location, gchar ** zone, gchar ** name) gchar * after = first ? g_strstrip (first + 1) : NULL; if (after == NULL || after[0] == 0) { /* Make up name from zone */ - gchar * slash = strrchr (location_dup, '/'); - after = slash ? slash + 1 : location_dup; + gchar * chr = strrchr (location_dup, '/'); + after = g_strdup (chr ? chr + 1 : location_dup); + while ((chr = strchr (after, '_')) != NULL) { /* and turn underscores to spaces */ + *chr = ' '; + } + *name = after; + } + else { + *name = g_strdup (after); } - - *name = g_strdup (after); } } |