From 5d02c0c8366127655de02c14514b9e39fba6172a Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 2 Apr 2010 10:44:57 -0500 Subject: Adding a private variable for the translation domain and grabbing it from the keyfile. --- libindicator/indicator-desktop-shortcuts.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/libindicator/indicator-desktop-shortcuts.c b/libindicator/indicator-desktop-shortcuts.c index e86a6ab..a370c0f 100644 --- a/libindicator/indicator-desktop-shortcuts.c +++ b/libindicator/indicator-desktop-shortcuts.c @@ -39,6 +39,7 @@ struct _IndicatorDesktopShortcutsPrivate { GKeyFile * keyfile; gchar * identity; GArray * nicks; + gchar * domain; }; enum { @@ -100,6 +101,7 @@ indicator_desktop_shortcuts_init (IndicatorDesktopShortcuts *self) priv->keyfile = NULL; priv->identity = NULL; + priv->domain = NULL; priv->nicks = g_array_new(TRUE, TRUE, sizeof(gchar *)); return; @@ -131,6 +133,11 @@ indicator_desktop_shortcuts_finalize (GObject *object) priv->identity = NULL; } + if (priv->domain != NULL) { + g_free(priv->domain); + priv->domain = NULL; + } + if (priv->nicks != NULL) { gint i; for (i = 0; i < priv->nicks->len; i++) { @@ -227,6 +234,15 @@ parse_keyfile (IndicatorDesktopShortcuts * ids) return; } + /* Check to see if there is a custom translation domain that + we should take into account. */ + if (g_key_file_has_key(priv->keyfile, G_KEY_FILE_DESKTOP_GROUP, "X-Ubuntu-Gettext-Domain", NULL)) { + if (priv->domain != NULL) { + g_free(priv->domain); + } + priv->domain = g_key_file_get_string(priv->keyfile, G_KEY_FILE_DESKTOP_GROUP, "X-Ubuntu-Gettext-Domain", NULL); + } + /* Okay, we've got everything we need. Let's get it on! */ gint i; gsize num_nicks = 0; -- cgit v1.2.3 From 20e03af6d3675ca8dab591ad6b9cd9ab18fc7e37 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 2 Apr 2010 10:49:33 -0500 Subject: If we don't have a domain just use the locale function, otherwise we need to use that domain to get the translation. --- libindicator/indicator-desktop-shortcuts.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/libindicator/indicator-desktop-shortcuts.c b/libindicator/indicator-desktop-shortcuts.c index a370c0f..504d023 100644 --- a/libindicator/indicator-desktop-shortcuts.c +++ b/libindicator/indicator-desktop-shortcuts.c @@ -427,11 +427,21 @@ indicator_desktop_shortcuts_nick_get_name (IndicatorDesktopShortcuts * ids, cons return NULL; } - gchar * name = g_key_file_get_locale_string(priv->keyfile, - groupheader, - G_KEY_FILE_DESKTOP_KEY_NAME, - NULL, - NULL); + gchar * name = NULL; + if (priv->domain == NULL) { + name = g_key_file_get_locale_string(priv->keyfile, + groupheader, + G_KEY_FILE_DESKTOP_KEY_NAME, + NULL, + NULL); + } else { + gchar * tempname = g_key_file_get_string(priv->keyfile, + groupheader, + G_KEY_FILE_DESKTOP_KEY_NAME, + NULL); + name = g_strdup(g_dgettext(priv->domain, tempname)); + g_free(tempname); + } g_free(groupheader); -- cgit v1.2.3 From 49c5444af4042b1084c00009f5ff5a65996b300b Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 2 Apr 2010 10:52:01 -0500 Subject: releasing version 0.3.6-0ubuntu1~ppa2~shortcutdomain1 --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 1166d59..b349303 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,9 +1,9 @@ -libindicator (0.3.6-0ubuntu1~ppa2~shortcutdomain1) UNRELEASED; urgency=low +libindicator (0.3.6-0ubuntu1~ppa2~shortcutdomain1) lucid; urgency=low * Upstream merge * Use the domain in desktop files for shortcuts - -- Ted Gould Fri, 02 Apr 2010 10:50:28 -0500 + -- Ted Gould Fri, 02 Apr 2010 10:51:59 -0500 libindicator (0.3.6-0ubuntu1~ppa1) lucid; urgency=low -- cgit v1.2.3 From e900b4c7a8fc08f73533d8a49777ebbd109028dd Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Mon, 5 Apr 2010 12:46:10 -0500 Subject: Make it so that we check the GNOME-Gettext-Domain as well --- libindicator/indicator-desktop-shortcuts.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/libindicator/indicator-desktop-shortcuts.c b/libindicator/indicator-desktop-shortcuts.c index 504d023..161350b 100644 --- a/libindicator/indicator-desktop-shortcuts.c +++ b/libindicator/indicator-desktop-shortcuts.c @@ -234,12 +234,22 @@ parse_keyfile (IndicatorDesktopShortcuts * ids) return; } + /* Remove a previous translation domain if we had one + from a perviously parsed file. */ + if (priv->domain != NULL) { + g_free(priv->domain); + priv->domain = NULL; + } + /* Check to see if there is a custom translation domain that we should take into account. */ - if (g_key_file_has_key(priv->keyfile, G_KEY_FILE_DESKTOP_GROUP, "X-Ubuntu-Gettext-Domain", NULL)) { - if (priv->domain != NULL) { - g_free(priv->domain); - } + if (priv->domain == NULL && + g_key_file_has_key(priv->keyfile, G_KEY_FILE_DESKTOP_GROUP, "X-GNOME-Gettext-Domain", NULL)) { + priv->domain = g_key_file_get_string(priv->keyfile, G_KEY_FILE_DESKTOP_GROUP, "X-GNOME-Gettext-Domain", NULL); + } + + if (priv->domain == NULL && + g_key_file_has_key(priv->keyfile, G_KEY_FILE_DESKTOP_GROUP, "X-Ubuntu-Gettext-Domain", NULL)) { priv->domain = g_key_file_get_string(priv->keyfile, G_KEY_FILE_DESKTOP_GROUP, "X-Ubuntu-Gettext-Domain", NULL); } -- cgit v1.2.3 From 1200f51e90901eb120484ae3bb0a3912efb7bff4 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Mon, 5 Apr 2010 15:20:46 -0500 Subject: Switching to only use the g_dgettext version if the locale_string function doesn't change the string from the normal lookup (and we have a domain to look in). --- libindicator/indicator-desktop-shortcuts.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/libindicator/indicator-desktop-shortcuts.c b/libindicator/indicator-desktop-shortcuts.c index 161350b..cfd8eef 100644 --- a/libindicator/indicator-desktop-shortcuts.c +++ b/libindicator/indicator-desktop-shortcuts.c @@ -438,22 +438,25 @@ indicator_desktop_shortcuts_nick_get_name (IndicatorDesktopShortcuts * ids, cons } gchar * name = NULL; - if (priv->domain == NULL) { - name = g_key_file_get_locale_string(priv->keyfile, + gchar * keyvalue = g_key_file_get_string(priv->keyfile, + groupheader, + G_KEY_FILE_DESKTOP_KEY_NAME, + NULL); + gchar * localeval = g_key_file_get_locale_string(priv->keyfile, groupheader, G_KEY_FILE_DESKTOP_KEY_NAME, NULL, NULL); + g_free(groupheader); + + if (priv->domain != NULL && g_strcmp0(keyvalue, localeval) == 0) { + name = g_strdup(g_dgettext(priv->domain, keyvalue)); + g_free(localeval); } else { - gchar * tempname = g_key_file_get_string(priv->keyfile, - groupheader, - G_KEY_FILE_DESKTOP_KEY_NAME, - NULL); - name = g_strdup(g_dgettext(priv->domain, tempname)); - g_free(tempname); + name = localeval; } - g_free(groupheader); + g_free(keyvalue); return name; } -- cgit v1.2.3 From e0f5fb7d0f6a89f79cab7d26f2d12ef710fc223b Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Mon, 5 Apr 2010 15:37:15 -0500 Subject: releasing version 0.3.6-0ubuntu1~ppa2~shortcutdomain2 --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index c1efeaa..22dd56d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,9 +1,9 @@ -libindicator (0.3.6-0ubuntu1~ppa2~shortcutdomain2) UNRELEASED; urgency=low +libindicator (0.3.6-0ubuntu1~ppa2~shortcutdomain2) lucid; urgency=low * Upstream merge * Chnages requested by pitt - -- Ted Gould Mon, 05 Apr 2010 15:21:06 -0500 + -- Ted Gould Mon, 05 Apr 2010 15:37:13 -0500 libindicator (0.3.6-0ubuntu1~ppa2~shortcutdomain1) lucid; urgency=low -- cgit v1.2.3 From 22de79822416a3396e0087003acaa8f730122305 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 6 Apr 2010 15:55:45 -0500 Subject: Typo --- libindicator/indicator-desktop-shortcuts.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libindicator/indicator-desktop-shortcuts.c b/libindicator/indicator-desktop-shortcuts.c index cfd8eef..b04b482 100644 --- a/libindicator/indicator-desktop-shortcuts.c +++ b/libindicator/indicator-desktop-shortcuts.c @@ -235,7 +235,7 @@ parse_keyfile (IndicatorDesktopShortcuts * ids) } /* Remove a previous translation domain if we had one - from a perviously parsed file. */ + from a previously parsed file. */ if (priv->domain != NULL) { g_free(priv->domain); priv->domain = NULL; -- cgit v1.2.3 From 6262d6f411ffdedc114ebca5ffa3f1b527b7c57f Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 6 Apr 2010 16:21:22 -0500 Subject: releasing version 0.3.6-0ubuntu2~ppa1 --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 0a68c10..38f8168 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,9 +1,9 @@ -libindicator (0.3.6-0ubuntu2~ppa1) UNRELEASED; urgency=low +libindicator (0.3.6-0ubuntu2~ppa1) lucid; urgency=low * Upstream merge * Use the domain in desktop files for shortcuts (LP: #549322) - -- Ted Gould Tue, 06 Apr 2010 15:58:33 -0500 + -- Ted Gould Tue, 06 Apr 2010 16:21:18 -0500 libindicator (0.3.6-0ubuntu1) lucid; urgency=low -- cgit v1.2.3 From 588efad1e8aebb936f94ddf21a45972ba4581306 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 9 Apr 2010 11:53:36 -0500 Subject: Fixing the desktop test to make it more reliable. --- tests/Makefile.am | 2 +- tests/test-desktop-shortcuts.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/Makefile.am b/tests/Makefile.am index cd1a958..13fef2d 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -46,7 +46,7 @@ test_desktop_shortcuts_CFLAGS = \ -Wall -Werror \ -DSRCDIR="\"$(srcdir)\"" \ $(LIBINDICATOR_CFLAGS) -I$(top_srcdir) \ - -DBUILD_DIR="\"$(builddir)\"" + -DBUILD_DIR="\"$(abs_builddir)\"" test_desktop_shortcuts_LDADD = \ $(LIBINDICATOR_LIBS) \ diff --git a/tests/test-desktop-shortcuts.c b/tests/test-desktop-shortcuts.c index 1a655f7..24657c7 100644 --- a/tests/test-desktop-shortcuts.c +++ b/tests/test-desktop-shortcuts.c @@ -103,6 +103,7 @@ test_desktop_shortcuts_launch (void) g_assert(nicks_contains(nicks, "touch")); g_assert(indicator_desktop_shortcuts_nick_exec(ids, "touch")); + g_usleep(100000); g_assert(g_file_test(BUILD_DIR "/test-desktop-shortcuts-touch-test", G_FILE_TEST_EXISTS)); g_object_unref(ids); -- cgit v1.2.3 From ee0f45f6eee073fc3f3329aef08888cff0e6c8c3 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 9 Apr 2010 11:53:43 -0500 Subject: 0.3.7 --- configure.ac | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 136ab6a..a45a477 100644 --- a/configure.ac +++ b/configure.ac @@ -1,10 +1,10 @@ -AC_INIT(libindicator, 0.3.6, ted@canonical.com) +AC_INIT(libindicator, 0.3.7, ted@canonical.com) AC_PREREQ(2.53) AM_CONFIG_HEADER(config.h) -AM_INIT_AUTOMAKE(libindicator, 0.3.6) +AM_INIT_AUTOMAKE(libindicator, 0.3.7) AM_MAINTAINER_MODE m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES]) -- cgit v1.2.3 From e9392e98b500f47f4eab225108196cd031f0038c Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 9 Apr 2010 11:57:05 -0500 Subject: No merging --- .bzr-builddeb/default.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.bzr-builddeb/default.conf b/.bzr-builddeb/default.conf index 3165e05..36c28f8 100644 --- a/.bzr-builddeb/default.conf +++ b/.bzr-builddeb/default.conf @@ -1,2 +1,2 @@ [BUILDDEB] -merge = True +merge = False -- cgit v1.2.3 From 882ef71957a90ada1051f34e72ba15116b8f3808 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 9 Apr 2010 12:51:25 -0500 Subject: Disting the templates. --- libindicator/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libindicator/Makefile.am b/libindicator/Makefile.am index 4b11a77..983a6a5 100644 --- a/libindicator/Makefile.am +++ b/libindicator/Makefile.am @@ -64,7 +64,7 @@ s-enum-types-c: $(indicator_headers) && (cmp -s tmp-indicator-object-enum-types.c indicator-object-enum-types.c || cp tmp-indicator-object-enum-types.c indicator-object-enum-types.c ) \ && rm -f tmp-indicator-object-enum-types.c -EXTRA_DIST += indicator-object-enum-types.h +EXTRA_DIST += indicator-object-enum-types.h.template indicator-object-enum-types.c.template CLEANFILES += \ indicator-object-enum-types.h \ indicator-object-enum-types.c \ -- cgit v1.2.3 From 9530995ab647788c9246bfb5fa986904f3e38796 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 9 Apr 2010 12:53:27 -0500 Subject: 0.3.8 --- configure.ac | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index a45a477..8ae0c74 100644 --- a/configure.ac +++ b/configure.ac @@ -1,10 +1,10 @@ -AC_INIT(libindicator, 0.3.7, ted@canonical.com) +AC_INIT(libindicator, 0.3.8, ted@canonical.com) AC_PREREQ(2.53) AM_CONFIG_HEADER(config.h) -AM_INIT_AUTOMAKE(libindicator, 0.3.7) +AM_INIT_AUTOMAKE(libindicator, 0.3.8) AM_MAINTAINER_MODE m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES]) -- cgit v1.2.3 From 3e9180aefb4f71a9ea55fb58d148d3f63507c52a Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 9 Apr 2010 12:53:42 -0500 Subject: releasing version 0.3.7-0ubuntu1~ppa1 --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 888e321..c95cc03 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,9 +1,9 @@ -libindicator (0.3.7-0ubuntu1~ppa1) UNRELEASED; urgency=low +libindicator (0.3.7-0ubuntu1~ppa1) lucid; urgency=low * New upstream release. * Use the domain in desktop files for shortcuts (LP: #549322) - -- Ted Gould Fri, 09 Apr 2010 11:57:54 -0500 + -- Ted Gould Fri, 09 Apr 2010 12:53:39 -0500 libindicator (0.3.6-0ubuntu1) lucid; urgency=low -- cgit v1.2.3 From 478b7f7a65f1ed01a915d65631c28d82401b7f22 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 9 Apr 2010 12:56:24 -0500 Subject: releasing version 0.3.8-0ubuntu1~ppa1 --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index f754e2d..480e3f9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,9 +1,9 @@ -libindicator (0.3.8-0ubuntu1~ppa1) UNRELEASED; urgency=low +libindicator (0.3.8-0ubuntu1~ppa1) lucid; urgency=low * New upstream release. * Adding template files to tarball - -- Ted Gould Fri, 09 Apr 2010 12:54:18 -0500 + -- Ted Gould Fri, 09 Apr 2010 12:56:19 -0500 libindicator (0.3.7-0ubuntu1~ppa1) lucid; urgency=low -- cgit v1.2.3