[gnome-settings-daemon] wacom: Fix "format not a string literal" error



commit be140f77d80f101bdc741692a48389a7abf14118
Author: Bastien Nocera <hadess hadess net>
Date:   Thu Mar 24 16:41:17 2016 +0100

    wacom: Fix "format not a string literal" error

 plugins/wacom/gsd-wacom-device.c |   27 +++++++++++++++++++++------
 1 files changed, 21 insertions(+), 6 deletions(-)
---
diff --git a/plugins/wacom/gsd-wacom-device.c b/plugins/wacom/gsd-wacom-device.c
index 52d6600..4d05e35 100644
--- a/plugins/wacom/gsd-wacom-device.c
+++ b/plugins/wacom/gsd-wacom-device.c
@@ -1213,7 +1213,6 @@ static GList *
 gsd_wacom_device_add_buttons_dir (WacomDevice      *wacom_device,
                                  const char       *settings_path,
                                  WacomButtonFlags  direction,
-                                 const char       *button_str,
                                  const char       *button_str_id)
 {
        GList *l;
@@ -1234,7 +1233,23 @@ gsd_wacom_device_add_buttons_dir (WacomDevice      *wacom_device,
                if (flags & WACOM_BUTTON_MODESWITCH)
                        continue;
 
-               name = g_strdup_printf (button_str, button_num++);
+               switch (direction) {
+               case WACOM_BUTTON_POSITION_LEFT:
+                       name = g_strdup_printf (_("Left Button #%d"), button_num++);
+                       break;
+               case WACOM_BUTTON_POSITION_RIGHT:
+                       name = g_strdup_printf (_("Right Button #%d"), button_num++);
+                       break;
+               case WACOM_BUTTON_POSITION_TOP:
+                       name = g_strdup_printf (_("Top Button #%d"), button_num++);
+                       break;
+               case WACOM_BUTTON_POSITION_BOTTOM:
+                       name = g_strdup_printf (_("Bottom Button #%d"), button_num++);
+                       break;
+               default:
+                       g_assert_not_reached ();
+               }
+
                id = g_strdup_printf ("%s%c", button_str_id, i);
                has_oled = (libwacom_get_button_flag (wacom_device, i) & WACOM_BUTTON_OLED) != 0;
                l = g_list_append (l, gsd_wacom_tablet_button_new (name,
@@ -1297,16 +1312,16 @@ gsd_wacom_device_add_buttons (GsdWacomDevice *device,
 
        ret = NULL;
 
-       l = gsd_wacom_device_add_buttons_dir (wacom_device, settings_path, WACOM_BUTTON_POSITION_LEFT, 
_("Left Button #%d"), "button");
+       l = gsd_wacom_device_add_buttons_dir (wacom_device, settings_path, WACOM_BUTTON_POSITION_LEFT, 
"button");
        if (l)
                ret = l;
-       l = gsd_wacom_device_add_buttons_dir (wacom_device, settings_path, WACOM_BUTTON_POSITION_RIGHT, 
_("Right Button #%d"), "button");
+       l = gsd_wacom_device_add_buttons_dir (wacom_device, settings_path, WACOM_BUTTON_POSITION_RIGHT, 
"button");
        if (l)
                ret = g_list_concat (ret, l);
-       l = gsd_wacom_device_add_buttons_dir (wacom_device, settings_path, WACOM_BUTTON_POSITION_TOP, _("Top 
Button #%d"), "button");
+       l = gsd_wacom_device_add_buttons_dir (wacom_device, settings_path, WACOM_BUTTON_POSITION_TOP, 
"button");
        if (l)
                ret = g_list_concat (ret, l);
-       l = gsd_wacom_device_add_buttons_dir (wacom_device, settings_path, WACOM_BUTTON_POSITION_BOTTOM, 
_("Bottom Button #%d"), "button");
+       l = gsd_wacom_device_add_buttons_dir (wacom_device, settings_path, WACOM_BUTTON_POSITION_BOTTOM, 
"button");
        if (l)
                ret = g_list_concat (ret, l);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]