[gnome-todo/gbsneto/listview2: 1/5] Cleanup after GtkFilter and GtkSorter API changes
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-todo/gbsneto/listview2: 1/5] Cleanup after GtkFilter and GtkSorter API changes
- Date: Fri, 2 Oct 2020 21:20:26 +0000 (UTC)
commit 0006e4bb611cc279735fd55f1acf9e254b98c0a5
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Sat Sep 26 11:25:38 2020 -0300
Cleanup after GtkFilter and GtkSorter API changes
They return their actual type instead of the base class type.
src/core/gtd-manager.c | 9 +++++----
src/gui/gtd-task-list-popover.c | 4 ++--
src/plugins/all-tasks-panel/gtd-all-tasks-panel.c | 10 ++++++----
src/plugins/inbox-panel/gtd-inbox-panel.c | 5 +++--
src/plugins/next-week-panel/gtd-next-week-panel.c | 15 +++++++++------
src/plugins/scheduled-panel/gtd-panel-scheduled.c | 10 ++++++----
src/plugins/today-panel/gtd-panel-today.c | 15 +++++++++------
src/plugins/today-panel/gtd-today-omni-area-addin.c | 5 +++--
src/plugins/welcome/gtd-welcome-workspace.c | 5 +++--
9 files changed, 46 insertions(+), 32 deletions(-)
---
diff --git a/src/core/gtd-manager.c b/src/core/gtd-manager.c
index aaf658f..cf1515a 100644
--- a/src/core/gtd-manager.c
+++ b/src/core/gtd-manager.c
@@ -505,8 +505,8 @@ gtd_manager_class_init (GtdManagerClass *klass)
static void
gtd_manager_init (GtdManager *self)
{
- GtkFilter *archived_lists_filter;
- GtkFilter *inbox_filter;
+ GtkCustomFilter *archived_lists_filter;
+ GtkCustomFilter *inbox_filter;
inbox_filter = gtk_custom_filter_new (filter_inbox_cb, self, NULL);
archived_lists_filter = gtk_custom_filter_new (filter_archived_lists_func, self, NULL);
@@ -516,10 +516,11 @@ gtd_manager_init (GtdManager *self)
self->clock = gtd_clock_new ();
self->cancellable = g_cancellable_new ();
self->lists_model = (GListModel*) gtd_list_store_new (GTD_TYPE_TASK_LIST);
- self->inbox_model = (GListModel*) gtk_filter_list_model_new (self->lists_model, inbox_filter);
+ self->inbox_model = (GListModel*) gtk_filter_list_model_new (self->lists_model,
+ GTK_FILTER (inbox_filter));
self->tasks_model = (GListModel*) _gtd_task_model_new (self);
self->unarchived_tasks_model = (GListModel*) gtk_filter_list_model_new (self->tasks_model,
- archived_lists_filter);
+ GTK_FILTER
(archived_lists_filter));
self->providers_model = (GListModel*) gtd_list_store_new (GTD_TYPE_PROVIDER);
}
diff --git a/src/gui/gtd-task-list-popover.c b/src/gui/gtd-task-list-popover.c
index a42549f..176c0e5 100644
--- a/src/gui/gtd-task-list-popover.c
+++ b/src/gui/gtd-task-list-popover.c
@@ -241,11 +241,11 @@ static void
gtd_task_list_popover_init (GtdTaskListPopover *self)
{
GtdManager *manager = gtd_manager_get_default ();
- GtkFilter *filter;
+ GtkCustomFilter *filter;
filter = gtk_custom_filter_new (filter_listbox_cb, self, NULL);
self->filter_model = gtk_filter_list_model_new (gtd_manager_get_task_lists_model (manager),
- filter);
+ GTK_FILTER (filter));
gtk_widget_init_template (GTK_WIDGET (self));
diff --git a/src/plugins/all-tasks-panel/gtd-all-tasks-panel.c
b/src/plugins/all-tasks-panel/gtd-all-tasks-panel.c
index 5c0377e..5126b0f 100644
--- a/src/plugins/all-tasks-panel/gtd-all-tasks-panel.c
+++ b/src/plugins/all-tasks-panel/gtd-all-tasks-panel.c
@@ -465,16 +465,18 @@ static void
gtd_all_tasks_panel_init (GtdAllTasksPanel *self)
{
GtdManager *manager = gtd_manager_get_default ();
- GtkFilter *filter;
- GtkSorter *sorter;
+ GtkCustomFilter *filter;
+ GtkCustomSorter *sorter;
self->icon = g_themed_icon_new ("view-tasks-all-symbolic");
filter = gtk_custom_filter_new (filter_func, self, NULL);
- self->filter_model = gtk_filter_list_model_new (gtd_manager_get_tasks_model (manager), filter);
+ self->filter_model = gtk_filter_list_model_new (gtd_manager_get_tasks_model (manager),
+ GTK_FILTER (filter));
sorter = gtk_custom_sorter_new (sort_func, self, NULL);
- self->sort_model = gtk_sort_list_model_new (G_LIST_MODEL (self->filter_model), sorter);
+ self->sort_model = gtk_sort_list_model_new (G_LIST_MODEL (self->filter_model),
+ GTK_SORTER (sorter));
/* The main view */
self->view = GTD_TASK_LIST_VIEW (gtd_task_list_view_new ());
diff --git a/src/plugins/inbox-panel/gtd-inbox-panel.c b/src/plugins/inbox-panel/gtd-inbox-panel.c
index 6191003..6227278 100644
--- a/src/plugins/inbox-panel/gtd-inbox-panel.c
+++ b/src/plugins/inbox-panel/gtd-inbox-panel.c
@@ -240,12 +240,13 @@ static void
gtd_inbox_panel_init (GtdInboxPanel *self)
{
GtdManager *manager = gtd_manager_get_default ();
- GtkFilter *filter;
+ GtkCustomFilter *filter;
self->icon = g_themed_icon_new ("mail-inbox-symbolic");
filter = gtk_custom_filter_new (filter_func, self, NULL);
- self->filter_model = gtk_filter_list_model_new (gtd_manager_get_tasks_model (manager), filter);
+ self->filter_model = gtk_filter_list_model_new (gtd_manager_get_tasks_model (manager),
+ GTK_FILTER (filter));
/* The main view */
self->view = GTD_TASK_LIST_VIEW (gtd_task_list_view_new ());
diff --git a/src/plugins/next-week-panel/gtd-next-week-panel.c
b/src/plugins/next-week-panel/gtd-next-week-panel.c
index 1bea8d0..d66770e 100644
--- a/src/plugins/next-week-panel/gtd-next-week-panel.c
+++ b/src/plugins/next-week-panel/gtd-next-week-panel.c
@@ -521,20 +521,23 @@ gtd_next_week_panel_init (GtdNextWeekPanel *self)
{
g_autoptr (GDateTime) now = g_date_time_new_now_local ();
GtdManager *manager = gtd_manager_get_default ();
- GtkFilter *incomplete_filter;
- GtkFilter *filter;
- GtkSorter *sorter;
+ GtkCustomFilter *incomplete_filter;
+ GtkCustomFilter *filter;
+ GtkCustomSorter *sorter;
self->icon = g_themed_icon_new ("view-tasks-week-symbolic");
filter = gtk_custom_filter_new (filter_func, self, NULL);
- self->filter_model = gtk_filter_list_model_new (gtd_manager_get_tasks_model (manager), filter);
+ self->filter_model = gtk_filter_list_model_new (gtd_manager_get_tasks_model (manager),
+ GTK_FILTER (filter));
sorter = gtk_custom_sorter_new (sort_func, self, NULL);
- self->sort_model = gtk_sort_list_model_new (G_LIST_MODEL (self->filter_model), sorter);
+ self->sort_model = gtk_sort_list_model_new (G_LIST_MODEL (self->filter_model),
+ GTK_SORTER (sorter));
incomplete_filter = gtk_custom_filter_new (filter_complete_func, self, NULL);
- self->incomplete_model = gtk_filter_list_model_new (G_LIST_MODEL (self->sort_model), incomplete_filter);
+ self->incomplete_model = gtk_filter_list_model_new (G_LIST_MODEL (self->sort_model),
+ GTK_FILTER (incomplete_filter));
/* The main view */
self->view = GTD_TASK_LIST_VIEW (gtd_task_list_view_new ());
diff --git a/src/plugins/scheduled-panel/gtd-panel-scheduled.c
b/src/plugins/scheduled-panel/gtd-panel-scheduled.c
index 949b052..e9df762 100644
--- a/src/plugins/scheduled-panel/gtd-panel-scheduled.c
+++ b/src/plugins/scheduled-panel/gtd-panel-scheduled.c
@@ -471,16 +471,18 @@ gtd_panel_scheduled_init (GtdPanelScheduled *self)
{
g_autoptr (GDateTime) now = g_date_time_new_now_local ();
GtdManager *manager = gtd_manager_get_default ();
- GtkFilter *filter;
- GtkSorter *sorter;
+ GtkCustomFilter *filter;
+ GtkCustomSorter *sorter;
self->icon = g_themed_icon_new ("alarm-symbolic");
filter = gtk_custom_filter_new (filter_func, self, NULL);
- self->filter_model = gtk_filter_list_model_new (gtd_manager_get_tasks_model (manager), filter);
+ self->filter_model = gtk_filter_list_model_new (gtd_manager_get_tasks_model (manager),
+ GTK_FILTER (filter));
sorter = gtk_custom_sorter_new (sort_func, self, NULL);
- self->sort_model = gtk_sort_list_model_new (G_LIST_MODEL (self->filter_model), sorter);
+ self->sort_model = gtk_sort_list_model_new (G_LIST_MODEL (self->filter_model),
+ GTK_SORTER (sorter));
/* The main view */
self->view = GTD_TASK_LIST_VIEW (gtd_task_list_view_new ());
diff --git a/src/plugins/today-panel/gtd-panel-today.c b/src/plugins/today-panel/gtd-panel-today.c
index a2944cc..d9b553b 100644
--- a/src/plugins/today-panel/gtd-panel-today.c
+++ b/src/plugins/today-panel/gtd-panel-today.c
@@ -423,22 +423,25 @@ gtd_panel_today_init (GtdPanelToday *self)
{
g_autoptr (GDateTime) now = NULL;
GtdManager *manager;
- GtkFilter *incomplete_filter;
- GtkFilter *filter;
- GtkSorter *sorter;
+ GtkCustomFilter *incomplete_filter;
+ GtkCustomFilter *filter;
+ GtkCustomSorter *sorter;
manager = gtd_manager_get_default ();
self->icon = g_themed_icon_new ("view-tasks-today-symbolic");
filter = gtk_custom_filter_new (filter_func, self, NULL);
- self->filter_model = gtk_filter_list_model_new (gtd_manager_get_tasks_model (manager), filter);
+ self->filter_model = gtk_filter_list_model_new (gtd_manager_get_tasks_model (manager),
+ GTK_FILTER (filter));
sorter = gtk_custom_sorter_new (sort_func, self, NULL);
- self->sort_model = gtk_sort_list_model_new (G_LIST_MODEL (self->filter_model), sorter);
+ self->sort_model = gtk_sort_list_model_new (G_LIST_MODEL (self->filter_model),
+ GTK_SORTER (sorter));
incomplete_filter = gtk_custom_filter_new (filter_complete_func, self, NULL);
- self->incomplete_model = gtk_filter_list_model_new (G_LIST_MODEL (self->sort_model), incomplete_filter);
+ self->incomplete_model = gtk_filter_list_model_new (G_LIST_MODEL (self->sort_model),
+ GTK_FILTER (incomplete_filter));
/* Connect to GtdManager::list-* signals to update the title */
manager = gtd_manager_get_default ();
diff --git a/src/plugins/today-panel/gtd-today-omni-area-addin.c
b/src/plugins/today-panel/gtd-today-omni-area-addin.c
index 33ba2ba..cd3def3 100644
--- a/src/plugins/today-panel/gtd-today-omni-area-addin.c
+++ b/src/plugins/today-panel/gtd-today-omni-area-addin.c
@@ -279,15 +279,16 @@ gtd_today_omni_area_addin_class_init (GtdTodayOmniAreaAddinClass *klass)
static void
gtd_today_omni_area_addin_init (GtdTodayOmniAreaAddin *self)
{
+ GtkCustomFilter *filter;
GtdManager *manager;
- GtkFilter *filter;
manager = gtd_manager_get_default ();
self->icon = g_themed_icon_new ("view-tasks-today-symbolic");
filter = gtk_custom_filter_new (filter_func, self, NULL);
- self->filter_model = gtk_filter_list_model_new (gtd_manager_get_tasks_model (manager), filter);
+ self->filter_model = gtk_filter_list_model_new (gtd_manager_get_tasks_model (manager),
+ GTK_FILTER (filter));
g_signal_connect_object (self->filter_model,
"items-changed",
diff --git a/src/plugins/welcome/gtd-welcome-workspace.c b/src/plugins/welcome/gtd-welcome-workspace.c
index 5eb43da..16842c1 100644
--- a/src/plugins/welcome/gtd-welcome-workspace.c
+++ b/src/plugins/welcome/gtd-welcome-workspace.c
@@ -307,7 +307,7 @@ gtd_welcome_workspace_init (GtdWelcomeWorkspace *self)
{
GtdManager *manager;
GListModel *inbox_model;
- GtkFilter *filter;
+ GtkCustomFilter *filter;
gtk_widget_init_template (GTK_WIDGET (self));
@@ -336,7 +336,8 @@ gtd_welcome_workspace_init (GtdWelcomeWorkspace *self)
/* Today */
filter = gtk_custom_filter_new (filter_func, self, NULL);
- self->today_model = gtk_filter_list_model_new (gtd_manager_get_tasks_model (manager), filter);
+ self->today_model = gtk_filter_list_model_new (gtd_manager_get_tasks_model (manager),
+ GTK_FILTER (filter));
g_signal_connect_object (self->today_model,
"items-changed",
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]