diff options
-rw-r--r-- | ChangeLog | 16 | ||||
-rwxr-xr-x | configure | 20 | ||||
-rw-r--r-- | configure.ac | 4 | ||||
-rw-r--r-- | libindicator/indicator-desktop-shortcuts.c | 27 |
4 files changed, 54 insertions, 13 deletions
@@ -1,5 +1,21 @@ # Generated by Makefile. Do not edit. +2011-03-03 Ted Gould <ted@gould.cx> + + 0.3.20 + +2011-03-03 Ted Gould <ted@gould.cx> + + Use the TargetEnvironment key + +2011-03-02 Ted Gould <ted@gould.cx> + + Removing warning that there are no shortcuts, that's a valid thing to have. + +2011-03-02 Ted Gould <ted@gould.cx> + + Adding a target environment key and checking for that over others. + 2011-02-17 Ted Gould <ted@gould.cx> 0.3.19 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.67 for libindicator 0.3.19. +# Generated by GNU Autoconf 2.67 for libindicator 0.3.20. # # Report bugs to <ted@canonical.com>. # @@ -701,8 +701,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='libindicator' PACKAGE_TARNAME='libindicator' -PACKAGE_VERSION='0.3.19' -PACKAGE_STRING='libindicator 0.3.19' +PACKAGE_VERSION='0.3.20' +PACKAGE_STRING='libindicator 0.3.20' PACKAGE_BUGREPORT='ted@canonical.com' PACKAGE_URL='' @@ -1443,7 +1443,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures libindicator 0.3.19 to adapt to many kinds of systems. +\`configure' configures libindicator 0.3.20 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1513,7 +1513,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of libindicator 0.3.19:";; + short | recursive ) echo "Configuration of libindicator 0.3.20:";; esac cat <<\_ACEOF @@ -1628,7 +1628,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -libindicator configure 0.3.19 +libindicator configure 0.3.20 generated by GNU Autoconf 2.67 Copyright (C) 2010 Free Software Foundation, Inc. @@ -1906,7 +1906,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by libindicator $as_me 0.3.19, which was +It was created by libindicator $as_me 0.3.20, which was generated by GNU Autoconf 2.67. Invocation command line was $ $0 $@ @@ -2726,7 +2726,7 @@ fi # Define the identity of the package. PACKAGE=libindicator - VERSION=0.3.19 + VERSION=0.3.20 cat >>confdefs.h <<_ACEOF @@ -12361,7 +12361,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by libindicator $as_me 0.3.19, which was +This file was extended by libindicator $as_me 0.3.20, which was generated by GNU Autoconf 2.67. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -12427,7 +12427,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -libindicator config.status 0.3.19 +libindicator config.status 0.3.20 configured by $0, generated by GNU Autoconf 2.67, with options \\"\$ac_cs_config\\" diff --git a/configure.ac b/configure.ac index cae787a..a81543e 100644 --- a/configure.ac +++ b/configure.ac @@ -1,10 +1,10 @@ -AC_INIT(libindicator, 0.3.19, ted@canonical.com) +AC_INIT(libindicator, 0.3.20, ted@canonical.com) AC_PREREQ(2.53) AM_CONFIG_HEADER(config.h) -AM_INIT_AUTOMAKE(libindicator, 0.3.19) +AM_INIT_AUTOMAKE(libindicator, 0.3.20) AM_MAINTAINER_MODE m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES]) diff --git a/libindicator/indicator-desktop-shortcuts.c b/libindicator/indicator-desktop-shortcuts.c index b04b482..7de4084 100644 --- a/libindicator/indicator-desktop-shortcuts.c +++ b/libindicator/indicator-desktop-shortcuts.c @@ -30,6 +30,7 @@ License along with this library. If not, see #define GROUP_SUFFIX "Shortcut Group" #define SHORTCUTS_KEY "X-Ayatana-Desktop-Shortcuts" +#define ENVIRON_KEY "TargetEnvironment" #define PROP_DESKTOP_FILE_S "desktop-file" #define PROP_IDENTITY_S "identity" @@ -173,7 +174,6 @@ set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec } if (!g_key_file_has_key(keyfile, G_KEY_FILE_DESKTOP_GROUP, SHORTCUTS_KEY, NULL)) { - g_warning("Keyfile from file '%s' does not have '" SHORTCUTS_KEY "' key", g_value_get_string(value)); g_key_file_free(keyfile); break; } @@ -295,6 +295,31 @@ parse_keyfile (IndicatorDesktopShortcuts * ids) static gboolean should_show (GKeyFile * keyfile, const gchar * group, const gchar * identity) { + if (g_key_file_has_key(keyfile, group, ENVIRON_KEY, NULL)) { + /* If we've got this key, we're going to return here and not + process the deprecated keys. */ + gint j; + gsize num_env = 0; + gchar ** envs = g_key_file_get_string_list(keyfile, group, ENVIRON_KEY, &num_env, NULL); + + for (j = 0; j < num_env; j++) { + if (g_strcmp0(envs[j], identity) == 0) { + break; + } + } + + if (envs != NULL) { + g_strfreev(envs); + } + + if (j == num_env) { + return FALSE; + } + return TRUE; + } else { + g_warning(GROUP_SUFFIX " does not have key '" ENVIRON_KEY "' falling back to deprecated use of '" G_KEY_FILE_DESKTOP_KEY_ONLY_SHOW_IN "' and '" G_KEY_FILE_DESKTOP_KEY_NOT_SHOW_IN "'."); + } + /* If there is a list of OnlyShowIn entries we need to check to see if we're in that list. If not, we drop this nick */ if (g_key_file_has_key(keyfile, group, G_KEY_FILE_DESKTOP_KEY_ONLY_SHOW_IN, NULL)) { |