[planner] Fix warning: variable 'cmd' set but not used
- From: Alexandre Franke <afranke src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [planner] Fix warning: variable 'cmd' set but not used
- Date: Sun, 25 Dec 2011 02:53:24 +0000 (UTC)
commit b2dada5ab3a0f33db62a48b76c2d7368b35db429
Author: Alexandre Franke <alexandre franke gmail com>
Date: Sun Dec 25 02:49:45 2011 +0100
Fix warning: variable 'cmd' set but not used
https://bugzilla.gnome.org/show_bug.cgi?id=662063
src/planner-default-week-dialog.c | 2 ++
src/planner-group-dialog.c | 12 +++++-------
src/planner-resource-dialog.c | 33 ++++++++++++---------------------
src/planner-resource-view.c | 28 ++++++++++------------------
src/planner-task-dialog.c | 29 ++++++++++++-----------------
src/planner-task-tree.c | 16 ++++++----------
6 files changed, 47 insertions(+), 73 deletions(-)
---
diff --git a/src/planner-default-week-dialog.c b/src/planner-default-week-dialog.c
index aa5ac18..6248774 100644
--- a/src/planner-default-week-dialog.c
+++ b/src/planner-default-week-dialog.c
@@ -536,9 +536,11 @@ default_week_cmd_edit_undo (PlannerCmd *cmd_base)
static void
default_week_cmd_edit_free (PlannerCmd *cmd_base)
{
+/* FIXME: cmd_base not freed
DefaultWeekCmdEdit *cmd;
cmd = (DefaultWeekCmdEdit *) cmd_base;
+*/
}
static PlannerCmd *
diff --git a/src/planner-group-dialog.c b/src/planner-group-dialog.c
index c0da626..bf123eb 100644
--- a/src/planner-group-dialog.c
+++ b/src/planner-group-dialog.c
@@ -449,7 +449,6 @@ group_dialog_remove_group_cb (GtkWidget *widget, GtkWidget *dialog)
{
DialogData *data;
GList *list, *node;
- GroupCmdRemove *cmd;
g_return_if_fail (GTK_IS_DIALOG (dialog));
@@ -458,7 +457,7 @@ group_dialog_remove_group_cb (GtkWidget *widget, GtkWidget *dialog)
list = group_dialog_selection_get_list (dialog);
for (node = list; node; node = node->next) {
- cmd = (GroupCmdRemove*) group_cmd_remove (data->view, MRP_GROUP (node->data));
+ group_cmd_remove (data->view, MRP_GROUP (node->data));
}
g_list_free (list);
@@ -687,7 +686,6 @@ group_dialog_cell_edited (GtkCellRendererText *cell,
GValue value = { 0 };
gint column;
MrpGroup *group;
- PlannerCmd *cmd;
gchar *property = "";
data = g_object_get_data (G_OBJECT (dialog), "data");
@@ -738,10 +736,10 @@ group_dialog_cell_edited (GtkCellRendererText *cell,
g_assert_not_reached ();
}
- cmd = group_cmd_edit_property (data->view,
- group,
- property,
- &value);
+ group_cmd_edit_property (data->view,
+ group,
+ property,
+ &value);
gtk_tree_path_free (path);
}
diff --git a/src/planner-resource-dialog.c b/src/planner-resource-dialog.c
index 4a07823..922d856 100644
--- a/src/planner-resource-dialog.c
+++ b/src/planner-resource-dialog.c
@@ -834,7 +834,6 @@ resource_dialog_name_focus_out_cb (GtkWidget *w,
{
gchar *focus_in_name;
GValue value = { 0 };
- PlannerCmd *cmd;
g_assert (MRP_IS_RESOURCE (data->resource));
@@ -843,8 +842,8 @@ resource_dialog_name_focus_out_cb (GtkWidget *w,
g_value_init (&value, G_TYPE_STRING);
g_value_set_string (&value, focus_in_name);
- cmd = resource_cmd_edit_property_focus (data->main_window,
- data->resource, "name", &value);
+ resource_cmd_edit_property_focus (data->main_window,
+ data->resource, "name", &value);
g_free (focus_in_name);
@@ -918,7 +917,6 @@ resource_dialog_short_name_focus_out_cb (GtkWidget *w,
{
gchar *focus_in_short_name;
GValue value = { 0 };
- PlannerCmd *cmd;
g_assert (MRP_IS_RESOURCE (data->resource));
@@ -928,8 +926,8 @@ resource_dialog_short_name_focus_out_cb (GtkWidget *w,
g_value_init (&value, G_TYPE_STRING);
g_value_set_string (&value, focus_in_short_name);
- cmd = resource_cmd_edit_property_focus (data->main_window,
- data->resource, "short_name", &value);
+ resource_cmd_edit_property_focus (data->main_window,
+ data->resource, "short_name", &value);
g_free (focus_in_short_name);
@@ -992,7 +990,6 @@ resource_dialog_type_changed_cb (GtkWidget *w,
{
MrpResourceType type;
GValue value = { 0 };
- PlannerCmd *cmd;
type = resource_dialog_option_menu_get_type_selected (data->type_menu);
@@ -1003,7 +1000,7 @@ resource_dialog_type_changed_cb (GtkWidget *w,
resource_dialog_notify_type_cb,
data->dialog);
- cmd = resource_cmd_edit_property (data->main_window, data->resource, "type", &value);
+ resource_cmd_edit_property (data->main_window, data->resource, "type", &value);
g_signal_handlers_unblock_by_func (data->resource,
resource_dialog_notify_type_cb,
@@ -1055,7 +1052,6 @@ resource_dialog_group_changed_cb (GtkWidget *w,
{
MrpGroup *group;
GValue value = { 0 };
- PlannerCmd *cmd;
group = resource_dialog_option_menu_get_group_selected (data->group_menu);
@@ -1066,7 +1062,7 @@ resource_dialog_group_changed_cb (GtkWidget *w,
resource_dialog_notify_group_cb,
data->dialog);
- cmd = resource_cmd_edit_property (data->main_window, data->resource, "group", &value);
+ resource_cmd_edit_property (data->main_window, data->resource, "group", &value);
g_signal_handlers_unblock_by_func (data->resource,
resource_dialog_notify_group_cb,
@@ -1105,7 +1101,6 @@ resource_dialog_email_focus_out_cb (GtkWidget *w,
{
gchar *focus_in_email;
GValue value = { 0 };
- PlannerCmd *cmd;
g_assert (MRP_IS_RESOURCE (data->resource));
@@ -1114,8 +1109,8 @@ resource_dialog_email_focus_out_cb (GtkWidget *w,
g_value_init (&value, G_TYPE_STRING);
g_value_set_string (&value, focus_in_email);
- cmd = resource_cmd_edit_property_focus (data->main_window,
- data->resource, "email", &value);
+ resource_cmd_edit_property_focus (data->main_window,
+ data->resource, "email", &value);
g_free (focus_in_email);
@@ -1169,11 +1164,10 @@ resource_dialog_resource_cost_focus_out_cb (GtkWidget *w,
DialogData *data)
{
gchar *focus_in_cost;
- PlannerCmd *cmd;
focus_in_cost = g_object_get_data (G_OBJECT (data->resource), "focus_in_cost");
- cmd = resource_cmd_edit_cost (data, focus_in_cost);
+ resource_cmd_edit_cost (data, focus_in_cost);
g_free (focus_in_cost);
@@ -1300,11 +1294,10 @@ resource_dialog_note_focus_out_cb (GtkWidget *w,
DialogData *data)
{
gchar *focus_in_note;
- PlannerCmd *cmd;
focus_in_note = g_object_get_data (G_OBJECT (data->resource),"focus_in_note");
- cmd = resource_cmd_edit_note (data, focus_in_note);
+ resource_cmd_edit_note (data, focus_in_note);
g_free (focus_in_note);
@@ -1390,7 +1383,6 @@ resource_dialog_note_stamp_clicked_cb (GtkWidget *w,
gchar *utf8, *note, *note_old;
GtkTextMark *mark;
GtkTextIter start, end;
- PlannerCmd *cmd;
g_object_get (data->resource, "note", ¬e_old, NULL);
@@ -1434,7 +1426,7 @@ resource_dialog_note_stamp_clicked_cb (GtkWidget *w,
g_object_set (data->resource, "note", note, NULL);
- cmd = resource_cmd_edit_note (data, note_old);
+ resource_cmd_edit_note (data, note_old);
g_free (note_old);
}
@@ -1449,7 +1441,6 @@ resource_dialog_calendar_toggled_cb (GtkCellRendererToggle *cell,
GtkTreeIter iter;
gboolean selected;
MrpCalendar *calendar;
- PlannerCmd *cmd;
if (g_getenv ("PLANNER_DEBUG_UNDO_RESOURCE")) {
g_message ("Changing the calendar for the resource %s",
@@ -1469,7 +1460,7 @@ resource_dialog_calendar_toggled_cb (GtkCellRendererToggle *cell,
-1);
if (!selected) {
- cmd = resource_cmd_edit_calendar (data, calendar);
+ resource_cmd_edit_calendar (data, calendar);
}
gtk_tree_path_free (path);
diff --git a/src/planner-resource-view.c b/src/planner-resource-view.c
index 7a73406..c344db5 100644
--- a/src/planner-resource-view.c
+++ b/src/planner-resource-view.c
@@ -1004,7 +1004,6 @@ resource_view_remove_resource_cb (GtkAction *action,
PlannerResourceViewPriv *priv;
MrpProject *project;
GList *list, *node;
- ResourceCmdRemove *cmd;
view = PLANNER_VIEW (data);
priv = PLANNER_RESOURCE_VIEW (view)->priv;
@@ -1014,7 +1013,7 @@ resource_view_remove_resource_cb (GtkAction *action,
list = resource_view_selection_get_list (view);
for (node = list; node; node = node->next) {
- cmd = (ResourceCmdRemove*) resource_cmd_remove (view, MRP_RESOURCE (node->data));
+ resource_cmd_remove (view, MRP_RESOURCE (node->data));
}
g_list_free (list);
@@ -1569,7 +1568,6 @@ resource_view_cell_name_edited (GtkCellRendererText *cell,
gpointer user_data)
{
PlannerView *view;
- PlannerCmd *cmd;
MrpResource *resource;
GtkTreeView *tree_view;
GtkTreeModel *model;
@@ -1590,7 +1588,7 @@ resource_view_cell_name_edited (GtkCellRendererText *cell,
g_value_init (&value, G_TYPE_STRING);
g_value_set_string (&value, new_text);
- cmd = resource_cmd_edit_property (view, resource, "name", &value);
+ resource_cmd_edit_property (view, resource, "name", &value);
g_value_unset (&value);
gtk_tree_path_free (path);
@@ -1603,7 +1601,6 @@ resource_view_cell_short_name_edited (GtkCellRendererText *cell,
gpointer user_data)
{
PlannerResourceView *view;
- PlannerCmd *cmd;
MrpResource *resource;
GtkTreeView *tree_view;
GtkTreeModel *model;
@@ -1625,7 +1622,7 @@ resource_view_cell_short_name_edited (GtkCellRendererText *cell,
g_value_init (&value, G_TYPE_STRING);
g_value_set_string (&value, new_text);
- cmd = resource_cmd_edit_property (PLANNER_VIEW (view), resource, "short_name", &value);
+ resource_cmd_edit_property (PLANNER_VIEW (view), resource, "short_name", &value);
g_value_unset (&value);
gtk_tree_path_free (path);
@@ -1639,7 +1636,6 @@ resource_view_cell_email_edited (GtkCellRendererText *cell,
gpointer user_data)
{
PlannerView *view;
- PlannerCmd *cmd;
MrpResource *resource;
GtkTreeView *tree_view;
GtkTreeModel *model;
@@ -1661,7 +1657,7 @@ resource_view_cell_email_edited (GtkCellRendererText *cell,
g_value_init (&value, G_TYPE_STRING);
g_value_set_string (&value, new_text);
- cmd = resource_cmd_edit_property (view, resource, "email", &value);
+ resource_cmd_edit_property (view, resource, "email", &value);
g_value_unset (&value);
gtk_tree_path_free (path);
@@ -1674,7 +1670,6 @@ resource_view_cell_cost_edited (GtkCellRendererText *cell,
gpointer user_data)
{
PlannerView *view;
- PlannerCmd *cmd;
MrpResource *resource;
GtkTreeView *tree_view;
GtkTreeModel *model;
@@ -1698,7 +1693,7 @@ resource_view_cell_cost_edited (GtkCellRendererText *cell,
fvalue = planner_parse_float (new_text);
g_value_init (&value, G_TYPE_FLOAT);
g_value_set_float (&value, fvalue);
- cmd = resource_cmd_edit_property (view, resource, "cost", &value);
+ resource_cmd_edit_property (view, resource, "cost", &value);
g_value_unset (&value);
gtk_tree_path_free (path);
@@ -1711,7 +1706,6 @@ resource_view_cell_type_edited (PlannerCellRendererList *cell,
gpointer user_data)
{
PlannerView *view;
- PlannerCmd *cmd;
MrpResource *resource;
MrpResourceType type;
GtkTreeView *tree_view;
@@ -1740,7 +1734,7 @@ resource_view_cell_type_edited (PlannerCellRendererList *cell,
g_value_init (&value, G_TYPE_INT);
g_value_set_int (&value, type);
- cmd = resource_cmd_edit_property (view, resource, "type", &value);
+ resource_cmd_edit_property (view, resource, "type", &value);
g_value_unset (&value);
gtk_tree_path_free (path);
@@ -1796,7 +1790,6 @@ resource_view_cell_group_edited (PlannerCellRendererList *cell,
gpointer user_data)
{
PlannerView *view;
- PlannerCmd *cmd;
MrpResource *resource;
MrpGroup *group;
GtkTreeView *tree_view;
@@ -1831,7 +1824,7 @@ resource_view_cell_group_edited (PlannerCellRendererList *cell,
g_value_init (&value, MRP_TYPE_GROUP);
g_value_set_object (&value, group);
- cmd = resource_cmd_edit_property (view, resource, "group", &value);
+ resource_cmd_edit_property (view, resource, "group", &value);
g_value_unset (&value);
gtk_tree_path_free (path);
@@ -1901,7 +1894,6 @@ resource_view_property_value_edited (GtkCellRendererText *cell,
ColPropertyData *data)
{
PlannerView *view;
- PlannerCmd *cmd;
GtkTreePath *path;
GtkTreeIter iter;
GtkTreeModel *model;
@@ -1922,9 +1914,9 @@ resource_view_property_value_edited (GtkCellRendererText *cell,
value = resource_view_custom_property_set_value (property, new_text);
- cmd = resource_cmd_edit_custom_property (view, resource,
- property,
- &value);
+ resource_cmd_edit_custom_property (view, resource,
+ property,
+ &value);
g_value_unset (&value);
gtk_tree_path_free (path);
diff --git a/src/planner-task-dialog.c b/src/planner-task-dialog.c
index 01b9495..67b7d2c 100644
--- a/src/planner-task-dialog.c
+++ b/src/planner-task-dialog.c
@@ -1168,7 +1168,6 @@ task_dialog_name_focus_out_cb (GtkWidget *w,
{
gchar *focus_in_name;
GValue value = { 0 };
- PlannerCmd *cmd;
g_assert (MRP_IS_TASK (data->task));
@@ -1177,8 +1176,8 @@ task_dialog_name_focus_out_cb (GtkWidget *w,
g_value_init (&value, G_TYPE_STRING);
g_value_set_string (&value, focus_in_name);
- cmd = task_cmd_edit_property_focus (data->main_window,
- data->task, "name", &value);
+ task_cmd_edit_property_focus (data->main_window,
+ data->task, "name", &value);
g_free (focus_in_name);
@@ -1337,7 +1336,6 @@ task_dialog_work_focus_out_cb (GtkWidget *w,
gint current_work;
gint focus_in_work;
GValue value = { 0 };
- PlannerCmd *cmd;
g_object_get (data->task, "project", &project, NULL);
@@ -1356,9 +1354,9 @@ task_dialog_work_focus_out_cb (GtkWidget *w,
g_value_init (&value, G_TYPE_INT);
g_value_set_int (&value, focus_in_work);
- cmd = task_cmd_edit_property_focus (data->main_window,
- data->task, "work",
- &value);
+ task_cmd_edit_property_focus (data->main_window,
+ data->task, "work",
+ &value);
return FALSE;
}
@@ -1416,7 +1414,6 @@ task_dialog_duration_focus_out_cb (GtkWidget *w,
gint current_duration;
gint focus_in_duration;
GValue value = { 0 };
- PlannerCmd *cmd;
g_object_get (data->task, "project", &project, NULL);
@@ -1435,9 +1432,9 @@ task_dialog_duration_focus_out_cb (GtkWidget *w,
g_value_init (&value, G_TYPE_INT);
g_value_set_int (&value, focus_in_duration);
- cmd = task_cmd_edit_property_focus (data->main_window,
- data->task, "duration",
- &value);
+ task_cmd_edit_property_focus (data->main_window,
+ data->task, "duration",
+ &value);
return FALSE;
}
@@ -1562,7 +1559,6 @@ task_dialog_complete_focus_out_cb (GtkWidget *w,
guint current_complete;
guint focus_in_complete;
GValue value = { 0 };
- PlannerCmd *cmd;
g_assert (MRP_IS_TASK (data->task));
@@ -1581,8 +1577,8 @@ task_dialog_complete_focus_out_cb (GtkWidget *w,
g_value_init (&value, G_TYPE_UINT);
g_value_set_uint (&value, focus_in_complete);
- cmd = task_cmd_edit_property_focus (data->main_window,
- data->task, "percent_complete", &value);
+ task_cmd_edit_property_focus (data->main_window,
+ data->task, "percent_complete", &value);
return FALSE;
}
@@ -1653,7 +1649,7 @@ task_dialog_priority_focus_out_cb (GtkWidget *w,
gint current_priority;
gint focus_in_priority;
GValue value = { 0 };
- PlannerCmd *cmd;
+ PlannerCmd __attribute__ ((unused)) *cmd;
g_assert (MRP_IS_TASK (data->task));
@@ -1749,11 +1745,10 @@ task_dialog_note_focus_out_cb (GtkWidget *w,
DialogData *data)
{
gchar *focus_in_note;
- PlannerCmd *cmd;
focus_in_note = g_object_get_data (G_OBJECT (data->task),"focus_in_note");
- cmd = task_cmd_edit_note (data, focus_in_note);
+ task_cmd_edit_note (data, focus_in_note);
if (g_getenv ("PLANNER_DEBUG_UNDO_TASK")) {
gchar *note;
diff --git a/src/planner-task-tree.c b/src/planner-task-tree.c
index 34d3f58..2a7a5af 100644
--- a/src/planner-task-tree.c
+++ b/src/planner-task-tree.c
@@ -2112,7 +2112,6 @@ task_tree_property_value_edited (GtkCellRendererText *cell,
gchar *new_text,
ColPropertyData *data)
{
- PlannerCmd *cmd;
GtkTreePath *path;
GtkTreeIter iter;
GtkTreeModel *model;
@@ -2130,7 +2129,7 @@ task_tree_property_value_edited (GtkCellRendererText *cell,
value = task_view_custom_property_set_value (property, new_text, cell);
- cmd = task_cmd_edit_custom_property (data->tree, task, property, &value);
+ task_cmd_edit_custom_property (data->tree, task, property, &value);
g_value_unset (&value);
@@ -2643,7 +2642,6 @@ planner_task_tree_insert_subtask (PlannerTaskTree *tree)
gint work;
gint depth;
gint position;
- PlannerCmd *cmd;
GtkTreeIter iter;
list = planner_task_tree_get_selected_tasks (tree);
@@ -2683,8 +2681,8 @@ planner_task_tree_insert_subtask (PlannerTaskTree *tree)
parent = NULL;
}
- cmd = planner_task_cmd_insert (tree->priv->main_window,
- parent, position, work, work, NULL);
+ planner_task_cmd_insert (tree->priv->main_window,
+ parent, position, work, work, NULL);
if (!GTK_WIDGET_HAS_FOCUS (tree)) {
gtk_widget_grab_focus (GTK_WIDGET (tree));
@@ -2716,7 +2714,6 @@ planner_task_tree_insert_task (PlannerTaskTree *tree)
gint work;
gint position;
gint depth;
- PlannerCmd *cmd;
priv = tree->priv;
@@ -2773,8 +2770,8 @@ planner_task_tree_insert_task (PlannerTaskTree *tree)
parent = NULL;
}
- cmd = planner_task_cmd_insert (tree->priv->main_window,
- parent, position, work, work, NULL);
+ planner_task_cmd_insert (tree->priv->main_window,
+ parent, position, work, work, NULL);
if (!GTK_WIDGET_HAS_FOCUS (tree)) {
gtk_widget_grab_focus (GTK_WIDGET (tree));
@@ -2797,7 +2794,6 @@ planner_task_tree_remove_task (PlannerTaskTree *tree)
{
PlannerTaskTreePriv *priv;
GList *list, *l;
- TaskCmdRemove *cmd;
PlannerGanttModel *model;
gboolean many;
@@ -2830,7 +2826,7 @@ planner_task_tree_remove_task (PlannerTaskTree *tree)
/* Children are removed with the parent. */
if (path != NULL) {
- cmd = (TaskCmdRemove*) task_cmd_remove (tree, path, task);
+ task_cmd_remove (tree, path, task);
}
gtk_tree_path_free (path);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]