diff options
author | Bastien Nocera <hadess@hadess.net> | 2016-04-07 15:40:07 +0200 |
---|---|---|
committer | Bastien Nocera <hadess@hadess.net> | 2016-04-07 15:43:27 +0200 |
commit | 14dde9201cd940170ee1411fc6d799de3570d659 (patch) | |
tree | 16468eaccad283b7b4b5f0bee63156a68d577348 /plugins/wacom | |
parent | 10dcf73579dc7180b4afd663e0eba279d85935ca (diff) | |
download | gnome-settings-daemon-14dde9201cd940170ee1411fc6d799de3570d659.tar.gz |
wacom: Fix "format not a string literal" error
And remove extra argument to the formatting function that we wouldn't
have been able to catch before.
https://bugzilla.gnome.org/show_bug.cgi?id=764729
Diffstat (limited to 'plugins/wacom')
-rw-r--r-- | plugins/wacom/gsd-wacom-osd-window.c | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/plugins/wacom/gsd-wacom-osd-window.c b/plugins/wacom/gsd-wacom-osd-window.c index 2bbb91df..d0814b0f 100644 --- a/plugins/wacom/gsd-wacom-osd-window.c +++ b/plugins/wacom/gsd-wacom-osd-window.c @@ -53,6 +53,17 @@ #define CURSOR_HIDE_TIMEOUT 2 /* seconds */ +#define CSS_NORMAL_BUTTON \ + "%s.%s {\n" \ + " opacity: %s\n" \ + "}\n" + +#define CSS_EDITING_BUTTON \ + "%s.%s {\n" \ + " stroke: %s !important;\n" \ + " fill: %s !important;\n" \ + "}\n" + static struct { const gchar *color_name; const gchar *color_value; @@ -847,7 +858,6 @@ gsd_wacom_osd_window_update (GsdWacomOSDWindow *osd_window) buttons_section = g_strdup (""); for (l = osd_window->priv->buttons; l != NULL; l = l->next) { gchar *color_str; - const gchar *css; GsdWacomOSDButton *osd_button = l->data; if (osd_button->priv->visible == FALSE) @@ -855,21 +865,13 @@ gsd_wacom_osd_window_update (GsdWacomOSDWindow *osd_window) if (osd_window_editing_button (osd_window) && osd_button != osd_window->priv->current_button) { - css = "%s.%s {\n" - " opacity: %s\n" - "}\n"; - buttons_section = g_strdup_printf (css, + buttons_section = g_strdup_printf (CSS_NORMAL_BUTTON, buttons_section, osd_button->priv->class, - OPACITY_IN_EDITION, - NULL); + OPACITY_IN_EDITION); } else { color_str = gsd_wacom_osd_button_get_color_str (osd_button); - css = "%s.%s {\n" - " stroke: %s !important;\n" - " fill: %s !important;\n" - "}\n"; - buttons_section = g_strdup_printf (css, + buttons_section = g_strdup_printf (CSS_EDITING_BUTTON, buttons_section, osd_button->priv->class, color_str, |