summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Schermer <nick@xfce.org>2012-04-20 18:43:35 +0200
committerNick Schermer <nick@xfce.org>2012-04-20 18:43:35 +0200
commit1407f1b1330e93de9defd44045304af6a53137c2 (patch)
tree5f742b38accea5aca05eac24b87c2e22e6ccfea9
parent73662a19a92aa037f4f39f586e20b4042c2088ab (diff)
downloadxfce4-appfinder-1407f1b1330e93de9defd44045304af6a53137c2.tar.gz
Fix property-changed matching.
%s in scanf sucks since it continues even if the character is not a digit anymore. Use %n to check the suffix.
-rw-r--r--src/appfinder-preferences.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/appfinder-preferences.c b/src/appfinder-preferences.c
index 233aed1..becc111 100644
--- a/src/appfinder-preferences.c
+++ b/src/appfinder-preferences.c
@@ -392,6 +392,7 @@ xfce_appfinder_preferences_action_changed (XfconfChannel *channel,
gint unique_id;
GObject *store;
UpdateContext context;
+ gint offset = 0;
if (prop_name == NULL)
return;
@@ -400,8 +401,9 @@ xfce_appfinder_preferences_action_changed (XfconfChannel *channel,
{
xfce_appfinder_preferences_action_populate (preferences);
}
- else if (sscanf (prop_name, "/actions/action-%d/pattern", &unique_id) == 1
- && G_VALUE_HOLDS_STRING (value))
+ else if (G_VALUE_HOLDS_STRING (value)
+ && sscanf (prop_name, "/actions/action-%d%n", &unique_id, &offset) == 1
+ && g_strcmp0 (prop_name + offset, "/pattern") == 0)
{
context.unique_id = unique_id;
context.value = value;