[planner] Fix warning: variable 'priv' set but not used
- From: Alexandre Franke <afranke src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [planner] Fix warning: variable 'priv' set but not used
- Date: Fri, 14 Oct 2011 15:26:58 +0000 (UTC)
commit 5c961312d40f9092f4d7b10e02e018e0912957c7
Author: Tinggong Wang <wangtinggong gmail com>
Date: Fri Oct 14 09:12:55 2011 +0800
Fix warning: variable 'priv' set but not used
https://bugzilla.gnome.org/show_bug.cgi?id=661725
libplanner/mrp-calendar.c | 5 -----
libplanner/mrp-object.c | 5 -----
libplanner/mrp-task-manager.c | 24 ------------------------
libplanner/mrp-task.c | 2 --
src/planner-application.c | 2 --
src/planner-cmd-manager.c | 6 ------
src/planner-gantt-chart.c | 9 ---------
src/planner-gantt-row.c | 3 ---
src/planner-html-plugin.c | 4 ----
src/planner-popup-button.c | 3 ---
src/planner-print-job.c | 4 ----
src/planner-task-date-widget.c | 3 ---
src/planner-task-tree.c | 3 ---
src/planner-usage-chart.c | 5 -----
src/planner-usage-model.c | 3 ---
src/planner-window.c | 21 ---------------------
16 files changed, 0 insertions(+), 102 deletions(-)
---
diff --git a/libplanner/mrp-calendar.c b/libplanner/mrp-calendar.c
index 95925ae..ca75283 100644
--- a/libplanner/mrp-calendar.c
+++ b/libplanner/mrp-calendar.c
@@ -745,7 +745,6 @@ gint
mrp_calendar_day_get_total_work (MrpCalendar *calendar,
MrpDay *day)
{
- MrpCalendarPriv *priv;
GList *list, *l;
MrpInterval *ival;
gint total = 0;
@@ -753,8 +752,6 @@ mrp_calendar_day_get_total_work (MrpCalendar *calendar,
g_return_val_if_fail (MRP_IS_CALENDAR (calendar), 0);
- priv = calendar->priv;
-
list = mrp_calendar_day_get_intervals (calendar, day, TRUE);
for (l = list; l; l = l->next) {
@@ -932,13 +929,11 @@ mrp_calendar_get_day (MrpCalendar *calendar,
mrptime date,
gboolean check_ancestors)
{
- MrpCalendarPriv *priv;
mrptime aligned_date;
MrpDay *day;
g_return_val_if_fail (MRP_IS_CALENDAR (calendar), NULL);
- priv = calendar->priv;
aligned_date = mrp_time_align_day (date);
day = calendar_get_day (calendar, aligned_date, check_ancestors);
diff --git a/libplanner/mrp-object.c b/libplanner/mrp-object.c
index 2d4fedd..414f119 100644
--- a/libplanner/mrp-object.c
+++ b/libplanner/mrp-object.c
@@ -160,11 +160,6 @@ object_init (MrpObject *object)
static void
object_finalize (GObject *g_object)
{
- MrpObject *object = MRP_OBJECT (g_object);
- MrpObjectPriv *priv;
-
- priv = object->priv;
-
if (G_OBJECT_CLASS (parent_class)->finalize) {
(* G_OBJECT_CLASS (parent_class)->finalize) (g_object);
}
diff --git a/libplanner/mrp-task-manager.c b/libplanner/mrp-task-manager.c
index 2388959..382528b 100644
--- a/libplanner/mrp-task-manager.c
+++ b/libplanner/mrp-task-manager.c
@@ -837,12 +837,9 @@ add_predecessor_to_dependency_graph (MrpTaskManager *manager,
MrpTask *task,
MrpTask *predecessor)
{
- MrpTaskManagerPriv *priv;
MrpTaskGraphNode *task_node;
MrpTaskGraphNode *predecessor_node;
- priv = manager->priv;
-
predecessor_node = imrp_task_get_graph_node (predecessor);
task_node = imrp_task_get_graph_node (task);
@@ -886,12 +883,9 @@ remove_predecessor_from_dependency_graph (MrpTaskManager *manager,
MrpTask *task,
MrpTask *predecessor)
{
- MrpTaskManagerPriv *priv;
MrpTaskGraphNode *task_node;
MrpTaskGraphNode *predecessor_node;
- priv = manager->priv;
-
predecessor_node = imrp_task_get_graph_node (predecessor);
task_node = imrp_task_get_graph_node (task);
@@ -939,12 +933,9 @@ remove_parent_from_dependency_graph (MrpTaskManager *manager,
MrpTask *task,
MrpTask *parent)
{
- MrpTaskManagerPriv *priv;
MrpTaskGraphNode *task_node;
MrpTaskGraphNode *parent_node;
- priv = manager->priv;
-
task_node = imrp_task_get_graph_node (task);
parent_node = imrp_task_get_graph_node (parent);
@@ -991,12 +982,9 @@ add_parent_to_dependency_graph (MrpTaskManager *manager,
MrpTask *task,
MrpTask *parent)
{
- MrpTaskManagerPriv *priv;
MrpTaskGraphNode *task_node;
MrpTaskGraphNode *parent_node;
- priv = manager->priv;
-
task_node = imrp_task_get_graph_node (task);
parent_node = imrp_task_get_graph_node (parent);
@@ -1681,7 +1669,6 @@ task_manager_calculate_milestone_work_start (MrpTaskManager *manager,
mrptime start)
{
- MrpTaskManagerPriv *priv;
mrptime t;
mrptime t1, t2;
mrptime work_start;
@@ -1689,8 +1676,6 @@ task_manager_calculate_milestone_work_start (MrpTaskManager *manager,
MrpUnitsInterval *unit_ival;
MrpTaskType type;
- priv = manager->priv;
-
type = mrp_task_get_task_type (task);
g_return_if_fail (type == MRP_TASK_TYPE_MILESTONE);
@@ -2065,7 +2050,6 @@ static void
task_manager_do_forward_pass_helper (MrpTaskManager *manager,
MrpTask *task)
{
- MrpTaskManagerPriv *priv;
mrptime sub_start, sub_work_start, sub_finish;
mrptime old_start, old_finish;
mrptime new_start, new_finish;
@@ -2075,8 +2059,6 @@ task_manager_do_forward_pass_helper (MrpTaskManager *manager,
mrptime t1, t2;
MrpTaskSched sched;
- priv = manager->priv;
-
old_start = mrp_task_get_start (task);
old_finish = mrp_task_get_finish (task);
old_duration = old_finish - old_start;
@@ -2684,7 +2666,6 @@ task_manager_get_work_for_calendar (MrpTaskManager *manager,
mrptime start,
mrptime finish)
{
- MrpTaskManagerPriv *priv;
mrptime t;
mrptime t1, t2;
gint work;
@@ -2692,8 +2673,6 @@ task_manager_get_work_for_calendar (MrpTaskManager *manager,
GList *ivals, *l;
MrpInterval *ival;
- priv = manager->priv;
-
work = 0;
/* Loop through the intervals of the calendar and add up the work, until
@@ -2739,15 +2718,12 @@ task_manager_get_work_for_task_with_assignments (MrpTaskManager *manager,
mrptime start,
mrptime finish)
{
- MrpTaskManagerPriv *priv;
mrptime t;
mrptime t1, t2;
gint work, delta;
GList *ivals, *l;
MrpUnitsInterval *ival;
- priv = manager->priv;
-
work = 0;
/* Loop through the intervals of the calendar and add up the work, until
diff --git a/libplanner/mrp-task.c b/libplanner/mrp-task.c
index c57ed66..fc6c950 100644
--- a/libplanner/mrp-task.c
+++ b/libplanner/mrp-task.c
@@ -653,12 +653,10 @@ static void
task_removed (MrpObject *object)
{
MrpTask *task;
- MrpTaskPriv *priv;
g_return_if_fail (MRP_IS_TASK (object));
task = MRP_TASK (object);
- priv = task->priv;
task_remove_assignments (task);
task_remove_relations (task);
diff --git a/src/planner-application.c b/src/planner-application.c
index 9e21f48..67401de 100644
--- a/src/planner-application.c
+++ b/src/planner-application.c
@@ -222,10 +222,8 @@ PlannerApplication *
planner_application_new (void)
{
PlannerApplication *app;
- PlannerApplicationPriv *priv;
app = PLANNER_APPLICATION (g_object_new (PLANNER_TYPE_APPLICATION, NULL));
- priv = app->priv;
return app;
}
diff --git a/src/planner-cmd-manager.c b/src/planner-cmd-manager.c
index c49d2ad..bbade3f 100644
--- a/src/planner-cmd-manager.c
+++ b/src/planner-cmd-manager.c
@@ -374,13 +374,10 @@ planner_cmd_manager_insert_and_do (PlannerCmdManager *manager, PlannerCmd *cmd)
gboolean
planner_cmd_manager_undo (PlannerCmdManager *manager)
{
- PlannerCmdManagerPriv *priv;
PlannerCmd *cmd;
g_return_val_if_fail (PLANNER_IS_CMD_MANAGER (manager), FALSE);
- priv = manager->priv;
-
cmd = get_undo_cmd (manager, TRUE);
if (!cmd) {
@@ -406,13 +403,10 @@ planner_cmd_manager_undo (PlannerCmdManager *manager)
gboolean
planner_cmd_manager_redo (PlannerCmdManager *manager)
{
- PlannerCmdManagerPriv *priv;
PlannerCmd *cmd;
g_return_val_if_fail (PLANNER_IS_CMD_MANAGER (manager), FALSE);
- priv = manager->priv;
-
cmd = get_redo_cmd (manager, TRUE);
if (!cmd) {
return FALSE;
diff --git a/src/planner-gantt-chart.c b/src/planner-gantt-chart.c
index d42b687..8ded4b2 100644
--- a/src/planner-gantt-chart.c
+++ b/src/planner-gantt-chart.c
@@ -690,13 +690,11 @@ gantt_chart_row_inserted (GtkTreeModel *model,
gpointer data)
{
PlannerGanttChart *chart;
- PlannerGanttChartPriv *priv;
gboolean free_path = FALSE;
MrpTask *task;
TreeNode *node;
chart = data;
- priv = chart->priv;
g_return_if_fail (path != NULL || iter != NULL);
@@ -1360,10 +1358,6 @@ gantt_chart_task_moved (MrpProject *project,
MrpTask *task,
PlannerGanttChart *chart)
{
- PlannerGanttChartPriv *priv;
-
- priv = chart->priv;
-
/* Note: Seems like we don't need this? */
/*gantt_chart_reflow_now (chart);*/
@@ -1852,15 +1846,12 @@ planner_gantt_chart_can_zoom (PlannerGanttChart *chart,
void
planner_gantt_chart_zoom_to_fit (PlannerGanttChart *chart)
{
- PlannerGanttChartPriv *priv;
gdouble t;
gdouble zoom;
gdouble alloc;
g_return_if_fail (PLANNER_IS_GANTT_CHART (chart));
- priv = chart->priv;
-
t = gantt_chart_get_width (chart);
if (t == -1) {
return;
diff --git a/src/planner-gantt-row.c b/src/planner-gantt-row.c
index 5b40e43..badce33 100644
--- a/src/planner-gantt-row.c
+++ b/src/planner-gantt-row.c
@@ -3446,13 +3446,10 @@ task_cmd_edit_property (PlannerWindow *window,
const gchar *property,
const GValue *value)
{
- PlannerTaskTreePriv *priv;
PlannerCmd *cmd_base;
TaskCmdEditProperty *cmd;
PlannerGanttModel *model;
- priv = tree->priv;
-
cmd_base = planner_cmd_new (TaskCmdEditProperty,
_("Edit task property"),
task_cmd_edit_property_do,
diff --git a/src/planner-html-plugin.c b/src/planner-html-plugin.c
index aa9c9b1..9693bc0 100644
--- a/src/planner-html-plugin.c
+++ b/src/planner-html-plugin.c
@@ -65,11 +65,9 @@ html_plugin_export_do (PlannerPlugin *plugin,
const gchar *path,
gboolean show_in_browser)
{
- PlannerPluginPriv *priv;
MrpProject *project;
GtkWidget *dialog;
- priv = plugin->priv;
project = planner_window_get_project (plugin->main_window);
if (!mrp_project_export (project, path, "Planner HTML", TRUE, NULL)) {
@@ -92,7 +90,6 @@ html_plugin_export (GtkAction *action,
gpointer user_data)
{
PlannerPlugin *plugin;
- PlannerPluginPriv *priv;
MrpProject *project;
const gchar *uri;
gchar *filename;
@@ -104,7 +101,6 @@ html_plugin_export (GtkAction *action,
gboolean show;
plugin = PLANNER_PLUGIN (user_data);
- priv = plugin->priv;
filechooser = gtk_file_chooser_dialog_new (_("Export to HTML"),
GTK_WINDOW (plugin->main_window),
diff --git a/src/planner-popup-button.c b/src/planner-popup-button.c
index 1881786..86ce562 100644
--- a/src/planner-popup-button.c
+++ b/src/planner-popup-button.c
@@ -130,15 +130,12 @@ popup_button_press_event_cb (GtkWidget *popup_window,
GdkEventButton *event,
PlannerPopupButton *popup_button)
{
- PlannerPopupButtonPriv *priv;
GtkAllocation alloc;
gdouble x, y;
gint xoffset, yoffset;
gint x1, y1;
gint x2, y2;
- priv = GET_PRIV (popup_button);
-
/* Popdown the window if the click is outside of it. */
if (event->button != 1) {
diff --git a/src/planner-print-job.c b/src/planner-print-job.c
index d9c9b9e..3bdb89a 100644
--- a/src/planner-print-job.c
+++ b/src/planner-print-job.c
@@ -130,10 +130,6 @@ print_job_finalize (GObject *object)
static void
print_job_transform (PlannerPrintJob *job, gdouble *x, gdouble *y)
{
- PlannerPrintJobPriv *priv;
-
- priv = job->priv;
-
if (x) {
*x += MARGIN;
}
diff --git a/src/planner-task-date-widget.c b/src/planner-task-date-widget.c
index e0c8b47..9489a3f 100644
--- a/src/planner-task-date-widget.c
+++ b/src/planner-task-date-widget.c
@@ -98,11 +98,8 @@ static void
task_date_widget_today_clicked_cb (GtkWidget *button,
PlannerTaskDateWidget *widget)
{
- PlannerTaskDateWidgetPriv *priv;
mrptime today;
- priv = GET_PRIV (widget);
-
today = mrp_time_current_time ();
planner_task_date_widget_set_date (widget, today);
}
diff --git a/src/planner-task-tree.c b/src/planner-task-tree.c
index 8907c08..34d3f58 100644
--- a/src/planner-task-tree.c
+++ b/src/planner-task-tree.c
@@ -251,13 +251,10 @@ task_cmd_edit_property (PlannerWindow *window,
const gchar *property,
const GValue *value)
{
- PlannerTaskTreePriv *priv;
PlannerCmd *cmd_base;
TaskCmdEditProperty *cmd;
PlannerGanttModel *model;
- priv = tree->priv;
-
cmd_base = planner_cmd_new (TaskCmdEditProperty,
_("Edit task property"),
task_cmd_edit_property_do,
diff --git a/src/planner-usage-chart.c b/src/planner-usage-chart.c
index e08f853..96548af 100644
--- a/src/planner-usage-chart.c
+++ b/src/planner-usage-chart.c
@@ -534,15 +534,12 @@ planner_usage_chart_can_zoom (PlannerUsageChart *chart,
void
planner_usage_chart_zoom_to_fit (PlannerUsageChart *chart)
{
- PlannerUsageChartPriv *priv;
gdouble t;
gdouble zoom;
gdouble alloc;
g_return_if_fail (PLANNER_IS_USAGE_CHART (chart));
- priv = chart->priv;
-
t = usage_chart_get_width (chart);
if (t == -1) {
return;
@@ -1382,7 +1379,6 @@ usage_chart_row_inserted (GtkTreeModel *model,
gpointer data)
{
PlannerUsageChart *chart;
- PlannerUsageChartPriv *priv;
gboolean free_path = FALSE;
gboolean free_iter = FALSE;
MrpResource *res;
@@ -1390,7 +1386,6 @@ usage_chart_row_inserted (GtkTreeModel *model,
TreeNode *node = NULL;
chart = data;
- priv = chart->priv;
if (path == NULL) {
path = gtk_tree_model_get_path (model, iter);
diff --git a/src/planner-usage-model.c b/src/planner-usage-model.c
index 52ce9e6..06d9508 100644
--- a/src/planner-usage-model.c
+++ b/src/planner-usage-model.c
@@ -717,14 +717,11 @@ usage_model_resource_assignment_added_cb (MrpResource *res,
MrpAssignment *assign,
PlannerUsageModel *model)
{
- PlannerUsageModelPriv *priv;
GNode *res_node;
GNode *assign_node;
GtkTreePath *path;
GtkTreeIter iter;
- priv = model->priv;
-
res_node = g_hash_table_lookup (model->priv->resource2node, res);
assign_node = g_node_new (assign);
g_node_append (res_node, assign_node);
diff --git a/src/planner-window.c b/src/planner-window.c
index 1806d9f..097360b 100644
--- a/src/planner-window.c
+++ b/src/planner-window.c
@@ -441,12 +441,10 @@ recent_chooser_item_activated (GtkRecentChooser *chooser, gpointer user_data)
{
gchar *uri;
PlannerWindow *window;
- PlannerWindowPriv *priv;
g_return_if_fail (PLANNER_IS_WINDOW (user_data));
window = PLANNER_WINDOW (user_data);
- priv = window->priv;
uri = gtk_recent_chooser_get_current_uri (chooser);
if (uri != NULL) {
@@ -842,11 +840,8 @@ window_new_cb (GtkAction *action,
static gchar *
get_last_dir (PlannerWindow *window)
{
- PlannerWindowPriv *priv;
gchar *last_dir;
- priv = window->priv;
-
last_dir = planner_conf_get_string (CONF_LAST_DIR, NULL);
if (last_dir == NULL) {
@@ -861,14 +856,12 @@ window_open_cb (GtkAction *action,
gpointer data)
{
PlannerWindow *window;
- PlannerWindowPriv *priv;
GtkWidget *file_chooser;
GtkFileFilter *filter;
gint response;
gchar *last_dir;
window = PLANNER_WINDOW (data);
- priv = window->priv;
file_chooser = gtk_file_chooser_dialog_new (_("Open a File"),
GTK_WINDOW (window),
@@ -956,12 +949,10 @@ window_page_setup_cb (GtkAction *action,
gpointer data)
{
PlannerWindow *window;
- PlannerWindowPriv *priv;
GtkPageSetup *old_page_setup, *new_page_setup;
GtkPrintSettings *settings;
window = PLANNER_WINDOW (data);
- priv = window->priv;
settings = planner_print_dialog_load_print_settings ();
old_page_setup = planner_print_dialog_load_page_setup ();
@@ -1250,12 +1241,9 @@ window_drag_data_received_cb (GtkWidget *widget,
guint time,
PlannerWindow *window)
{
- PlannerWindowPriv *priv;
gchar **uris;
gint i;
- priv = window->priv;
-
if (data->length < 0 || data->format != 8) {
g_message ("Don't know how to handle format %d", data->format);
gtk_drag_finish (context, FALSE, FALSE, time);
@@ -1872,12 +1860,9 @@ window_get_name (PlannerWindow *window)
static void
window_update_title (PlannerWindow *window)
{
- PlannerWindowPriv *priv;
gchar *name;
gchar *title;
- priv = window->priv;
-
name = window_get_name (window);
title = g_strconcat (name, " - Planner", NULL);
@@ -2002,12 +1987,9 @@ planner_window_get_cmd_manager (PlannerWindow *window)
static void
window_save_state (PlannerWindow *window)
{
- PlannerWindowPriv *priv;
GdkWindowState state;
gboolean maximized;
- priv = window->priv;
-
state = gdk_window_get_state (GTK_WIDGET (window)->window);
if (state & GDK_WINDOW_STATE_MAXIMIZED) {
maximized = TRUE;
@@ -2035,14 +2017,11 @@ window_save_state (PlannerWindow *window)
static void
window_restore_state (PlannerWindow *window)
{
- PlannerWindowPriv *priv;
gboolean exists;
gboolean maximized;
int width, height;
int x, y;
- priv = window->priv;
-
exists = planner_conf_dir_exists (CONF_WINDOW_DIR, NULL);
if (exists) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]