Commit df64f450 authored by Bastien Nocera's avatar Bastien Nocera Committed by Juan Pablo Ugarte
Browse files

GladeGtkGrid: Fix "format not a string literal" warning

glade-gtk-grid.c: In function ‘glade_gtk_grid_child_insert_remove_action’:
glade-gtk-grid.c:496:3: error: format not a string literal, argument types not checked [-Werror=format-nonliteral]
   glade_command_push_group (group_format, glade_widget_get_name (parent));
   ^~~~~~~~~~~~~~~~~~~~~~~~

https://bugzilla.gnome.org/show_bug.cgi?id=765612
parent 111eb2d9
......@@ -38,6 +38,13 @@ typedef struct
gint height;
} GladeGridAttachments;
typedef enum {
GROUP_ACTION_INSERT_ROW,
GROUP_ACTION_INSERT_COLUMN,
GROUP_ACTION_REMOVE_COLUMN,
GROUP_ACTION_REMOVE_ROW
} GroupAction;
static gboolean glade_gtk_grid_configure_begin (GladeFixed *fixed,
GladeWidget *child,
GtkWidget *grid);
......@@ -477,7 +484,7 @@ static void
glade_gtk_grid_child_insert_remove_action (GladeWidgetAdaptor *adaptor,
GObject *container,
GObject *object,
const gchar *group_format,
GroupAction group_action,
const gchar *n_row_col,
const gchar *attach1, /* should be smaller (top/left) attachment */
const gchar *attach2, /* should be larger (bot/right) attachment */
......@@ -493,7 +500,24 @@ glade_gtk_grid_child_insert_remove_action (GladeWidgetAdaptor *adaptor,
attach1, &child_pos, NULL);
parent = glade_widget_get_from_gobject (container);
glade_command_push_group (group_format, glade_widget_get_name (parent));
switch (group_action)
{
case GROUP_ACTION_INSERT_ROW:
glade_command_push_group (_("Insert Row on %s"), glade_widget_get_name (parent));
break;
case GROUP_ACTION_INSERT_COLUMN:
glade_command_push_group (_("Insert Column on %s"), glade_widget_get_name (parent));
break;
case GROUP_ACTION_REMOVE_COLUMN:
glade_command_push_group (_("Remove Column on %s"), glade_widget_get_name (parent));
break;
case GROUP_ACTION_REMOVE_ROW:
glade_command_push_group (_("Remove Row on %s"), glade_widget_get_name (parent));
break;
default:
g_assert_not_reached ();
}
children = glade_widget_adaptor_get_children (adaptor, container);
/* Make sure widgets does not get destroyed */
......@@ -594,14 +618,14 @@ glade_gtk_grid_child_action_activate (GladeWidgetAdaptor *adaptor,
if (strcmp (action_path, "insert_row/after") == 0)
{
glade_gtk_grid_child_insert_remove_action (adaptor, container, object,
_("Insert Row on %s"),
GROUP_ACTION_INSERT_ROW,
"n-rows", "top-attach",
"height", FALSE, TRUE);
}
else if (strcmp (action_path, "insert_row/before") == 0)
{
glade_gtk_grid_child_insert_remove_action (adaptor, container, object,
_("Insert Row on %s"),
GROUP_ACTION_INSERT_ROW,
"n-rows", "top-attach",
"height",
FALSE, FALSE);
......@@ -609,28 +633,28 @@ glade_gtk_grid_child_action_activate (GladeWidgetAdaptor *adaptor,
else if (strcmp (action_path, "insert_column/after") == 0)
{
glade_gtk_grid_child_insert_remove_action (adaptor, container, object,
_("Insert Column on %s"),
GROUP_ACTION_INSERT_COLUMN,
"n-columns", "left-attach",
"width", FALSE, TRUE);
}
else if (strcmp (action_path, "insert_column/before") == 0)
{
glade_gtk_grid_child_insert_remove_action (adaptor, container, object,
_("Insert Column on %s"),
GROUP_ACTION_INSERT_COLUMN,
"n-columns", "left-attach",
"width", FALSE, FALSE);
}
else if (strcmp (action_path, "remove_column") == 0)
{
glade_gtk_grid_child_insert_remove_action (adaptor, container, object,
_("Remove Column on %s"),
GROUP_ACTION_REMOVE_COLUMN,
"n-columns", "left-attach",
"width", TRUE, FALSE);
}
else if (strcmp (action_path, "remove_row") == 0)
{
glade_gtk_grid_child_insert_remove_action (adaptor, container, object,
_("Remove Row on %s"),
GROUP_ACTION_REMOVE_ROW,
"n-rows", "top-attach",
"height", TRUE, FALSE);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment