Update to GTK 3.98.5 API changes

parent b13c592d
Pipeline #189528 passed with stages
in 12 minutes and 1 second
......@@ -121,8 +121,8 @@ check_provider_is_default (GtdManager *self,
*/
static gboolean
filter_achived_lists_func (gpointer item,
gpointer user_data)
filter_archived_lists_func (gpointer item,
gpointer user_data)
{
GtdTaskList *list;
GtdTask *task;
......@@ -205,13 +205,16 @@ on_list_changed_cb (GtdProvider *provider,
GtdTaskList *list,
GtdManager *self)
{
GtkFilter *filter;
GTD_ENTRY;
gtd_list_store_sort (GTD_LIST_STORE (self->lists_model),
(GCompareDataFunc) compare_lists_cb,
self);
gtk_filter_list_model_refilter (GTK_FILTER_LIST_MODEL (self->unarchived_tasks_model));
filter = gtk_filter_list_model_get_filter (GTK_FILTER_LIST_MODEL (self->unarchived_tasks_model));
gtk_filter_changed (filter, GTK_FILTER_CHANGE_DIFFERENT);
g_signal_emit (self, signals[LIST_CHANGED], 0, list);
......@@ -502,17 +505,21 @@ gtd_manager_class_init (GtdManagerClass *klass)
static void
gtd_manager_init (GtdManager *self)
{
g_autoptr (GtkFilter) archived_lists_filter = NULL;
g_autoptr (GtkFilter) inbox_filter = NULL;
inbox_filter = gtk_custom_filter_new (filter_inbox_cb, self, NULL);
archived_lists_filter = gtk_custom_filter_new (filter_archived_lists_func, self, NULL);
self->settings = g_settings_new ("org.gnome.todo");
self->plugin_manager = gtd_plugin_manager_new ();
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, filter_inbox_cb, self, NULL);
self->inbox_model = (GListModel*) gtk_filter_list_model_new (self->lists_model, inbox_filter);
self->tasks_model = (GListModel*) _gtd_task_model_new (self);
self->unarchived_tasks_model = (GListModel*) gtk_filter_list_model_new (self->tasks_model,
filter_achived_lists_func,
self,
NULL);
archived_lists_filter);
self->providers_model = (GListModel*) gtd_list_store_new (GTD_TYPE_PROVIDER);
}
......
......@@ -190,7 +190,10 @@ static void
on_search_entry_search_changed_cb (GtkEntry *search_entry,
GtdTaskListPopover *self)
{
gtk_filter_list_model_refilter (self->filter_model);
GtkFilter *filter;
filter = gtk_filter_list_model_get_filter (self->filter_model);
gtk_filter_changed (filter, GTK_FILTER_CHANGE_DIFFERENT);
}
......@@ -237,12 +240,11 @@ gtd_task_list_popover_class_init (GtdTaskListPopoverClass *klass)
static void
gtd_task_list_popover_init (GtdTaskListPopover *self)
{
g_autoptr (GtkFilter) filter = NULL;
GtdManager *manager = gtd_manager_get_default ();
self->filter_model = gtk_filter_list_model_new (gtd_manager_get_task_lists_model (manager),
filter_listbox_cb,
self,
NULL);
filter = gtk_custom_filter_new (filter_listbox_cb, self, NULL);
self->filter_model = gtk_filter_list_model_new (gtd_manager_get_tasks_model (manager), filter);
gtk_widget_init_template (GTK_WIDGET (self));
......
......@@ -625,13 +625,13 @@ row_is_subtask_of (GtdTaskRow *row_a,
static GtkListBoxRow*
get_drop_row_at_y (GtdTaskListView *self,
gint y)
gdouble y)
{
GtdTaskListViewPrivate *priv;
GtkListBoxRow *hovered_row;
GtkListBoxRow *task_row;
GtkListBoxRow *drop_row;
gint row_y, row_height;
gdouble row_y, row_height;
priv = gtd_task_list_view_get_instance_private (self);
......@@ -715,10 +715,10 @@ scroll_to_dnd (gpointer user_data)
static void
check_dnd_scroll (GtdTaskListView *self,
gboolean should_cancel,
gint y)
gdouble y)
{
GtdTaskListViewPrivate *priv = gtd_task_list_view_get_instance_private (self);
gint current_y, height;
gdouble current_y, height;
if (should_cancel)
{
......@@ -781,7 +781,7 @@ on_drop_target_drag_motion_cb (GtkDropTarget *drop_target,
GdkDrop *drop;
GtdTask *task;
GdkDrag *drag;
gint x_offset;
gdouble x_offset;
GTD_ENTRY;
......
......@@ -162,7 +162,6 @@ date_to_label_binding_cb (GBinding *binding,
return TRUE;
}
#if 0
static GtkWidget*
create_transient_row (GtdTaskRow *self)
{
......@@ -181,7 +180,6 @@ create_transient_row (GtdTaskRow *self)
return GTK_WIDGET (new_row);
}
#endif
/*
......@@ -263,7 +261,10 @@ on_drag_begin_cb (GtkDragSource *source,
GdkDrag *drag,
GtdTaskRow *self)
{
GtkWidget *drag_icon;
GtkWidget *new_row;
GtkWidget *widget;
gint x_offset;
GTD_ENTRY;
......@@ -271,22 +272,12 @@ on_drag_begin_cb (GtkDragSource *source,
gtk_widget_set_cursor_from_name (widget, "grabbing");
#if 0
g_autoptr (GtkWidget) drag_icon = NULL;
GtkWidget * *new_row;
gint x_offset;
/*
* gtk_drag_set_icon_widget() inserts the row in a different GtkWindow, so
* we have to create a new, transient row.
*/
new_row = create_transient_row (self);
drag_icon = gtk_drag_icon_new_for_drag (drag);
gtk_container_add (GTK_CONTAINER (drag_icon), new_row);
drag_icon = gtk_drag_icon_get_for_drag (drag);
gtk_drag_icon_set_child (GTK_DRAG_ICON (drag_icon), new_row);
x_offset = gtk_widget_get_margin_start (self->content_box);
gdk_drag_set_hotspot (drag, self->clicked_x + x_offset, self->clicked_y);
#endif
gtk_widget_hide (widget);
......
......@@ -310,11 +310,13 @@ on_clock_day_changed_cb (GtdClock *clock,
GtdAllTasksPanel *self)
{
g_autoptr (GDateTime) now = NULL;
GtkFilter *filter;
now = g_date_time_new_now_local ();
gtd_task_list_view_set_default_date (self->view, now);
gtk_filter_list_model_refilter (self->filter_model);
filter = gtk_filter_list_model_get_filter (self->filter_model);
gtk_filter_changed (filter, GTK_FILTER_CHANGE_DIFFERENT);
}
/*
......@@ -462,12 +464,17 @@ gtd_all_tasks_panel_class_init (GtdAllTasksPanelClass *klass)
static void
gtd_all_tasks_panel_init (GtdAllTasksPanel *self)
{
g_autoptr (GtkFilter) filter = NULL;
g_autoptr (GtkSorter) sorter = NULL;
GtdManager *manager = gtd_manager_get_default ();
self->icon = g_themed_icon_new ("view-tasks-all-symbolic");
self->filter_model = gtk_filter_list_model_new (gtd_manager_get_tasks_model (manager), filter_func, self, NULL);
self->sort_model = gtk_sort_list_model_new (G_LIST_MODEL (self->filter_model), sort_func, self, NULL);
filter = gtk_custom_filter_new (filter_func, self, NULL);
self->filter_model = gtk_filter_list_model_new (gtd_manager_get_tasks_model (manager), 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);
/* The main view */
self->view = GTD_TASK_LIST_VIEW (gtd_task_list_view_new ());
......
......@@ -239,10 +239,13 @@ gtd_inbox_panel_class_init (GtdInboxPanelClass *klass)
static void
gtd_inbox_panel_init (GtdInboxPanel *self)
{
g_autoptr (GtkFilter) filter = NULL;
GtdManager *manager = gtd_manager_get_default ();
self->icon = g_themed_icon_new ("mail-inbox-symbolic");
self->filter_model = gtk_filter_list_model_new (gtd_manager_get_tasks_model (manager), filter_func, self, NULL);
filter = gtk_custom_filter_new (filter_func, self, NULL);
self->filter_model = gtk_filter_list_model_new (gtd_manager_get_tasks_model (manager), filter);
/* The main view */
self->view = GTD_TASK_LIST_VIEW (gtd_task_list_view_new ());
......
......@@ -363,11 +363,13 @@ on_clock_day_changed_cb (GtdClock *clock,
GtdNextWeekPanel *self)
{
g_autoptr (GDateTime) now = NULL;
GtkFilter *filter;
now = g_date_time_new_now_local ();
gtd_task_list_view_set_default_date (self->view, now);
gtk_filter_list_model_refilter (self->filter_model);
filter = gtk_filter_list_model_get_filter (self->filter_model);
gtk_filter_changed (filter, GTK_FILTER_CHANGE_DIFFERENT);
}
/*
......@@ -517,14 +519,22 @@ gtd_next_week_panel_class_init (GtdNextWeekPanelClass *klass)
static void
gtd_next_week_panel_init (GtdNextWeekPanel *self)
{
g_autoptr (GtkFilter) incomplete_filter = NULL;
g_autoptr (GtkFilter) filter = NULL;
g_autoptr (GtkSorter) sorter = NULL;
g_autoptr (GDateTime) now = g_date_time_new_now_local ();
GtdManager *manager = gtd_manager_get_default ();
self->icon = g_themed_icon_new ("view-tasks-week-symbolic");
self->filter_model = gtk_filter_list_model_new (gtd_manager_get_tasks_model (manager), filter_func, self, NULL);
self->sort_model = gtk_sort_list_model_new (G_LIST_MODEL (self->filter_model), sort_func, self, NULL);
self->incomplete_model = gtk_filter_list_model_new (G_LIST_MODEL (self->sort_model), filter_complete_func, self, NULL);
filter = gtk_custom_filter_new (filter_func, self, NULL);
self->filter_model = gtk_filter_list_model_new (gtd_manager_get_tasks_model (manager), 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);
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);
/* The main view */
self->view = GTD_TASK_LIST_VIEW (gtd_task_list_view_new ());
......
......@@ -320,11 +320,13 @@ on_clock_day_changed_cb (GtdClock *clock,
GtdPanelScheduled *self)
{
g_autoptr (GDateTime) now = NULL;
GtkFilter *filter;
now = g_date_time_new_now_local ();
gtd_task_list_view_set_default_date (self->view, now);
gtk_filter_list_model_refilter (self->filter_model);
filter = gtk_filter_list_model_get_filter (self->filter_model);
gtk_filter_changed (filter, GTK_FILTER_CHANGE_DIFFERENT);
}
......@@ -467,13 +469,18 @@ gtd_panel_scheduled_class_init (GtdPanelScheduledClass *klass)
static void
gtd_panel_scheduled_init (GtdPanelScheduled *self)
{
g_autoptr (GtkFilter) filter = NULL;
g_autoptr (GtkSorter) sorter = NULL;
g_autoptr (GDateTime) now = g_date_time_new_now_local ();
GtdManager *manager = gtd_manager_get_default ();
self->icon = g_themed_icon_new ("alarm-symbolic");
self->filter_model = gtk_filter_list_model_new (gtd_manager_get_tasks_model (manager), filter_func, self, NULL);
self->sort_model = gtk_sort_list_model_new (G_LIST_MODEL (self->filter_model), sort_func, self, NULL);
filter = gtk_custom_filter_new (filter_func, self, NULL);
self->filter_model = gtk_filter_list_model_new (gtd_manager_get_tasks_model (manager), 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);
/* The main view */
self->view = GTD_TASK_LIST_VIEW (gtd_task_list_view_new ());
......
......@@ -269,11 +269,13 @@ on_clock_day_changed_cb (GtdClock *clock,
GtdPanelToday *self)
{
g_autoptr (GDateTime) now = NULL;
GtkFilter *filter;
now = g_date_time_new_now_local ();
gtd_task_list_view_set_default_date (self->view, now);
gtk_filter_list_model_refilter (self->filter_model);
filter = gtk_filter_list_model_get_filter (self->filter_model);
gtk_filter_changed (filter, GTK_FILTER_CHANGE_DIFFERENT);
}
......@@ -419,6 +421,9 @@ gtd_panel_today_class_init (GtdPanelTodayClass *klass)
static void
gtd_panel_today_init (GtdPanelToday *self)
{
g_autoptr (GtkFilter) incomplete_filter = NULL;
g_autoptr (GtkFilter) filter = NULL;
g_autoptr (GtkSorter) sorter = NULL;
g_autoptr (GDateTime) now = NULL;
GtdManager *manager;
......@@ -426,9 +431,14 @@ gtd_panel_today_init (GtdPanelToday *self)
self->icon = g_themed_icon_new ("view-tasks-today-symbolic");
self->filter_model = gtk_filter_list_model_new (gtd_manager_get_tasks_model (manager), filter_func, self, NULL);
self->sort_model = gtk_sort_list_model_new (G_LIST_MODEL (self->filter_model), sort_func, self, NULL);
self->incomplete_model = gtk_filter_list_model_new (G_LIST_MODEL (self->sort_model), filter_complete_func, self, NULL);
filter = gtk_custom_filter_new (filter_func, self, NULL);
self->filter_model = gtk_filter_list_model_new (gtd_manager_get_tasks_model (manager), 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);
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);
/* Connect to GtdManager::list-* signals to update the title */
manager = gtd_manager_get_default ();
......
......@@ -170,10 +170,13 @@ static void
on_clock_day_changed_cb (GtdClock *clock,
GtdTodayOmniAreaAddin *self)
{
GtkFilter *filter;
self->had_tasks = FALSE;
self->finished_tasks = FALSE;
gtk_filter_list_model_refilter (self->filter_model);
filter = gtk_filter_list_model_get_filter (self->filter_model);
gtk_filter_changed (filter, GTK_FILTER_CHANGE_DIFFERENT);
}
static void
......@@ -276,12 +279,15 @@ gtd_today_omni_area_addin_class_init (GtdTodayOmniAreaAddinClass *klass)
static void
gtd_today_omni_area_addin_init (GtdTodayOmniAreaAddin *self)
{
g_autoptr (GtkFilter) filter = NULL;
GtdManager *manager;
manager = gtd_manager_get_default ();
self->icon = g_themed_icon_new ("view-tasks-today-symbolic");
self->filter_model = gtk_filter_list_model_new (gtd_manager_get_tasks_model (manager), filter_func, self, NULL);
filter = gtk_custom_filter_new (filter_func, self, NULL);
self->filter_model = gtk_filter_list_model_new (gtd_manager_get_tasks_model (manager), filter);
g_signal_connect_object (self->filter_model,
"items-changed",
......
......@@ -136,7 +136,10 @@ static void
on_clock_day_changed_cb (GtdClock *clock,
GtdWelcomeWorkspace *self)
{
gtk_filter_list_model_refilter (self->today_model);
GtkFilter *filter;
filter = gtk_filter_list_model_get_filter (self->today_model);
gtk_filter_changed (filter, GTK_FILTER_CHANGE_DIFFERENT);
}
static void
......@@ -302,6 +305,7 @@ gtd_welcome_workspace_class_init (GtdWelcomeWorkspaceClass *klass)
static void
gtd_welcome_workspace_init (GtdWelcomeWorkspace *self)
{
g_autoptr (GtkFilter) filter = NULL;
GtdManager *manager;
GListModel *inbox_model;
......@@ -331,7 +335,8 @@ gtd_welcome_workspace_init (GtdWelcomeWorkspace *self)
g_variant_new ("s", "inbox-panel"));
/* Today */
self->today_model = gtk_filter_list_model_new (gtd_manager_get_tasks_model (manager), filter_func, self, NULL);
filter = gtk_custom_filter_new (filter_func, self, NULL);
self->today_model = gtk_filter_list_model_new (gtd_manager_get_tasks_model (manager), filter);
g_signal_connect_object (self->today_model,
"items-changed",
......
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