[gnome-todo/wip/gbsneto/plugins: 25/62] task-list-view: remove ::(set|get)_manager
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-todo/wip/gbsneto/plugins: 25/62] task-list-view: remove ::(set|get)_manager
- Date: Fri, 15 Jan 2016 01:05:17 +0000 (UTC)
commit f81383099444e92b27c69d872fa8d4f801e110d4
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Sun Dec 27 16:09:32 2015 -0200
task-list-view: remove ::(set|get)_manager
src/gtd-edit-pane.c | 63 --------------------------------------
src/gtd-edit-pane.h | 5 ---
src/gtd-task-list-view.c | 75 +++------------------------------------------
src/gtd-task-list-view.h | 5 ---
src/gtd-window.c | 4 --
5 files changed, 5 insertions(+), 147 deletions(-)
---
diff --git a/src/gtd-edit-pane.c b/src/gtd-edit-pane.c
index a55fe4c..8a86614 100644
--- a/src/gtd-edit-pane.c
+++ b/src/gtd-edit-pane.c
@@ -37,7 +37,6 @@ typedef struct
/* flags */
gint should_save_task : 1;
- GtdManager *manager;
GtdTask *task;
} GtdEditPanePrivate;
@@ -53,7 +52,6 @@ G_DEFINE_TYPE_WITH_PRIVATE (GtdEditPane, gtd_edit_pane, GTK_TYPE_GRID)
enum {
PROP_0,
- PROP_MANAGER,
PROP_TASK,
LAST_PROP
};
@@ -203,10 +201,6 @@ gtd_edit_pane_get_property (GObject *object,
switch (prop_id)
{
- case PROP_MANAGER:
- g_value_set_object (value, self->priv->manager);
- break;
-
case PROP_TASK:
g_value_set_object (value, self->priv->task);
break;
@@ -226,10 +220,6 @@ gtd_edit_pane_set_property (GObject *object,
switch (prop_id)
{
- case PROP_MANAGER:
- self->priv->manager = g_value_get_object (value);
- break;
-
case PROP_TASK:
self->priv->task = g_value_get_object (value);
break;
@@ -250,20 +240,6 @@ gtd_edit_pane_class_init (GtdEditPaneClass *klass)
object_class->set_property = gtd_edit_pane_set_property;
/**
- * GtdEditPane::manager:
- *
- * A weak reference to the application's #GtdManager instance.
- */
- g_object_class_install_property (
- object_class,
- PROP_MANAGER,
- g_param_spec_object ("manager",
- "Manager of this application",
- "The manager of the application",
- GTD_TYPE_MANAGER,
- G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
-
- /**
* GtdEditPane::task:
*
* The task that is actually being edited.
@@ -338,45 +314,6 @@ gtd_edit_pane_new (void)
}
/**
- * gtd_edit_pane_get_manager:
- *
- * Retrieves the #GtdManager of the application.
- *
- * Returns: (transfer none): the #GtdManager of @pane
- */
-GtdManager*
-gtd_edit_pane_get_manager (GtdEditPane *pane)
-{
- g_return_val_if_fail (GTD_IS_EDIT_PANE (pane), NULL);
-
- return pane->priv->manager;
-}
-
-/**
- * gtd_edit_pane_set_manager:
- * @pane: a #GtdEditPane
- * @manager: the singleton #GtdManager
- *
- * Sets the #GtdManager of the application.
- *
- * Returns:
- */
-void
-gtd_edit_pane_set_manager (GtdEditPane *pane,
- GtdManager *manager)
-{
- g_return_if_fail (GTD_IS_EDIT_PANE (pane));
- g_return_if_fail (GTD_IS_MANAGER (manager));
-
- if (pane->priv->manager != manager)
- {
- pane->priv->manager = manager;
-
- g_object_notify (G_OBJECT (pane), "manager");
- }
-}
-
-/**
* gtd_edit_pane_get_task:
* @pane: a #GtdEditPane
*
diff --git a/src/gtd-edit-pane.h b/src/gtd-edit-pane.h
index 8c021ca..617ec15 100644
--- a/src/gtd-edit-pane.h
+++ b/src/gtd-edit-pane.h
@@ -32,11 +32,6 @@ G_DECLARE_FINAL_TYPE (GtdEditPane, gtd_edit_pane, GTD, EDIT_PANE, GtkGrid)
GtkWidget* gtd_edit_pane_new (void);
-GtdManager* gtd_edit_pane_get_manager (GtdEditPane *pane);
-
-void gtd_edit_pane_set_manager (GtdEditPane *pane,
- GtdManager *manager);
-
GtdTask* gtd_edit_pane_get_task (GtdEditPane *pane);
void gtd_edit_pane_set_task (GtdEditPane *pane,
diff --git a/src/gtd-task-list-view.c b/src/gtd-task-list-view.c
index 5bf5de0..3354312 100644
--- a/src/gtd-task-list-view.c
+++ b/src/gtd-task-list-view.c
@@ -51,7 +51,6 @@ typedef struct
gboolean show_completed;
GList *list;
GtdTaskList *task_list;
- GtdManager *manager;
/* color provider */
GtkCssProvider *color_provider;
@@ -104,7 +103,6 @@ typedef struct
enum {
PROP_0,
- PROP_MANAGER,
PROP_READONLY,
PROP_SHOW_COMPLETED,
PROP_SHOW_LIST_NAME,
@@ -117,7 +115,7 @@ remove_task_action (GtdNotification *notification,
{
RemoveTaskData *data = user_data;
- gtd_manager_remove_task (data->view->priv->manager, data->task);
+ gtd_manager_remove_task (gtd_manager_get_default (), data->task);
g_free (data);
}
@@ -193,7 +191,7 @@ gtd_task_list_view__clear_completed_tasks (GSimpleAction *simple,
list = gtd_task_get_list (l->data);
gtd_task_list_remove_task (list, l->data);
- gtd_manager_remove_task (view->priv->manager, l->data);
+ gtd_manager_remove_task (gtd_manager_get_default (), l->data);
}
}
@@ -317,7 +315,7 @@ gtd_task_list_view__edit_task_finished (GtdEditPane *pane,
gtd_task_save (task);
- gtd_manager_update_task (priv->manager, task);
+ gtd_manager_update_task (gtd_manager_get_default (), task);
gtd_task_list_save_task (priv->task_list, task);
gtk_list_box_invalidate_sort (priv->listbox);
@@ -558,7 +556,7 @@ gtd_task_list_view__task_completed (GObject *object,
task_complete = gtd_task_get_complete (task);
- gtd_manager_update_task (priv->manager, task);
+ gtd_manager_update_task (gtd_manager_get_default (), task);
gtd_task_list_save_task (gtd_task_get_list (task), task);
if (task_complete)
@@ -630,7 +628,7 @@ gtd_task_list_view__create_task (GtdTaskRow *row,
gtd_task_set_list (task, priv->task_list);
gtd_task_list_save_task (priv->task_list, task);
- gtd_manager_create_task (priv->manager, task);
+ gtd_manager_create_task (gtd_manager_get_default (), task);
}
static void
@@ -649,10 +647,6 @@ gtd_task_list_view_get_property (GObject *object,
switch (prop_id)
{
- case PROP_MANAGER:
- g_value_set_object (value, self->priv->manager);
- break;
-
case PROP_SHOW_COMPLETED:
g_value_set_boolean (value, self->priv->show_completed);
break;
@@ -680,10 +674,6 @@ gtd_task_list_view_set_property (GObject *object,
switch (prop_id)
{
- case PROP_MANAGER:
- gtd_task_list_view_set_manager (self, g_value_get_object (value));
- break;
-
case PROP_SHOW_COMPLETED:
gtd_task_list_view_set_show_completed (self, g_value_get_boolean (value));
break;
@@ -766,20 +756,6 @@ gtd_task_list_view_class_init (GtdTaskListViewClass *klass)
widget_class->map = gtd_task_list_view_map;
/**
- * GtdTaskListView::manager:
- *
- * A weak reference to the application's #GtdManager instance.
- */
- g_object_class_install_property (
- object_class,
- PROP_MANAGER,
- g_param_spec_object ("manager",
- "Manager of this window's application",
- "The manager of the window's application",
- GTD_TYPE_MANAGER,
- G_PARAM_READWRITE));
-
- /**
* GtdTaskListView::readonly:
*
* Whether the list shows the "New Task" row or not.
@@ -934,47 +910,6 @@ gtd_task_list_view_set_list (GtdTaskListView *view,
}
/**
- * gtd_task_list_view_get_manager:
- * @view: a #GtdTaskListView
- *
- * Retrieves the #GtdManager from @view.
- *
- * Returns: (transfer none): the #GtdManager of @view
- */
-GtdManager*
-gtd_task_list_view_get_manager (GtdTaskListView *view)
-{
- g_return_val_if_fail (GTD_IS_TASK_LIST_VIEW (view), NULL);
-
- return view->priv->manager;
-}
-
-/**
- * gtd_task_list_view_set_manager:
- * @view: a #GtdTaskListView
- * @manager: a #GtdManager
- *
- * Sets the #GtdManager of @view.
- *
- * Returns:
- */
-void
-gtd_task_list_view_set_manager (GtdTaskListView *view,
- GtdManager *manager)
-{
- g_return_if_fail (GTD_IS_TASK_LIST_VIEW (view));
- g_return_if_fail (GTD_IS_MANAGER (manager));
-
- if (view->priv->manager != manager)
- {
- view->priv->manager = manager;
- gtd_edit_pane_set_manager (GTD_EDIT_PANE (view->priv->edit_pane), manager);
-
- g_object_notify (G_OBJECT (view), "manager");
- }
-}
-
-/**
* gtd_task_list_view_get_readonly:
* @view: a #GtdTaskListView
*
diff --git a/src/gtd-task-list-view.h b/src/gtd-task-list-view.h
index 944172e..226c052 100644
--- a/src/gtd-task-list-view.h
+++ b/src/gtd-task-list-view.h
@@ -36,11 +36,6 @@ GList* gtd_task_list_view_get_list (GtdTaskListView
void gtd_task_list_view_set_list (GtdTaskListView *view,
GList *list);
-GtdManager* gtd_task_list_view_get_manager (GtdTaskListView *view);
-
-void gtd_task_list_view_set_manager (GtdTaskListView *view,
- GtdManager *manager);
-
gboolean gtd_task_list_view_get_readonly (GtdTaskListView *view);
void gtd_task_list_view_set_readonly (GtdTaskListView *view,
diff --git a/src/gtd-window.c b/src/gtd-window.c
index 472cedd..f8d599c 100644
--- a/src/gtd-window.c
+++ b/src/gtd-window.c
@@ -969,10 +969,6 @@ gtd_window_set_property (GObject *object,
case PROP_MANAGER:
self->priv->manager = g_value_get_object (value);
- gtd_task_list_view_set_manager (self->priv->list_view, self->priv->manager);
- gtd_task_list_view_set_manager (self->priv->today_list_view, self->priv->manager);
- gtd_task_list_view_set_manager (self->priv->scheduled_list_view, self->priv->manager);
-
g_signal_connect (self->priv->manager,
"notify::ready",
G_CALLBACK (gtd_window__manager_ready_changed),
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]