/* ListView.c generated by valac 0.56.18-dirty, the Vala compiler
 * generated from ListView.vala, do not modify */

/*
 * Copyright 2019-2023 elementary, Inc. (https://elementary.io)
 * SPDX-License-Identifier: GPL-3.0-or-later
 */

#include <granite-7.h>
#include <glib-object.h>
#include <libedataserver/libedataserver.h>
#include <libecal/libecal.h>
#include <gtk/gtk.h>
#include <glib.h>
#include <stdlib.h>
#include <string.h>
#include <gee.h>
#include <gio/gio.h>
#include <libical-glib/libical-glib.h>
#include <glib/gi18n-lib.h>
#include <adwaita.h>

#define TASKS_MAIN_WINDOW_ACTION_DELETE_SELECTED_LIST "action-delete-selected-list"
#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif
#if !defined(VALA_EXTERN)
#if defined(_MSC_VER)
#define VALA_EXTERN __declspec(dllexport) extern
#elif __GNUC__ >= 4
#define VALA_EXTERN __attribute__((visibility("default"))) extern
#else
#define VALA_EXTERN extern
#endif
#endif

#define TASKS_TYPE_LIST_VIEW (tasks_list_view_get_type ())
#define TASKS_LIST_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TASKS_TYPE_LIST_VIEW, TasksListView))
#define TASKS_LIST_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TASKS_TYPE_LIST_VIEW, TasksListViewClass))
#define TASKS_IS_LIST_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TASKS_TYPE_LIST_VIEW))
#define TASKS_IS_LIST_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TASKS_TYPE_LIST_VIEW))
#define TASKS_LIST_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TASKS_TYPE_LIST_VIEW, TasksListViewClass))

typedef struct _TasksListView TasksListView;
typedef struct _TasksListViewClass TasksListViewClass;
typedef struct _TasksListViewPrivate TasksListViewPrivate;

#define TASKS_WIDGETS_TYPE_EDITABLE_LABEL (tasks_widgets_editable_label_get_type ())
#define TASKS_WIDGETS_EDITABLE_LABEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TASKS_WIDGETS_TYPE_EDITABLE_LABEL, TasksWidgetsEditableLabel))
#define TASKS_WIDGETS_EDITABLE_LABEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TASKS_WIDGETS_TYPE_EDITABLE_LABEL, TasksWidgetsEditableLabelClass))
#define TASKS_WIDGETS_IS_EDITABLE_LABEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TASKS_WIDGETS_TYPE_EDITABLE_LABEL))
#define TASKS_WIDGETS_IS_EDITABLE_LABEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TASKS_WIDGETS_TYPE_EDITABLE_LABEL))
#define TASKS_WIDGETS_EDITABLE_LABEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TASKS_WIDGETS_TYPE_EDITABLE_LABEL, TasksWidgetsEditableLabelClass))

typedef struct _TasksWidgetsEditableLabel TasksWidgetsEditableLabel;
typedef struct _TasksWidgetsEditableLabelClass TasksWidgetsEditableLabelClass;
enum  {
	TASKS_LIST_VIEW_0_PROPERTY,
	TASKS_LIST_VIEW_SOURCE_PROPERTY,
	TASKS_LIST_VIEW_NUM_PROPERTIES
};
static GParamSpec* tasks_list_view_properties[TASKS_LIST_VIEW_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#define TASKS_TYPE_TASK_MODEL (tasks_task_model_get_type ())
#define TASKS_TASK_MODEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TASKS_TYPE_TASK_MODEL, TasksTaskModel))
#define TASKS_TASK_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TASKS_TYPE_TASK_MODEL, TasksTaskModelClass))
#define TASKS_IS_TASK_MODEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TASKS_TYPE_TASK_MODEL))
#define TASKS_IS_TASK_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TASKS_TYPE_TASK_MODEL))
#define TASKS_TASK_MODEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TASKS_TYPE_TASK_MODEL, TasksTaskModelClass))

typedef struct _TasksTaskModel TasksTaskModel;
typedef struct _TasksTaskModelClass TasksTaskModelClass;
typedef void (*TasksTaskModelTasksAddedFunc) (GeeCollection* tasks, ESource* task_list, gpointer user_data);
typedef void (*TasksTaskModelTasksModifiedFunc) (GeeCollection* tasks, gpointer user_data);
typedef void (*TasksTaskModelTasksRemovedFunc) (GSList* cids, gpointer user_data);
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))

#define TASKS_WIDGETS_TYPE_TASK_ROW (tasks_widgets_task_row_get_type ())
#define TASKS_WIDGETS_TASK_ROW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TASKS_WIDGETS_TYPE_TASK_ROW, TasksWidgetsTaskRow))
#define TASKS_WIDGETS_TASK_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TASKS_WIDGETS_TYPE_TASK_ROW, TasksWidgetsTaskRowClass))
#define TASKS_WIDGETS_IS_TASK_ROW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TASKS_WIDGETS_TYPE_TASK_ROW))
#define TASKS_WIDGETS_IS_TASK_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TASKS_WIDGETS_TYPE_TASK_ROW))
#define TASKS_WIDGETS_TASK_ROW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TASKS_WIDGETS_TYPE_TASK_ROW, TasksWidgetsTaskRowClass))

typedef struct _TasksWidgetsTaskRow TasksWidgetsTaskRow;
typedef struct _TasksWidgetsTaskRowClass TasksWidgetsTaskRowClass;
#define _g_free0(var) (var = (g_free (var), NULL))
typedef struct _Block21Data Block21Data;
typedef struct _Block22Data Block22Data;
typedef struct _Block23Data Block23Data;
typedef struct _Block24Data Block24Data;

#define TASKS_WIDGETS_TYPE_LIST_SETTINGS_POPOVER (tasks_widgets_list_settings_popover_get_type ())
#define TASKS_WIDGETS_LIST_SETTINGS_POPOVER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TASKS_WIDGETS_TYPE_LIST_SETTINGS_POPOVER, TasksWidgetsListSettingsPopover))
#define TASKS_WIDGETS_LIST_SETTINGS_POPOVER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TASKS_WIDGETS_TYPE_LIST_SETTINGS_POPOVER, TasksWidgetsListSettingsPopoverClass))
#define TASKS_WIDGETS_IS_LIST_SETTINGS_POPOVER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TASKS_WIDGETS_TYPE_LIST_SETTINGS_POPOVER))
#define TASKS_WIDGETS_IS_LIST_SETTINGS_POPOVER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TASKS_WIDGETS_TYPE_LIST_SETTINGS_POPOVER))
#define TASKS_WIDGETS_LIST_SETTINGS_POPOVER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TASKS_WIDGETS_TYPE_LIST_SETTINGS_POPOVER, TasksWidgetsListSettingsPopoverClass))

typedef struct _TasksWidgetsListSettingsPopover TasksWidgetsListSettingsPopover;
typedef struct _TasksWidgetsListSettingsPopoverClass TasksWidgetsListSettingsPopoverClass;
typedef struct _Block25Data Block25Data;
typedef struct _Block26Data Block26Data;
typedef struct _Block27Data Block27Data;
typedef struct _Block28Data Block28Data;

struct _TasksListView {
	GraniteBin parent_instance;
	TasksListViewPrivate * priv;
};

struct _TasksListViewClass {
	GraniteBinClass parent_class;
};

struct _TasksListViewPrivate {
	ESource* _source;
	ECalClientView* view;
	TasksWidgetsEditableLabel* editable_title;
	GtkListBox* add_task_list;
	GtkListBox* task_list;
	gboolean is_gtasks;
};

struct _Block21Data {
	int _ref_count_;
	TasksListView* self;
	ESource* source;
};

struct _Block22Data {
	int _ref_count_;
	TasksListView* self;
	GAsyncResult* res;
};

struct _Block23Data {
	int _ref_count_;
	TasksListView* self;
	GAsyncResult* res;
};

struct _Block24Data {
	int _ref_count_;
	TasksListView* self;
	GAsyncResult* res;
};

struct _Block25Data {
	int _ref_count_;
	TasksListView* self;
	TasksWidgetsListSettingsPopover* list_settings_popover;
	GtkMenuButton* settings_button;
};

struct _Block26Data {
	int _ref_count_;
	TasksListView* self;
	GAsyncResult* res;
};

struct _Block27Data {
	int _ref_count_;
	Block25Data * _data25_;
	GtkApplicationWindow* main_window;
};

struct _Block28Data {
	int _ref_count_;
	TasksListView* self;
	GraniteMessageDialog* error_dialog;
};

static gint TasksListView_private_offset;
static gpointer tasks_list_view_parent_class = NULL;
VALA_EXTERN TasksTaskModel* tasks_application_model;
VALA_EXTERN GSettings* tasks_application_settings;

VALA_EXTERN GType tasks_list_view_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TasksListView, g_object_unref)
VALA_EXTERN GType tasks_widgets_editable_label_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TasksWidgetsEditableLabel, g_object_unref)
VALA_EXTERN TasksListView* tasks_list_view_new (ESource* source);
VALA_EXTERN TasksListView* tasks_list_view_construct (GType object_type,
                                          ESource* source);
static void tasks_list_view_on_show_completed_changed (TasksListView* self,
                                                gboolean show_completed);
static void tasks_list_view_set_view_for_query (TasksListView* self,
                                         const gchar* query);
VALA_EXTERN GType tasks_task_model_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TasksTaskModel, g_object_unref)
VALA_EXTERN void tasks_task_model_destroy_task_list_view (TasksTaskModel* self,
                                              ECalClientView* view);
VALA_EXTERN ECalClientView* tasks_task_model_create_task_list_view (TasksTaskModel* self,
                                                        ESource* task_list,
                                                        const gchar* query,
                                                        TasksTaskModelTasksAddedFunc on_tasks_added,
                                                        gpointer on_tasks_added_target,
                                                        TasksTaskModelTasksModifiedFunc on_tasks_modified,
                                                        gpointer on_tasks_modified_target,
                                                        TasksTaskModelTasksRemovedFunc on_tasks_removed,
                                                        gpointer on_tasks_removed_target,
                                                        GError** error);
VALA_EXTERN ESource* tasks_list_view_get_source (TasksListView* self);
static void tasks_list_view_on_tasks_added (TasksListView* self,
                                     GeeCollection* tasks,
                                     ESource* source);
static void _tasks_list_view_on_tasks_added_tasks_task_model_tasks_added_func (GeeCollection* tasks,
                                                                        ESource* task_list,
                                                                        gpointer self);
static void tasks_list_view_on_tasks_modified (TasksListView* self,
                                        GeeCollection* tasks);
static void _tasks_list_view_on_tasks_modified_tasks_task_model_tasks_modified_func (GeeCollection* tasks,
                                                                              gpointer self);
static void tasks_list_view_on_tasks_removed (TasksListView* self,
                                       GSList* cids);
static void _tasks_list_view_on_tasks_removed_tasks_task_model_tasks_removed_func (GSList* cids,
                                                                            gpointer self);
static void tasks_list_view_on_row_activated (TasksListView* self,
                                       GtkListBoxRow* row);
VALA_EXTERN GType tasks_widgets_task_row_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TasksWidgetsTaskRow, g_object_unref)
VALA_EXTERN void tasks_widgets_task_row_reveal_child_request (TasksWidgetsTaskRow* self,
                                                  gboolean value);
static void tasks_list_view_on_row_unselect (TasksListView* self,
                                      GtkListBoxRow* row);
VALA_EXTERN void tasks_list_view_update_request (TasksListView* self);
VALA_EXTERN void tasks_widgets_editable_label_set_text (TasksWidgetsEditableLabel* self,
                                            const gchar* value);
VALA_EXTERN void tasks_application_set_task_color (ESource* source,
                                       GtkWidget* widget);
VALA_EXTERN void tasks_widgets_task_row_update_request (TasksWidgetsTaskRow* self);
static gint tasks_list_view_sort_function (GtkListBoxRow* row1,
                                    GtkListBoxRow* row2,
                                    TasksListView* self);
VALA_EXTERN gboolean tasks_widgets_task_row_get_completed (TasksWidgetsTaskRow* self);
VALA_EXTERN gchar* tasks_util_get_gtasks_position_property_value (ECalComponent* ecalcomponent);
VALA_EXTERN ECalComponent* tasks_widgets_task_row_get_task (TasksWidgetsTaskRow* self);
VALA_EXTERN gchar* tasks_util_get_apple_sortorder_property_value (ECalComponent* ecalcomponent);
VALA_EXTERN ICalDuration* tasks_util_get_apple_sortorder_default_value (ECalComponent* ecalcomponent);
static Block21Data* block21_data_ref (Block21Data* _data21_);
static void block21_data_unref (void * _userdata_);
static gboolean __lambda37_ (Block21Data* _data21_,
                      ECalComponent* task);
VALA_EXTERN TasksWidgetsTaskRow* tasks_widgets_task_row_new_for_component (ECalComponent* task,
                                                               ESource* source,
                                                               gboolean is_scheduled_view);
VALA_EXTERN TasksWidgetsTaskRow* tasks_widgets_task_row_construct_for_component (GType object_type,
                                                                     ECalComponent* task,
                                                                     ESource* source,
                                                                     gboolean is_scheduled_view);
static void _tasks_list_view_on_row_unselect_tasks_widgets_task_row_unselect (TasksWidgetsTaskRow* _sender,
                                                                       GtkListBoxRow* row,
                                                                       gpointer self);
static void __lambda65_ (Block21Data* _data21_,
                  ECalComponent* task);
VALA_EXTERN void tasks_task_model_complete_task (TasksTaskModel* self,
                                     ESource* list,
                                     ECalComponent* task,
                                     GAsyncReadyCallback _callback_,
                                     gpointer _user_data_);
VALA_EXTERN void tasks_task_model_complete_task_finish (TasksTaskModel* self,
                                            GAsyncResult* _res_,
                                            GError** error);
static void __lambda66_ (TasksListView* self,
                  GObject* obj,
                  GAsyncResult* res);
static Block22Data* block22_data_ref (Block22Data* _data22_);
static void block22_data_unref (void * _userdata_);
static gboolean __lambda67_ (Block22Data* _data22_);
static void _gtk_window_destroy_gtk_dialog_response (GtkDialog* _sender,
                                              gint response_id,
                                              gpointer self);
static gboolean ___lambda67__gsource_func (gpointer self);
static void ___lambda66__gasync_ready_callback (GObject* source_object,
                                         GAsyncResult* res,
                                         gpointer self);
static void ___lambda65__tasks_widgets_task_row_task_completed (TasksWidgetsTaskRow* _sender,
                                                         ECalComponent* task,
                                                         gpointer self);
static void __lambda68_ (Block21Data* _data21_,
                  ECalComponent* task);
VALA_EXTERN void tasks_task_model_update_task (TasksTaskModel* self,
                                   ESource* list,
                                   ECalComponent* task,
                                   ECalObjModType mod_type,
                                   GAsyncReadyCallback _callback_,
                                   gpointer _user_data_);
VALA_EXTERN void tasks_task_model_update_task_finish (TasksTaskModel* self,
                                          GAsyncResult* _res_,
                                          GError** error);
static void __lambda69_ (TasksListView* self,
                  GObject* obj,
                  GAsyncResult* res);
static Block23Data* block23_data_ref (Block23Data* _data23_);
static void block23_data_unref (void * _userdata_);
static gboolean __lambda70_ (Block23Data* _data23_);
static gboolean ___lambda70__gsource_func (gpointer self);
static void ___lambda69__gasync_ready_callback (GObject* source_object,
                                         GAsyncResult* res,
                                         gpointer self);
static void ___lambda68__tasks_widgets_task_row_task_changed (TasksWidgetsTaskRow* _sender,
                                                       ECalComponent* task,
                                                       gpointer self);
static void __lambda71_ (Block21Data* _data21_,
                  ECalComponent* task);
VALA_EXTERN void tasks_task_model_remove_task (TasksTaskModel* self,
                                   ESource* list,
                                   ECalComponent* task,
                                   ECalObjModType mod_type,
                                   GAsyncReadyCallback _callback_,
                                   gpointer _user_data_);
VALA_EXTERN void tasks_task_model_remove_task_finish (TasksTaskModel* self,
                                          GAsyncResult* _res_,
                                          GError** error);
static void __lambda72_ (TasksListView* self,
                  GObject* obj,
                  GAsyncResult* res);
static Block24Data* block24_data_ref (Block24Data* _data24_);
static void block24_data_unref (void * _userdata_);
static gboolean __lambda73_ (Block24Data* _data24_);
static gboolean ___lambda73__gsource_func (gpointer self);
static void ___lambda72__gasync_ready_callback (GObject* source_object,
                                         GAsyncResult* res,
                                         gpointer self);
static void ___lambda71__tasks_widgets_task_row_task_removed (TasksWidgetsTaskRow* _sender,
                                                       ECalComponent* task,
                                                       gpointer self);
static gboolean ___lambda37__gee_forall_func (gpointer g,
                                       gpointer self);
static gboolean __lambda74_ (TasksListView* self);
static gboolean ___lambda74__gsource_func (gpointer self);
VALA_EXTERN gboolean tasks_util_calcomponent_equal_func (ECalComponent* a,
                                             ECalComponent* b);
VALA_EXTERN void tasks_widgets_task_row_set_task (TasksWidgetsTaskRow* self,
                                      ECalComponent* value);
static gboolean __lambda75_ (TasksListView* self);
static gboolean ___lambda75__gsource_func (gpointer self);
static gboolean __lambda76_ (TasksListView* self);
static gboolean ___lambda76__gsource_func (gpointer self);
static void tasks_list_view_set_source (TasksListView* self,
                                 ESource* value);
static GObject * tasks_list_view_constructor (GType type,
                                       guint n_construct_properties,
                                       GObjectConstructParam * construct_properties);
VALA_EXTERN GType tasks_widgets_list_settings_popover_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TasksWidgetsListSettingsPopover, g_object_unref)
static Block25Data* block25_data_ref (Block25Data* _data25_);
static void block25_data_unref (void * _userdata_);
VALA_EXTERN ESourceRegistry* tasks_task_model_get_registry_sync (TasksTaskModel* self,
                                                     GError** error);
VALA_EXTERN gchar* tasks_task_model_get_collection_backend_name (TasksTaskModel* self,
                                                     ESource* source,
                                                     ESourceRegistry* registry);
VALA_EXTERN TasksWidgetsEditableLabel* tasks_widgets_editable_label_new (void);
VALA_EXTERN TasksWidgetsEditableLabel* tasks_widgets_editable_label_construct (GType object_type);
VALA_EXTERN TasksWidgetsListSettingsPopover* tasks_widgets_list_settings_popover_new (ESource* source);
VALA_EXTERN TasksWidgetsListSettingsPopover* tasks_widgets_list_settings_popover_construct (GType object_type,
                                                                                ESource* source);
VALA_EXTERN TasksWidgetsTaskRow* tasks_widgets_task_row_new_for_source (ESource* source);
VALA_EXTERN TasksWidgetsTaskRow* tasks_widgets_task_row_construct_for_source (GType object_type,
                                                                  ESource* source);
static void _tasks_list_view___lambda90_ (TasksListView* self,
                                   ECalComponent* task);
VALA_EXTERN void tasks_task_model_add_task (TasksTaskModel* self,
                                ESource* list,
                                ECalComponent* task,
                                GAsyncReadyCallback _callback_,
                                gpointer _user_data_);
VALA_EXTERN void tasks_task_model_add_task_finish (TasksTaskModel* self,
                                       GAsyncResult* _res_,
                                       GError** error);
static void __lambda91_ (TasksListView* self,
                  GObject* obj,
                  GAsyncResult* res);
static Block26Data* block26_data_ref (Block26Data* _data26_);
static void block26_data_unref (void * _userdata_);
static gboolean __lambda92_ (Block26Data* _data26_);
static gboolean ___lambda92__gsource_func (gpointer self);
static void ___lambda91__gasync_ready_callback (GObject* source_object,
                                         GAsyncResult* res,
                                         gpointer self);
static void __tasks_list_view___lambda90__tasks_widgets_task_row_task_changed (TasksWidgetsTaskRow* _sender,
                                                                        ECalComponent* task,
                                                                        gpointer self);
static gint _tasks_list_view_sort_function_gtk_list_box_sort_func (GtkListBoxRow* row1,
                                                            GtkListBoxRow* row2,
                                                            gpointer self);
static void _tasks_list_view___lambda93_ (TasksListView* self);
static void __tasks_list_view___lambda93__g_settings_changed (GSettings* _sender,
                                                       const gchar* key,
                                                       gpointer self);
static void _tasks_list_view___lambda94_ (Block25Data* _data25_);
static Block27Data* block27_data_ref (Block27Data* _data27_);
static void block27_data_unref (void * _userdata_);
VALA_EXTERN void tasks_widgets_list_settings_popover_set_source (TasksWidgetsListSettingsPopover* self,
                                                     ESource* value);
static gboolean ___lambda95_ (Block27Data* _data27_);
static gboolean ____lambda95__gsource_func (gpointer self);
static void __tasks_list_view___lambda94__gtk_menu_button_activate (GtkMenuButton* _sender,
                                                             gpointer self);
static void _tasks_list_view_on_row_activated_gtk_list_box_row_activated (GtkListBox* _sender,
                                                                   GtkListBoxRow* row,
                                                                   gpointer self);
static void _tasks_list_view___lambda96_ (TasksListView* self);
VALA_EXTERN gboolean tasks_widgets_editable_label_get_editing (TasksWidgetsEditableLabel* self);
static void __tasks_list_view___lambda96__g_object_notify (GObject* _sender,
                                                    GParamSpec* pspec,
                                                    gpointer self);
static void _tasks_list_view___lambda97_ (TasksListView* self);
VALA_EXTERN void tasks_task_model_update_task_list_display_name (TasksTaskModel* self,
                                                     ESource* task_list,
                                                     const gchar* display_name,
                                                     GAsyncReadyCallback _callback_,
                                                     gpointer _user_data_);
VALA_EXTERN void tasks_task_model_update_task_list_display_name_finish (TasksTaskModel* self,
                                                            GAsyncResult* _res_,
                                                            GError** error);
VALA_EXTERN const gchar* tasks_widgets_editable_label_get_text (TasksWidgetsEditableLabel* self);
static void __lambda98_ (TasksListView* self,
                  GObject* obj,
                  GAsyncResult* res);
static Block28Data* block28_data_ref (Block28Data* _data28_);
static void block28_data_unref (void * _userdata_);
static void ___lambda99_ (Block28Data* _data28_);
static void ____lambda99__gtk_dialog_response (GtkDialog* _sender,
                                        gint response_id,
                                        gpointer self);
static void ___lambda98__gasync_ready_callback (GObject* source_object,
                                         GAsyncResult* res,
                                         gpointer self);
static void __tasks_list_view___lambda97__tasks_widgets_editable_label_changed (TasksWidgetsEditableLabel* _sender,
                                                                         gpointer self);
static void tasks_list_view_finalize (GObject * obj);
static GType tasks_list_view_get_type_once (void);
static void _vala_tasks_list_view_get_property (GObject * object,
                                         guint property_id,
                                         GValue * value,
                                         GParamSpec * pspec);
static void _vala_tasks_list_view_set_property (GObject * object,
                                         guint property_id,
                                         const GValue * value,
                                         GParamSpec * pspec);

static inline gpointer
tasks_list_view_get_instance_private (TasksListView* self)
{
	return G_STRUCT_MEMBER_P (self, TasksListView_private_offset);
}

TasksListView*
tasks_list_view_construct (GType object_type,
                           ESource* source)
{
	TasksListView * self = NULL;
	g_return_val_if_fail (source != NULL, NULL);
	self = (TasksListView*) g_object_new (object_type, "source", source, NULL);
	return self;
}

TasksListView*
tasks_list_view_new (ESource* source)
{
	return tasks_list_view_construct (TASKS_TYPE_LIST_VIEW, source);
}

static void
tasks_list_view_on_show_completed_changed (TasksListView* self,
                                           gboolean show_completed)
{
	g_return_if_fail (self != NULL);
	if (show_completed) {
		tasks_list_view_set_view_for_query (self, "(contains? 'any' '')");
	} else {
		tasks_list_view_set_view_for_query (self, "NOT is-completed?");
	}
}

static void
_tasks_list_view_on_tasks_added_tasks_task_model_tasks_added_func (GeeCollection* tasks,
                                                                   ESource* task_list,
                                                                   gpointer self)
{
	tasks_list_view_on_tasks_added ((TasksListView*) self, tasks, task_list);
}

static void
_tasks_list_view_on_tasks_modified_tasks_task_model_tasks_modified_func (GeeCollection* tasks,
                                                                         gpointer self)
{
	tasks_list_view_on_tasks_modified ((TasksListView*) self, tasks);
}

static void
_tasks_list_view_on_tasks_removed_tasks_task_model_tasks_removed_func (GSList* cids,
                                                                       gpointer self)
{
	tasks_list_view_on_tasks_removed ((TasksListView*) self, cids);
}

static void
tasks_list_view_set_view_for_query (TasksListView* self,
                                    const gchar* query)
{
	GtkListBox* _tmp0_;
	ECalClientView* _tmp1_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (query != NULL);
	_tmp0_ = self->priv->task_list;
	gtk_list_box_remove_all (_tmp0_);
	_tmp1_ = self->priv->view;
	if (_tmp1_ != NULL) {
		TasksTaskModel* _tmp2_;
		ECalClientView* _tmp3_;
		_tmp2_ = tasks_application_model;
		_tmp3_ = self->priv->view;
		tasks_task_model_destroy_task_list_view (_tmp2_, _tmp3_);
	}
	{
		ECalClientView* _tmp4_ = NULL;
		TasksTaskModel* _tmp5_;
		ESource* _tmp6_;
		ECalClientView* _tmp7_;
		ECalClientView* _tmp8_;
		_tmp5_ = tasks_application_model;
		_tmp6_ = self->priv->_source;
		_tmp7_ = tasks_task_model_create_task_list_view (_tmp5_, _tmp6_, query, _tasks_list_view_on_tasks_added_tasks_task_model_tasks_added_func, self, _tasks_list_view_on_tasks_modified_tasks_task_model_tasks_modified_func, self, _tasks_list_view_on_tasks_removed_tasks_task_model_tasks_removed_func, self, &_inner_error0_);
		_tmp4_ = _tmp7_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_tmp8_ = _tmp4_;
		_tmp4_ = NULL;
		_g_object_unref0 (self->priv->view);
		self->priv->view = _tmp8_;
		_g_object_unref0 (_tmp4_);
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		ESource* _tmp9_;
		const gchar* _tmp10_;
		const gchar* _tmp11_;
		GError* _tmp12_;
		const gchar* _tmp13_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp9_ = self->priv->_source;
		_tmp10_ = e_source_get_display_name (_tmp9_);
		_tmp11_ = _tmp10_;
		_tmp12_ = e;
		_tmp13_ = _tmp12_->message;
		g_critical ("ListView.vala:198: Error creating view with query for source %s[%s]: %" \
"s", _tmp11_, query, _tmp13_);
		_g_error_free0 (e);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
}

static gpointer
_g_object_ref0 (gpointer self)
{
	return self ? g_object_ref (self) : NULL;
}

static void
tasks_list_view_on_row_activated (TasksListView* self,
                                  GtkListBoxRow* row)
{
	TasksWidgetsTaskRow* task_row = NULL;
	TasksWidgetsTaskRow* _tmp0_;
	GtkApplicationWindow* main_window = NULL;
	GApplication* _tmp1_;
	GtkWindow* _tmp2_;
	GtkWindow* _tmp3_;
	GAction* _tmp4_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (row != NULL);
	_tmp0_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (row, TASKS_WIDGETS_TYPE_TASK_ROW, TasksWidgetsTaskRow));
	task_row = _tmp0_;
	tasks_widgets_task_row_reveal_child_request (task_row, TRUE);
	_tmp1_ = g_application_get_default ();
	_tmp2_ = gtk_application_get_active_window (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, gtk_application_get_type (), GtkApplication));
	_tmp3_ = _tmp2_;
	main_window = G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, gtk_application_window_get_type (), GtkApplicationWindow);
	_tmp4_ = g_action_map_lookup_action ((GActionMap*) main_window, TASKS_MAIN_WINDOW_ACTION_DELETE_SELECTED_LIST);
	g_simple_action_set_enabled (G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, g_simple_action_get_type (), GSimpleAction), FALSE);
	_g_object_unref0 (task_row);
}

static void
tasks_list_view_on_row_unselect (TasksListView* self,
                                 GtkListBoxRow* row)
{
	GtkWidget* _tmp0_;
	GtkWidget* _tmp1_;
	gboolean _tmp4_ = FALSE;
	GtkListBox* _tmp5_;
	GList* _tmp6_;
	GList* _tmp7_;
	gboolean _tmp8_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (row != NULL);
	_tmp0_ = gtk_widget_get_parent ((GtkWidget*) row);
	_tmp1_ = _tmp0_;
	if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp1_, gtk_list_box_get_type ())) {
		GtkWidget* _tmp2_;
		GtkWidget* _tmp3_;
		_tmp2_ = gtk_widget_get_parent ((GtkWidget*) row);
		_tmp3_ = _tmp2_;
		gtk_list_box_unselect_row (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, gtk_list_box_get_type (), GtkListBox), row);
	}
	_tmp5_ = self->priv->add_task_list;
	_tmp6_ = gtk_list_box_get_selected_rows (_tmp5_);
	_tmp7_ = _tmp6_;
	_tmp8_ = g_list_length (_tmp7_) == ((guint) 0);
	(_tmp7_ == NULL) ? NULL : (_tmp7_ = (g_list_free (_tmp7_), NULL));
	if (_tmp8_) {
		GtkListBox* _tmp9_;
		GList* _tmp10_;
		GList* _tmp11_;
		_tmp9_ = self->priv->task_list;
		_tmp10_ = gtk_list_box_get_selected_rows (_tmp9_);
		_tmp11_ = _tmp10_;
		_tmp4_ = g_list_length (_tmp11_) == ((guint) 0);
		(_tmp11_ == NULL) ? NULL : (_tmp11_ = (g_list_free (_tmp11_), NULL));
	} else {
		_tmp4_ = FALSE;
	}
	if (_tmp4_) {
		GtkApplicationWindow* main_window = NULL;
		GApplication* _tmp12_;
		GtkWindow* _tmp13_;
		GtkWindow* _tmp14_;
		GtkApplicationWindow* _tmp15_;
		GAction* _tmp16_;
		_tmp12_ = g_application_get_default ();
		_tmp13_ = gtk_application_get_active_window (G_TYPE_CHECK_INSTANCE_CAST (_tmp12_, gtk_application_get_type (), GtkApplication));
		_tmp14_ = _tmp13_;
		main_window = G_TYPE_CHECK_INSTANCE_CAST (_tmp14_, gtk_application_window_get_type (), GtkApplicationWindow);
		_tmp15_ = main_window;
		_tmp16_ = g_action_map_lookup_action ((GActionMap*) _tmp15_, TASKS_MAIN_WINDOW_ACTION_DELETE_SELECTED_LIST);
		g_simple_action_set_enabled (G_TYPE_CHECK_INSTANCE_CAST (_tmp16_, g_simple_action_get_type (), GSimpleAction), TRUE);
	}
}

void
tasks_list_view_update_request (TasksListView* self)
{
	TasksWidgetsEditableLabel* _tmp0_;
	ESource* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	ESource* _tmp4_;
	TasksWidgetsEditableLabel* _tmp5_;
	GtkWidget* child = NULL;
	GtkListBox* _tmp6_;
	GtkWidget* _tmp7_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->editable_title;
	_tmp1_ = self->priv->_source;
	_tmp2_ = e_source_dup_display_name (_tmp1_);
	_tmp3_ = _tmp2_;
	tasks_widgets_editable_label_set_text (_tmp0_, _tmp3_);
	_g_free0 (_tmp3_);
	_tmp4_ = self->priv->_source;
	_tmp5_ = self->priv->editable_title;
	tasks_application_set_task_color (_tmp4_, (GtkWidget*) _tmp5_);
	_tmp6_ = self->priv->task_list;
	_tmp7_ = gtk_widget_get_first_child ((GtkWidget*) _tmp6_);
	child = _tmp7_;
	while (TRUE) {
		GtkWidget* _tmp8_;
		GtkWidget* _tmp9_;
		GtkWidget* _tmp12_;
		GtkWidget* _tmp13_;
		_tmp8_ = child;
		if (!(_tmp8_ != NULL)) {
			break;
		}
		_tmp9_ = child;
		if (TASKS_WIDGETS_IS_TASK_ROW (_tmp9_)) {
			TasksWidgetsTaskRow* task_row = NULL;
			GtkWidget* _tmp10_;
			TasksWidgetsTaskRow* _tmp11_;
			_tmp10_ = child;
			task_row = TASKS_WIDGETS_IS_TASK_ROW (_tmp10_) ? ((TasksWidgetsTaskRow*) _tmp10_) : NULL;
			_tmp11_ = task_row;
			tasks_widgets_task_row_update_request (_tmp11_);
		}
		_tmp12_ = child;
		_tmp13_ = gtk_widget_get_next_sibling (_tmp12_);
		child = _tmp13_;
	}
}

static gint
tasks_list_view_sort_function (GtkListBoxRow* row1,
                               GtkListBoxRow* row2,
                               TasksListView* self)
{
	TasksWidgetsTaskRow* row_a = NULL;
	TasksWidgetsTaskRow* _tmp0_;
	TasksWidgetsTaskRow* row_b = NULL;
	TasksWidgetsTaskRow* _tmp1_;
	TasksWidgetsTaskRow* _tmp2_;
	gboolean _tmp3_;
	gboolean _tmp4_;
	TasksWidgetsTaskRow* _tmp5_;
	gboolean _tmp6_;
	gboolean _tmp7_;
	gint result;
	g_return_val_if_fail (self != NULL, 0);
	g_return_val_if_fail (row1 != NULL, 0);
	g_return_val_if_fail (row2 != NULL, 0);
	_tmp0_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (row1, TASKS_WIDGETS_TYPE_TASK_ROW, TasksWidgetsTaskRow));
	row_a = _tmp0_;
	_tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (row2, TASKS_WIDGETS_TYPE_TASK_ROW, TasksWidgetsTaskRow));
	row_b = _tmp1_;
	_tmp2_ = row_a;
	_tmp3_ = tasks_widgets_task_row_get_completed (_tmp2_);
	_tmp4_ = _tmp3_;
	_tmp5_ = row_b;
	_tmp6_ = tasks_widgets_task_row_get_completed (_tmp5_);
	_tmp7_ = _tmp6_;
	if (_tmp4_ == _tmp7_) {
		if (self->priv->is_gtasks) {
			gchar* gtask_position_a = NULL;
			TasksWidgetsTaskRow* _tmp8_;
			ECalComponent* _tmp9_;
			ECalComponent* _tmp10_;
			gchar* _tmp11_;
			gchar* gtask_position_b = NULL;
			TasksWidgetsTaskRow* _tmp12_;
			ECalComponent* _tmp13_;
			ECalComponent* _tmp14_;
			gchar* _tmp15_;
			const gchar* _tmp16_;
			const gchar* _tmp17_;
			const gchar* _tmp29_;
			const gchar* _tmp30_;
			_tmp8_ = row_a;
			_tmp9_ = tasks_widgets_task_row_get_task (_tmp8_);
			_tmp10_ = _tmp9_;
			_tmp11_ = tasks_util_get_gtasks_position_property_value (_tmp10_);
			gtask_position_a = _tmp11_;
			_tmp12_ = row_b;
			_tmp13_ = tasks_widgets_task_row_get_task (_tmp12_);
			_tmp14_ = _tmp13_;
			_tmp15_ = tasks_util_get_gtasks_position_property_value (_tmp14_);
			gtask_position_b = _tmp15_;
			_tmp16_ = gtask_position_a;
			_tmp17_ = gtask_position_b;
			if (g_strcmp0 (_tmp16_, _tmp17_) == 0) {
				TasksWidgetsTaskRow* _tmp18_;
				ECalComponent* _tmp19_;
				ECalComponent* _tmp20_;
				ICalTime* _tmp21_;
				ICalTime* _tmp22_;
				TasksWidgetsTaskRow* _tmp23_;
				ECalComponent* _tmp24_;
				ECalComponent* _tmp25_;
				ICalTime* _tmp26_;
				ICalTime* _tmp27_;
				gint _tmp28_;
				_tmp18_ = row_b;
				_tmp19_ = tasks_widgets_task_row_get_task (_tmp18_);
				_tmp20_ = _tmp19_;
				_tmp21_ = e_cal_component_get_last_modified (_tmp20_);
				_tmp22_ = _tmp21_;
				_tmp23_ = row_a;
				_tmp24_ = tasks_widgets_task_row_get_task (_tmp23_);
				_tmp25_ = _tmp24_;
				_tmp26_ = e_cal_component_get_last_modified (_tmp25_);
				_tmp27_ = _tmp26_;
				_tmp28_ = i_cal_time_compare (_tmp22_, _tmp27_);
				_g_object_unref0 (_tmp27_);
				_g_object_unref0 (_tmp22_);
				result = _tmp28_;
				_g_free0 (gtask_position_b);
				_g_free0 (gtask_position_a);
				_g_object_unref0 (row_b);
				_g_object_unref0 (row_a);
				return result;
			}
			_tmp29_ = gtask_position_a;
			_tmp30_ = gtask_position_b;
			result = g_utf8_collate (_tmp29_, _tmp30_);
			_g_free0 (gtask_position_b);
			_g_free0 (gtask_position_a);
			_g_object_unref0 (row_b);
			_g_object_unref0 (row_a);
			return result;
		} else {
			gchar* apple_sortorder_a = NULL;
			TasksWidgetsTaskRow* _tmp31_;
			ECalComponent* _tmp32_;
			ECalComponent* _tmp33_;
			gchar* _tmp34_;
			const gchar* _tmp35_;
			gchar* apple_sortorder_b = NULL;
			TasksWidgetsTaskRow* _tmp42_;
			ECalComponent* _tmp43_;
			ECalComponent* _tmp44_;
			gchar* _tmp45_;
			const gchar* _tmp46_;
			const gchar* _tmp53_;
			const gchar* _tmp54_;
			_tmp31_ = row_a;
			_tmp32_ = tasks_widgets_task_row_get_task (_tmp31_);
			_tmp33_ = _tmp32_;
			_tmp34_ = tasks_util_get_apple_sortorder_property_value (_tmp33_);
			apple_sortorder_a = _tmp34_;
			_tmp35_ = apple_sortorder_a;
			if (_tmp35_ == NULL) {
				TasksWidgetsTaskRow* _tmp36_;
				ECalComponent* _tmp37_;
				ECalComponent* _tmp38_;
				ICalDuration* _tmp39_;
				ICalDuration* _tmp40_;
				gchar* _tmp41_;
				_tmp36_ = row_a;
				_tmp37_ = tasks_widgets_task_row_get_task (_tmp36_);
				_tmp38_ = _tmp37_;
				_tmp39_ = tasks_util_get_apple_sortorder_default_value (_tmp38_);
				_tmp40_ = _tmp39_;
				_tmp41_ = g_strdup_printf ("%i", i_cal_duration_as_int (_tmp40_));
				_g_free0 (apple_sortorder_a);
				apple_sortorder_a = _tmp41_;
				_g_object_unref0 (_tmp40_);
			}
			_tmp42_ = row_b;
			_tmp43_ = tasks_widgets_task_row_get_task (_tmp42_);
			_tmp44_ = _tmp43_;
			_tmp45_ = tasks_util_get_apple_sortorder_property_value (_tmp44_);
			apple_sortorder_b = _tmp45_;
			_tmp46_ = apple_sortorder_b;
			if (_tmp46_ == NULL) {
				TasksWidgetsTaskRow* _tmp47_;
				ECalComponent* _tmp48_;
				ECalComponent* _tmp49_;
				ICalDuration* _tmp50_;
				ICalDuration* _tmp51_;
				gchar* _tmp52_;
				_tmp47_ = row_b;
				_tmp48_ = tasks_widgets_task_row_get_task (_tmp47_);
				_tmp49_ = _tmp48_;
				_tmp50_ = tasks_util_get_apple_sortorder_default_value (_tmp49_);
				_tmp51_ = _tmp50_;
				_tmp52_ = g_strdup_printf ("%i", i_cal_duration_as_int (_tmp51_));
				_g_free0 (apple_sortorder_b);
				apple_sortorder_b = _tmp52_;
				_g_object_unref0 (_tmp51_);
			}
			_tmp53_ = apple_sortorder_a;
			_tmp54_ = apple_sortorder_b;
			result = g_utf8_collate (_tmp53_, _tmp54_);
			_g_free0 (apple_sortorder_b);
			_g_free0 (apple_sortorder_a);
			_g_object_unref0 (row_b);
			_g_object_unref0 (row_a);
			return result;
		}
	} else {
		gboolean _tmp55_ = FALSE;
		TasksWidgetsTaskRow* _tmp56_;
		gboolean _tmp57_;
		gboolean _tmp58_;
		_tmp56_ = row_a;
		_tmp57_ = tasks_widgets_task_row_get_completed (_tmp56_);
		_tmp58_ = _tmp57_;
		if (_tmp58_) {
			TasksWidgetsTaskRow* _tmp59_;
			gboolean _tmp60_;
			gboolean _tmp61_;
			_tmp59_ = row_b;
			_tmp60_ = tasks_widgets_task_row_get_completed (_tmp59_);
			_tmp61_ = _tmp60_;
			_tmp55_ = !_tmp61_;
		} else {
			_tmp55_ = FALSE;
		}
		if (_tmp55_) {
			result = 1;
			_g_object_unref0 (row_b);
			_g_object_unref0 (row_a);
			return result;
		} else {
			gboolean _tmp62_ = FALSE;
			TasksWidgetsTaskRow* _tmp63_;
			gboolean _tmp64_;
			gboolean _tmp65_;
			_tmp63_ = row_b;
			_tmp64_ = tasks_widgets_task_row_get_completed (_tmp63_);
			_tmp65_ = _tmp64_;
			if (_tmp65_) {
				TasksWidgetsTaskRow* _tmp66_;
				gboolean _tmp67_;
				gboolean _tmp68_;
				_tmp66_ = row_a;
				_tmp67_ = tasks_widgets_task_row_get_completed (_tmp66_);
				_tmp68_ = _tmp67_;
				_tmp62_ = !_tmp68_;
			} else {
				_tmp62_ = FALSE;
			}
			if (_tmp62_) {
				result = -1;
				_g_object_unref0 (row_b);
				_g_object_unref0 (row_a);
				return result;
			}
		}
	}
	result = 0;
	_g_object_unref0 (row_b);
	_g_object_unref0 (row_a);
	return result;
}

static Block21Data*
block21_data_ref (Block21Data* _data21_)
{
	g_atomic_int_inc (&_data21_->_ref_count_);
	return _data21_;
}

static void
block21_data_unref (void * _userdata_)
{
	Block21Data* _data21_;
	_data21_ = (Block21Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data21_->_ref_count_)) {
		TasksListView* self;
		self = _data21_->self;
		_g_object_unref0 (_data21_->source);
		_g_object_unref0 (self);
		g_slice_free (Block21Data, _data21_);
	}
}

static void
_tasks_list_view_on_row_unselect_tasks_widgets_task_row_unselect (TasksWidgetsTaskRow* _sender,
                                                                  GtkListBoxRow* row,
                                                                  gpointer self)
{
	tasks_list_view_on_row_unselect ((TasksListView*) self, row);
}

static Block22Data*
block22_data_ref (Block22Data* _data22_)
{
	g_atomic_int_inc (&_data22_->_ref_count_);
	return _data22_;
}

static void
block22_data_unref (void * _userdata_)
{
	Block22Data* _data22_;
	_data22_ = (Block22Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data22_->_ref_count_)) {
		TasksListView* self;
		self = _data22_->self;
		_g_object_unref0 (_data22_->res);
		_g_object_unref0 (self);
		g_slice_free (Block22Data, _data22_);
	}
}

static void
_gtk_window_destroy_gtk_dialog_response (GtkDialog* _sender,
                                         gint response_id,
                                         gpointer self)
{
	gtk_window_destroy ((GtkWindow*) self);
}

static gboolean
__lambda67_ (Block22Data* _data22_)
{
	TasksListView* self;
	GError* _inner_error0_ = NULL;
	gboolean result;
	self = _data22_->self;
	{
		TasksTaskModel* _tmp0_;
		_tmp0_ = tasks_application_model;
		tasks_task_model_complete_task_finish (_tmp0_, _data22_->res, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GraniteMessageDialog* error_dialog = NULL;
		GThemedIcon* _tmp1_;
		GThemedIcon* _tmp2_;
		GraniteMessageDialog* _tmp3_;
		GraniteMessageDialog* _tmp4_;
		GraniteMessageDialog* _tmp5_;
		GError* _tmp6_;
		const gchar* _tmp7_;
		GraniteMessageDialog* _tmp8_;
		GraniteMessageDialog* _tmp9_;
		GraniteMessageDialog* _tmp10_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp1_ = (GThemedIcon*) g_themed_icon_new ("dialog-error");
		_tmp2_ = _tmp1_;
		_tmp3_ = granite_message_dialog_new (_ ("Completing task failed"), _ ("The task registry may be unavailable or unable to be written to."), (GIcon*) _tmp2_, GTK_BUTTONS_CLOSE);
		g_object_ref_sink (_tmp3_);
		_tmp4_ = _tmp3_;
		_g_object_unref0 (_tmp2_);
		error_dialog = _tmp4_;
		_tmp5_ = error_dialog;
		_tmp6_ = e;
		_tmp7_ = _tmp6_->message;
		granite_message_dialog_show_error_details (_tmp5_, _tmp7_);
		_tmp8_ = error_dialog;
		gtk_window_present ((GtkWindow*) _tmp8_);
		_tmp9_ = error_dialog;
		_tmp10_ = error_dialog;
		g_signal_connect_object ((GtkDialog*) _tmp9_, "response", (GCallback) _gtk_window_destroy_gtk_dialog_response, (GtkWindow*) _tmp10_, 0);
		_g_object_unref0 (error_dialog);
		_g_error_free0 (e);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		gboolean _tmp11_ = FALSE;
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return _tmp11_;
	}
	result = G_SOURCE_REMOVE;
	return result;
}

static gboolean
___lambda67__gsource_func (gpointer self)
{
	gboolean result;
	result = __lambda67_ (self);
	return result;
}

static void
__lambda66_ (TasksListView* self,
             GObject* obj,
             GAsyncResult* res)
{
	Block22Data* _data22_;
	GAsyncResult* _tmp0_;
	g_return_if_fail (res != NULL);
	_data22_ = g_slice_new0 (Block22Data);
	_data22_->_ref_count_ = 1;
	_data22_->self = g_object_ref (self);
	_tmp0_ = _g_object_ref0 (res);
	_g_object_unref0 (_data22_->res);
	_data22_->res = _tmp0_;
	g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, ___lambda67__gsource_func, block22_data_ref (_data22_), block22_data_unref);
	block22_data_unref (_data22_);
	_data22_ = NULL;
}

static void
___lambda66__gasync_ready_callback (GObject* source_object,
                                    GAsyncResult* res,
                                    gpointer self)
{
	__lambda66_ ((TasksListView*) self, source_object, res);
	g_object_unref (self);
}

static void
__lambda65_ (Block21Data* _data21_,
             ECalComponent* task)
{
	TasksListView* self;
	TasksTaskModel* _tmp0_;
	self = _data21_->self;
	g_return_if_fail (task != NULL);
	_tmp0_ = tasks_application_model;
	tasks_task_model_complete_task (_tmp0_, _data21_->source, task, ___lambda66__gasync_ready_callback, g_object_ref (self));
}

static void
___lambda65__tasks_widgets_task_row_task_completed (TasksWidgetsTaskRow* _sender,
                                                    ECalComponent* task,
                                                    gpointer self)
{
	__lambda65_ (self, task);
}

static Block23Data*
block23_data_ref (Block23Data* _data23_)
{
	g_atomic_int_inc (&_data23_->_ref_count_);
	return _data23_;
}

static void
block23_data_unref (void * _userdata_)
{
	Block23Data* _data23_;
	_data23_ = (Block23Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data23_->_ref_count_)) {
		TasksListView* self;
		self = _data23_->self;
		_g_object_unref0 (_data23_->res);
		_g_object_unref0 (self);
		g_slice_free (Block23Data, _data23_);
	}
}

static gboolean
__lambda70_ (Block23Data* _data23_)
{
	TasksListView* self;
	GError* _inner_error0_ = NULL;
	gboolean result;
	self = _data23_->self;
	{
		TasksTaskModel* _tmp0_;
		_tmp0_ = tasks_application_model;
		tasks_task_model_update_task_finish (_tmp0_, _data23_->res, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GraniteMessageDialog* error_dialog = NULL;
		GThemedIcon* _tmp1_;
		GThemedIcon* _tmp2_;
		GraniteMessageDialog* _tmp3_;
		GraniteMessageDialog* _tmp4_;
		GraniteMessageDialog* _tmp5_;
		GError* _tmp6_;
		const gchar* _tmp7_;
		GraniteMessageDialog* _tmp8_;
		GraniteMessageDialog* _tmp9_;
		GraniteMessageDialog* _tmp10_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp1_ = (GThemedIcon*) g_themed_icon_new ("dialog-error");
		_tmp2_ = _tmp1_;
		_tmp3_ = granite_message_dialog_new (_ ("Updating task failed"), _ ("The task registry may be unavailable or unable to be written to."), (GIcon*) _tmp2_, GTK_BUTTONS_CLOSE);
		g_object_ref_sink (_tmp3_);
		_tmp4_ = _tmp3_;
		_g_object_unref0 (_tmp2_);
		error_dialog = _tmp4_;
		_tmp5_ = error_dialog;
		_tmp6_ = e;
		_tmp7_ = _tmp6_->message;
		granite_message_dialog_show_error_details (_tmp5_, _tmp7_);
		_tmp8_ = error_dialog;
		gtk_window_present ((GtkWindow*) _tmp8_);
		_tmp9_ = error_dialog;
		_tmp10_ = error_dialog;
		g_signal_connect_object ((GtkDialog*) _tmp9_, "response", (GCallback) _gtk_window_destroy_gtk_dialog_response, (GtkWindow*) _tmp10_, 0);
		_g_object_unref0 (error_dialog);
		_g_error_free0 (e);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		gboolean _tmp11_ = FALSE;
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return _tmp11_;
	}
	result = G_SOURCE_REMOVE;
	return result;
}

static gboolean
___lambda70__gsource_func (gpointer self)
{
	gboolean result;
	result = __lambda70_ (self);
	return result;
}

static void
__lambda69_ (TasksListView* self,
             GObject* obj,
             GAsyncResult* res)
{
	Block23Data* _data23_;
	GAsyncResult* _tmp0_;
	g_return_if_fail (res != NULL);
	_data23_ = g_slice_new0 (Block23Data);
	_data23_->_ref_count_ = 1;
	_data23_->self = g_object_ref (self);
	_tmp0_ = _g_object_ref0 (res);
	_g_object_unref0 (_data23_->res);
	_data23_->res = _tmp0_;
	g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, ___lambda70__gsource_func, block23_data_ref (_data23_), block23_data_unref);
	block23_data_unref (_data23_);
	_data23_ = NULL;
}

static void
___lambda69__gasync_ready_callback (GObject* source_object,
                                    GAsyncResult* res,
                                    gpointer self)
{
	__lambda69_ ((TasksListView*) self, source_object, res);
	g_object_unref (self);
}

static void
__lambda68_ (Block21Data* _data21_,
             ECalComponent* task)
{
	TasksListView* self;
	TasksTaskModel* _tmp0_;
	self = _data21_->self;
	g_return_if_fail (task != NULL);
	_tmp0_ = tasks_application_model;
	tasks_task_model_update_task (_tmp0_, _data21_->source, task, E_CAL_OBJ_MOD_THIS_AND_FUTURE, ___lambda69__gasync_ready_callback, g_object_ref (self));
}

static void
___lambda68__tasks_widgets_task_row_task_changed (TasksWidgetsTaskRow* _sender,
                                                  ECalComponent* task,
                                                  gpointer self)
{
	__lambda68_ (self, task);
}

static Block24Data*
block24_data_ref (Block24Data* _data24_)
{
	g_atomic_int_inc (&_data24_->_ref_count_);
	return _data24_;
}

static void
block24_data_unref (void * _userdata_)
{
	Block24Data* _data24_;
	_data24_ = (Block24Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data24_->_ref_count_)) {
		TasksListView* self;
		self = _data24_->self;
		_g_object_unref0 (_data24_->res);
		_g_object_unref0 (self);
		g_slice_free (Block24Data, _data24_);
	}
}

static gboolean
__lambda73_ (Block24Data* _data24_)
{
	TasksListView* self;
	GError* _inner_error0_ = NULL;
	gboolean result;
	self = _data24_->self;
	{
		TasksTaskModel* _tmp0_;
		_tmp0_ = tasks_application_model;
		tasks_task_model_remove_task_finish (_tmp0_, _data24_->res, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GraniteMessageDialog* error_dialog = NULL;
		GThemedIcon* _tmp1_;
		GThemedIcon* _tmp2_;
		GraniteMessageDialog* _tmp3_;
		GraniteMessageDialog* _tmp4_;
		GraniteMessageDialog* _tmp5_;
		GError* _tmp6_;
		const gchar* _tmp7_;
		GraniteMessageDialog* _tmp8_;
		GraniteMessageDialog* _tmp9_;
		GraniteMessageDialog* _tmp10_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp1_ = (GThemedIcon*) g_themed_icon_new ("dialog-error");
		_tmp2_ = _tmp1_;
		_tmp3_ = granite_message_dialog_new (_ ("Removing task failed"), _ ("The task registry may be unavailable or unable to be written to."), (GIcon*) _tmp2_, GTK_BUTTONS_CLOSE);
		g_object_ref_sink (_tmp3_);
		_tmp4_ = _tmp3_;
		_g_object_unref0 (_tmp2_);
		error_dialog = _tmp4_;
		_tmp5_ = error_dialog;
		_tmp6_ = e;
		_tmp7_ = _tmp6_->message;
		granite_message_dialog_show_error_details (_tmp5_, _tmp7_);
		_tmp8_ = error_dialog;
		gtk_window_present ((GtkWindow*) _tmp8_);
		_tmp9_ = error_dialog;
		_tmp10_ = error_dialog;
		g_signal_connect_object ((GtkDialog*) _tmp9_, "response", (GCallback) _gtk_window_destroy_gtk_dialog_response, (GtkWindow*) _tmp10_, 0);
		_g_object_unref0 (error_dialog);
		_g_error_free0 (e);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		gboolean _tmp11_ = FALSE;
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return _tmp11_;
	}
	result = G_SOURCE_REMOVE;
	return result;
}

static gboolean
___lambda73__gsource_func (gpointer self)
{
	gboolean result;
	result = __lambda73_ (self);
	return result;
}

static void
__lambda72_ (TasksListView* self,
             GObject* obj,
             GAsyncResult* res)
{
	Block24Data* _data24_;
	GAsyncResult* _tmp0_;
	g_return_if_fail (res != NULL);
	_data24_ = g_slice_new0 (Block24Data);
	_data24_->_ref_count_ = 1;
	_data24_->self = g_object_ref (self);
	_tmp0_ = _g_object_ref0 (res);
	_g_object_unref0 (_data24_->res);
	_data24_->res = _tmp0_;
	g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, ___lambda73__gsource_func, block24_data_ref (_data24_), block24_data_unref);
	block24_data_unref (_data24_);
	_data24_ = NULL;
}

static void
___lambda72__gasync_ready_callback (GObject* source_object,
                                    GAsyncResult* res,
                                    gpointer self)
{
	__lambda72_ ((TasksListView*) self, source_object, res);
	g_object_unref (self);
}

static void
__lambda71_ (Block21Data* _data21_,
             ECalComponent* task)
{
	TasksListView* self;
	TasksTaskModel* _tmp0_;
	self = _data21_->self;
	g_return_if_fail (task != NULL);
	_tmp0_ = tasks_application_model;
	tasks_task_model_remove_task (_tmp0_, _data21_->source, task, E_CAL_OBJ_MOD_ALL, ___lambda72__gasync_ready_callback, g_object_ref (self));
}

static void
___lambda71__tasks_widgets_task_row_task_removed (TasksWidgetsTaskRow* _sender,
                                                  ECalComponent* task,
                                                  gpointer self)
{
	__lambda71_ (self, task);
}

static gboolean
__lambda37_ (Block21Data* _data21_,
             ECalComponent* task)
{
	TasksListView* self;
	TasksWidgetsTaskRow* task_row = NULL;
	TasksWidgetsTaskRow* _tmp0_;
	GtkListBox* _tmp1_;
	gboolean result;
	self = _data21_->self;
	g_return_val_if_fail (task != NULL, FALSE);
	_tmp0_ = tasks_widgets_task_row_new_for_component (task, _data21_->source, FALSE);
	g_object_ref_sink (_tmp0_);
	task_row = _tmp0_;
	g_signal_connect_object (task_row, "unselect", (GCallback) _tasks_list_view_on_row_unselect_tasks_widgets_task_row_unselect, self, 0);
	g_signal_connect_data (task_row, "task-completed", (GCallback) ___lambda65__tasks_widgets_task_row_task_completed, block21_data_ref (_data21_), (GClosureNotify) block21_data_unref, 0);
	g_signal_connect_data (task_row, "task-changed", (GCallback) ___lambda68__tasks_widgets_task_row_task_changed, block21_data_ref (_data21_), (GClosureNotify) block21_data_unref, 0);
	g_signal_connect_data (task_row, "task-removed", (GCallback) ___lambda71__tasks_widgets_task_row_task_removed, block21_data_ref (_data21_), (GClosureNotify) block21_data_unref, 0);
	_tmp1_ = self->priv->task_list;
	gtk_list_box_append (_tmp1_, (GtkWidget*) task_row);
	result = TRUE;
	_g_object_unref0 (task_row);
	_g_object_unref0 (task);
	return result;
}

static gboolean
___lambda37__gee_forall_func (gpointer g,
                              gpointer self)
{
	gboolean result;
	result = __lambda37_ (self, (ECalComponent*) g);
	return result;
}

static gboolean
__lambda74_ (TasksListView* self)
{
	GtkListBox* _tmp0_;
	gboolean result;
	_tmp0_ = self->priv->task_list;
	gtk_list_box_invalidate_sort (_tmp0_);
	result = G_SOURCE_REMOVE;
	return result;
}

static gboolean
___lambda74__gsource_func (gpointer self)
{
	gboolean result;
	result = __lambda74_ ((TasksListView*) self);
	return result;
}

static void
tasks_list_view_on_tasks_added (TasksListView* self,
                                GeeCollection* tasks,
                                ESource* source)
{
	Block21Data* _data21_;
	ESource* _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (tasks != NULL);
	g_return_if_fail (source != NULL);
	_data21_ = g_slice_new0 (Block21Data);
	_data21_->_ref_count_ = 1;
	_data21_->self = g_object_ref (self);
	_tmp0_ = _g_object_ref0 (source);
	_g_object_unref0 (_data21_->source);
	_data21_->source = _tmp0_;
	gee_traversable_foreach ((GeeTraversable*) tasks, ___lambda37__gee_forall_func, _data21_);
	g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, ___lambda74__gsource_func, g_object_ref (self), g_object_unref);
	block21_data_unref (_data21_);
	_data21_ = NULL;
}

static gboolean
__lambda75_ (TasksListView* self)
{
	GtkListBox* _tmp0_;
	gboolean result;
	_tmp0_ = self->priv->task_list;
	gtk_list_box_invalidate_sort (_tmp0_);
	result = G_SOURCE_REMOVE;
	return result;
}

static gboolean
___lambda75__gsource_func (gpointer self)
{
	gboolean result;
	result = __lambda75_ ((TasksListView*) self);
	return result;
}

static void
tasks_list_view_on_tasks_modified (TasksListView* self,
                                   GeeCollection* tasks)
{
	TasksWidgetsTaskRow* task_row = NULL;
	gint row_index = 0;
	g_return_if_fail (self != NULL);
	g_return_if_fail (tasks != NULL);
	task_row = NULL;
	row_index = 0;
	{
		gboolean _tmp0_ = FALSE;
		_tmp0_ = TRUE;
		while (TRUE) {
			GtkListBox* _tmp2_;
			GtkListBoxRow* _tmp3_;
			TasksWidgetsTaskRow* _tmp4_;
			gint _tmp15_;
			if (!_tmp0_) {
				TasksWidgetsTaskRow* _tmp1_;
				_tmp1_ = task_row;
				if (!(_tmp1_ != NULL)) {
					break;
				}
			}
			_tmp0_ = FALSE;
			_tmp2_ = self->priv->task_list;
			_tmp3_ = gtk_list_box_get_row_at_index (_tmp2_, row_index);
			task_row = G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, TASKS_WIDGETS_TYPE_TASK_ROW, TasksWidgetsTaskRow);
			_tmp4_ = task_row;
			if (_tmp4_ != NULL) {
				{
					GeeIterator* _task_it = NULL;
					GeeIterator* _tmp5_;
					_tmp5_ = gee_iterable_iterator ((GeeIterable*) tasks);
					_task_it = _tmp5_;
					while (TRUE) {
						GeeIterator* _tmp6_;
						ECalComponent* task = NULL;
						GeeIterator* _tmp7_;
						gpointer _tmp8_;
						TasksWidgetsTaskRow* _tmp9_;
						ECalComponent* _tmp10_;
						ECalComponent* _tmp11_;
						ECalComponent* _tmp12_;
						_tmp6_ = _task_it;
						if (!gee_iterator_next (_tmp6_)) {
							break;
						}
						_tmp7_ = _task_it;
						_tmp8_ = gee_iterator_get (_tmp7_);
						task = (ECalComponent*) _tmp8_;
						_tmp9_ = task_row;
						_tmp10_ = tasks_widgets_task_row_get_task (_tmp9_);
						_tmp11_ = _tmp10_;
						_tmp12_ = task;
						if (tasks_util_calcomponent_equal_func (_tmp11_, _tmp12_)) {
							TasksWidgetsTaskRow* _tmp13_;
							ECalComponent* _tmp14_;
							_tmp13_ = task_row;
							_tmp14_ = task;
							tasks_widgets_task_row_set_task (_tmp13_, _tmp14_);
							_g_object_unref0 (task);
							break;
						}
						_g_object_unref0 (task);
					}
					_g_object_unref0 (_task_it);
				}
			}
			_tmp15_ = row_index;
			row_index = _tmp15_ + 1;
		}
	}
	g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, ___lambda75__gsource_func, g_object_ref (self), g_object_unref);
}

static gboolean
__lambda76_ (TasksListView* self)
{
	GtkListBox* _tmp0_;
	gboolean result;
	_tmp0_ = self->priv->task_list;
	gtk_list_box_invalidate_sort (_tmp0_);
	result = G_SOURCE_REMOVE;
	return result;
}

static gboolean
___lambda76__gsource_func (gpointer self)
{
	gboolean result;
	result = __lambda76_ ((TasksListView*) self);
	return result;
}

static void
tasks_list_view_on_tasks_removed (TasksListView* self,
                                  GSList* cids)
{
	TasksWidgetsTaskRow* task_row = NULL;
	gint row_index = 0;
	g_return_if_fail (self != NULL);
	task_row = NULL;
	row_index = 0;
	{
		gboolean _tmp0_ = FALSE;
		_tmp0_ = TRUE;
		while (TRUE) {
			GtkListBox* _tmp2_;
			GtkListBoxRow* _tmp3_;
			TasksWidgetsTaskRow* _tmp4_;
			gint _tmp15_;
			if (!_tmp0_) {
				TasksWidgetsTaskRow* _tmp1_;
				_tmp1_ = task_row;
				if (!(_tmp1_ != NULL)) {
					break;
				}
			}
			_tmp0_ = FALSE;
			_tmp2_ = self->priv->task_list;
			_tmp3_ = gtk_list_box_get_row_at_index (_tmp2_, row_index);
			task_row = G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, TASKS_WIDGETS_TYPE_TASK_ROW, TasksWidgetsTaskRow);
			_tmp4_ = task_row;
			if (_tmp4_ != NULL) {
				{
					GSList* cid_collection = NULL;
					GSList* cid_it = NULL;
					cid_collection = cids;
					for (cid_it = cid_collection; cid_it != NULL; cid_it = cid_it->next) {
						ECalComponentId* cid = NULL;
						cid = (ECalComponentId*) cid_it->data;
						{
							ECalComponentId* _tmp5_;
							_tmp5_ = cid;
							if (_tmp5_ == NULL) {
								continue;
							} else {
								ECalComponentId* _tmp6_;
								const gchar* _tmp7_;
								TasksWidgetsTaskRow* _tmp8_;
								ECalComponent* _tmp9_;
								ECalComponent* _tmp10_;
								ICalComponent* _tmp11_;
								const gchar* _tmp12_;
								_tmp6_ = cid;
								_tmp7_ = e_cal_component_id_get_uid (_tmp6_);
								_tmp8_ = task_row;
								_tmp9_ = tasks_widgets_task_row_get_task (_tmp8_);
								_tmp10_ = _tmp9_;
								_tmp11_ = e_cal_component_get_icalcomponent (_tmp10_);
								_tmp12_ = i_cal_component_get_uid (_tmp11_);
								if (g_strcmp0 (_tmp7_, _tmp12_) == 0) {
									GtkListBox* _tmp13_;
									TasksWidgetsTaskRow* _tmp14_;
									_tmp13_ = self->priv->task_list;
									_tmp14_ = task_row;
									gtk_list_box_remove (_tmp13_, (GtkWidget*) _tmp14_);
									break;
								}
							}
						}
					}
				}
			}
			_tmp15_ = row_index;
			row_index = _tmp15_ + 1;
		}
	}
	g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, ___lambda76__gsource_func, g_object_ref (self), g_object_unref);
}

ESource*
tasks_list_view_get_source (TasksListView* self)
{
	ESource* result;
	ESource* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_source;
	result = _tmp0_;
	return result;
}

static void
tasks_list_view_set_source (TasksListView* self,
                            ESource* value)
{
	ESource* old_value;
	g_return_if_fail (self != NULL);
	old_value = tasks_list_view_get_source (self);
	if (old_value != value) {
		ESource* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_source);
		self->priv->_source = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, tasks_list_view_properties[TASKS_LIST_VIEW_SOURCE_PROPERTY]);
	}
}

static Block25Data*
block25_data_ref (Block25Data* _data25_)
{
	g_atomic_int_inc (&_data25_->_ref_count_);
	return _data25_;
}

static void
block25_data_unref (void * _userdata_)
{
	Block25Data* _data25_;
	_data25_ = (Block25Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data25_->_ref_count_)) {
		TasksListView* self;
		self = _data25_->self;
		_g_object_unref0 (_data25_->settings_button);
		_g_object_unref0 (_data25_->list_settings_popover);
		_g_object_unref0 (self);
		g_slice_free (Block25Data, _data25_);
	}
}

static Block26Data*
block26_data_ref (Block26Data* _data26_)
{
	g_atomic_int_inc (&_data26_->_ref_count_);
	return _data26_;
}

static void
block26_data_unref (void * _userdata_)
{
	Block26Data* _data26_;
	_data26_ = (Block26Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data26_->_ref_count_)) {
		TasksListView* self;
		self = _data26_->self;
		_g_object_unref0 (_data26_->res);
		_g_object_unref0 (self);
		g_slice_free (Block26Data, _data26_);
	}
}

static gboolean
__lambda92_ (Block26Data* _data26_)
{
	TasksListView* self;
	GError* _inner_error0_ = NULL;
	gboolean result;
	self = _data26_->self;
	{
		TasksTaskModel* _tmp0_;
		_tmp0_ = tasks_application_model;
		tasks_task_model_add_task_finish (_tmp0_, _data26_->res, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GraniteMessageDialog* error_dialog = NULL;
		GThemedIcon* _tmp1_;
		GThemedIcon* _tmp2_;
		GraniteMessageDialog* _tmp3_;
		GraniteMessageDialog* _tmp4_;
		GraniteMessageDialog* _tmp5_;
		GError* _tmp6_;
		const gchar* _tmp7_;
		GraniteMessageDialog* _tmp8_;
		GraniteMessageDialog* _tmp9_;
		GraniteMessageDialog* _tmp10_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp1_ = (GThemedIcon*) g_themed_icon_new ("dialog-error");
		_tmp2_ = _tmp1_;
		_tmp3_ = granite_message_dialog_new (_ ("Adding task failed"), _ ("The task list registry may be unavailable or unable to be written to."), (GIcon*) _tmp2_, GTK_BUTTONS_CLOSE);
		g_object_ref_sink (_tmp3_);
		_tmp4_ = _tmp3_;
		_g_object_unref0 (_tmp2_);
		error_dialog = _tmp4_;
		_tmp5_ = error_dialog;
		_tmp6_ = e;
		_tmp7_ = _tmp6_->message;
		granite_message_dialog_show_error_details (_tmp5_, _tmp7_);
		_tmp8_ = error_dialog;
		gtk_window_present ((GtkWindow*) _tmp8_);
		_tmp9_ = error_dialog;
		_tmp10_ = error_dialog;
		g_signal_connect_object ((GtkDialog*) _tmp9_, "response", (GCallback) _gtk_window_destroy_gtk_dialog_response, (GtkWindow*) _tmp10_, 0);
		_g_object_unref0 (error_dialog);
		_g_error_free0 (e);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		gboolean _tmp11_ = FALSE;
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return _tmp11_;
	}
	result = G_SOURCE_REMOVE;
	return result;
}

static gboolean
___lambda92__gsource_func (gpointer self)
{
	gboolean result;
	result = __lambda92_ (self);
	return result;
}

static void
__lambda91_ (TasksListView* self,
             GObject* obj,
             GAsyncResult* res)
{
	Block26Data* _data26_;
	GAsyncResult* _tmp0_;
	g_return_if_fail (res != NULL);
	_data26_ = g_slice_new0 (Block26Data);
	_data26_->_ref_count_ = 1;
	_data26_->self = g_object_ref (self);
	_tmp0_ = _g_object_ref0 (res);
	_g_object_unref0 (_data26_->res);
	_data26_->res = _tmp0_;
	g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, ___lambda92__gsource_func, block26_data_ref (_data26_), block26_data_unref);
	block26_data_unref (_data26_);
	_data26_ = NULL;
}

static void
___lambda91__gasync_ready_callback (GObject* source_object,
                                    GAsyncResult* res,
                                    gpointer self)
{
	__lambda91_ ((TasksListView*) self, source_object, res);
	g_object_unref (self);
}

static void
_tasks_list_view___lambda90_ (TasksListView* self,
                              ECalComponent* task)
{
	TasksTaskModel* _tmp0_;
	ESource* _tmp1_;
	g_return_if_fail (task != NULL);
	_tmp0_ = tasks_application_model;
	_tmp1_ = self->priv->_source;
	tasks_task_model_add_task (_tmp0_, _tmp1_, task, ___lambda91__gasync_ready_callback, g_object_ref (self));
}

static void
__tasks_list_view___lambda90__tasks_widgets_task_row_task_changed (TasksWidgetsTaskRow* _sender,
                                                                   ECalComponent* task,
                                                                   gpointer self)
{
	_tasks_list_view___lambda90_ ((TasksListView*) self, task);
}

static gint
_tasks_list_view_sort_function_gtk_list_box_sort_func (GtkListBoxRow* row1,
                                                       GtkListBoxRow* row2,
                                                       gpointer self)
{
	gint result;
	result = tasks_list_view_sort_function (row1, row2, (TasksListView*) self);
	return result;
}

static void
_tasks_list_view___lambda93_ (TasksListView* self)
{
	GSettings* _tmp0_;
	_tmp0_ = tasks_application_settings;
	tasks_list_view_on_show_completed_changed (self, g_settings_get_boolean (_tmp0_, "show-completed"));
}

static void
__tasks_list_view___lambda93__g_settings_changed (GSettings* _sender,
                                                  const gchar* key,
                                                  gpointer self)
{
	_tasks_list_view___lambda93_ ((TasksListView*) self);
}

static Block27Data*
block27_data_ref (Block27Data* _data27_)
{
	g_atomic_int_inc (&_data27_->_ref_count_);
	return _data27_;
}

static void
block27_data_unref (void * _userdata_)
{
	Block27Data* _data27_;
	_data27_ = (Block27Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data27_->_ref_count_)) {
		TasksListView* self;
		self = _data27_->_data25_->self;
		block25_data_unref (_data27_->_data25_);
		_data27_->_data25_ = NULL;
		g_slice_free (Block27Data, _data27_);
	}
}

static gboolean
___lambda95_ (Block27Data* _data27_)
{
	Block25Data* _data25_;
	TasksListView* self;
	gboolean _tmp0_ = FALSE;
	GtkListBox* _tmp1_;
	GList* _tmp2_;
	GList* _tmp3_;
	gboolean _tmp4_;
	GtkApplicationWindow* _tmp8_;
	GAction* _tmp9_;
	gboolean result;
	_data25_ = _data27_->_data25_;
	self = _data25_->self;
	_tmp1_ = self->priv->add_task_list;
	_tmp2_ = gtk_list_box_get_selected_rows (_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = g_list_length (_tmp3_) == ((guint) 0);
	(_tmp3_ == NULL) ? NULL : (_tmp3_ = (g_list_free (_tmp3_), NULL));
	if (_tmp4_) {
		GtkListBox* _tmp5_;
		GList* _tmp6_;
		GList* _tmp7_;
		_tmp5_ = self->priv->task_list;
		_tmp6_ = gtk_list_box_get_selected_rows (_tmp5_);
		_tmp7_ = _tmp6_;
		_tmp0_ = g_list_length (_tmp7_) == ((guint) 0);
		(_tmp7_ == NULL) ? NULL : (_tmp7_ = (g_list_free (_tmp7_), NULL));
	} else {
		_tmp0_ = FALSE;
	}
	_tmp8_ = _data27_->main_window;
	_tmp9_ = g_action_map_lookup_action ((GActionMap*) _tmp8_, TASKS_MAIN_WINDOW_ACTION_DELETE_SELECTED_LIST);
	g_simple_action_set_enabled (G_TYPE_CHECK_INSTANCE_CAST (_tmp9_, g_simple_action_get_type (), GSimpleAction), _tmp0_);
	result = G_SOURCE_REMOVE;
	return result;
}

static gboolean
____lambda95__gsource_func (gpointer self)
{
	gboolean result;
	result = ___lambda95_ (self);
	return result;
}

static void
_tasks_list_view___lambda94_ (Block25Data* _data25_)
{
	TasksListView* self;
	Block27Data* _data27_;
	GApplication* _tmp0_;
	GtkWindow* _tmp1_;
	GtkWindow* _tmp2_;
	GtkMenuButton* _tmp3_;
	gboolean _tmp4_;
	gboolean _tmp5_;
	self = _data25_->self;
	_data27_ = g_slice_new0 (Block27Data);
	_data27_->_ref_count_ = 1;
	_data27_->_data25_ = block25_data_ref (_data25_);
	_tmp0_ = g_application_get_default ();
	_tmp1_ = gtk_application_get_active_window (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, gtk_application_get_type (), GtkApplication));
	_tmp2_ = _tmp1_;
	_data27_->main_window = G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, gtk_application_window_get_type (), GtkApplicationWindow);
	_tmp3_ = _data25_->settings_button;
	_tmp4_ = gtk_menu_button_get_active (_tmp3_);
	_tmp5_ = _tmp4_;
	if (_tmp5_) {
		TasksWidgetsListSettingsPopover* _tmp6_;
		ESource* _tmp7_;
		GtkApplicationWindow* _tmp8_;
		GAction* _tmp9_;
		_tmp6_ = _data25_->list_settings_popover;
		_tmp7_ = self->priv->_source;
		tasks_widgets_list_settings_popover_set_source (_tmp6_, _tmp7_);
		_tmp8_ = _data27_->main_window;
		_tmp9_ = g_action_map_lookup_action ((GActionMap*) _tmp8_, TASKS_MAIN_WINDOW_ACTION_DELETE_SELECTED_LIST);
		g_simple_action_set_enabled (G_TYPE_CHECK_INSTANCE_CAST (_tmp9_, g_simple_action_get_type (), GSimpleAction), TRUE);
	} else {
		g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, ____lambda95__gsource_func, block27_data_ref (_data27_), block27_data_unref);
	}
	block27_data_unref (_data27_);
	_data27_ = NULL;
}

static void
__tasks_list_view___lambda94__gtk_menu_button_activate (GtkMenuButton* _sender,
                                                        gpointer self)
{
	_tasks_list_view___lambda94_ (self);
}

static void
_tasks_list_view_on_row_activated_gtk_list_box_row_activated (GtkListBox* _sender,
                                                              GtkListBoxRow* row,
                                                              gpointer self)
{
	tasks_list_view_on_row_activated ((TasksListView*) self, row);
}

static void
_tasks_list_view___lambda96_ (TasksListView* self)
{
	GtkApplicationWindow* main_window = NULL;
	GApplication* _tmp0_;
	GtkWindow* _tmp1_;
	GtkWindow* _tmp2_;
	GtkApplicationWindow* _tmp3_;
	GAction* _tmp4_;
	TasksWidgetsEditableLabel* _tmp5_;
	gboolean _tmp6_;
	gboolean _tmp7_;
	_tmp0_ = g_application_get_default ();
	_tmp1_ = gtk_application_get_active_window (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, gtk_application_get_type (), GtkApplication));
	_tmp2_ = _tmp1_;
	main_window = G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, gtk_application_window_get_type (), GtkApplicationWindow);
	_tmp3_ = main_window;
	_tmp4_ = g_action_map_lookup_action ((GActionMap*) _tmp3_, TASKS_MAIN_WINDOW_ACTION_DELETE_SELECTED_LIST);
	_tmp5_ = self->priv->editable_title;
	_tmp6_ = tasks_widgets_editable_label_get_editing (_tmp5_);
	_tmp7_ = _tmp6_;
	g_simple_action_set_enabled (G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, g_simple_action_get_type (), GSimpleAction), !_tmp7_);
}

static void
__tasks_list_view___lambda96__g_object_notify (GObject* _sender,
                                               GParamSpec* pspec,
                                               gpointer self)
{
	_tasks_list_view___lambda96_ ((TasksListView*) self);
}

static Block28Data*
block28_data_ref (Block28Data* _data28_)
{
	g_atomic_int_inc (&_data28_->_ref_count_);
	return _data28_;
}

static void
block28_data_unref (void * _userdata_)
{
	Block28Data* _data28_;
	_data28_ = (Block28Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data28_->_ref_count_)) {
		TasksListView* self;
		self = _data28_->self;
		_g_object_unref0 (_data28_->error_dialog);
		_g_object_unref0 (self);
		g_slice_free (Block28Data, _data28_);
	}
}

static void
___lambda99_ (Block28Data* _data28_)
{
	TasksListView* self;
	GraniteMessageDialog* _tmp0_;
	self = _data28_->self;
	_tmp0_ = _data28_->error_dialog;
	gtk_window_destroy ((GtkWindow*) _tmp0_);
}

static void
____lambda99__gtk_dialog_response (GtkDialog* _sender,
                                   gint response_id,
                                   gpointer self)
{
	___lambda99_ (self);
}

static void
__lambda98_ (TasksListView* self,
             GObject* obj,
             GAsyncResult* res)
{
	GError* _inner_error0_ = NULL;
	g_return_if_fail (res != NULL);
	{
		TasksTaskModel* _tmp0_;
		_tmp0_ = tasks_application_model;
		tasks_task_model_update_task_list_display_name_finish (_tmp0_, res, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		Block28Data* _data28_;
		TasksWidgetsEditableLabel* _tmp1_;
		ESource* _tmp2_;
		const gchar* _tmp3_;
		const gchar* _tmp4_;
		GThemedIcon* _tmp5_;
		GThemedIcon* _tmp6_;
		GraniteMessageDialog* _tmp7_;
		GraniteMessageDialog* _tmp8_;
		GraniteMessageDialog* _tmp9_;
		GError* _tmp10_;
		const gchar* _tmp11_;
		GraniteMessageDialog* _tmp12_;
		GraniteMessageDialog* _tmp13_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_data28_ = g_slice_new0 (Block28Data);
		_data28_->_ref_count_ = 1;
		_data28_->self = g_object_ref (self);
		_tmp1_ = self->priv->editable_title;
		_tmp2_ = self->priv->_source;
		_tmp3_ = e_source_get_display_name (_tmp2_);
		_tmp4_ = _tmp3_;
		tasks_widgets_editable_label_set_text (_tmp1_, _tmp4_);
		_tmp5_ = (GThemedIcon*) g_themed_icon_new ("dialog-error");
		_tmp6_ = _tmp5_;
		_tmp7_ = granite_message_dialog_new (_ ("Renaming task list failed"), _ ("The task list registry may be unavailable or unable to be written to."), (GIcon*) _tmp6_, GTK_BUTTONS_CLOSE);
		g_object_ref_sink (_tmp7_);
		_tmp8_ = _tmp7_;
		_g_object_unref0 (_tmp6_);
		_data28_->error_dialog = _tmp8_;
		_tmp9_ = _data28_->error_dialog;
		_tmp10_ = e;
		_tmp11_ = _tmp10_->message;
		granite_message_dialog_show_error_details (_tmp9_, _tmp11_);
		_tmp12_ = _data28_->error_dialog;
		gtk_window_present ((GtkWindow*) _tmp12_);
		_tmp13_ = _data28_->error_dialog;
		g_signal_connect_data ((GtkDialog*) _tmp13_, "response", (GCallback) ____lambda99__gtk_dialog_response, block28_data_ref (_data28_), (GClosureNotify) block28_data_unref, 0);
		_g_error_free0 (e);
		block28_data_unref (_data28_);
		_data28_ = NULL;
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
}

static void
___lambda98__gasync_ready_callback (GObject* source_object,
                                    GAsyncResult* res,
                                    gpointer self)
{
	__lambda98_ ((TasksListView*) self, source_object, res);
	g_object_unref (self);
}

static void
_tasks_list_view___lambda97_ (TasksListView* self)
{
	TasksTaskModel* _tmp0_;
	ESource* _tmp1_;
	TasksWidgetsEditableLabel* _tmp2_;
	const gchar* _tmp3_;
	const gchar* _tmp4_;
	_tmp0_ = tasks_application_model;
	_tmp1_ = self->priv->_source;
	_tmp2_ = self->priv->editable_title;
	_tmp3_ = tasks_widgets_editable_label_get_text (_tmp2_);
	_tmp4_ = _tmp3_;
	tasks_task_model_update_task_list_display_name (_tmp0_, _tmp1_, _tmp4_, ___lambda98__gasync_ready_callback, g_object_ref (self));
}

static void
__tasks_list_view___lambda97__tasks_widgets_editable_label_changed (TasksWidgetsEditableLabel* _sender,
                                                                    gpointer self)
{
	_tasks_list_view___lambda97_ ((TasksListView*) self);
}

static GObject *
tasks_list_view_constructor (GType type,
                             guint n_construct_properties,
                             GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	TasksListView * self;
	Block25Data* _data25_;
	TasksWidgetsEditableLabel* _tmp9_ = NULL;
	TasksWidgetsEditableLabel* _tmp10_;
	TasksWidgetsEditableLabel* _tmp11_;
	ESource* _tmp12_;
	TasksWidgetsListSettingsPopover* _tmp13_;
	gchar* _tmp14_;
	TasksWidgetsListSettingsPopover* _tmp15_;
	GtkPopover* _tmp16_;
	gchar* _tmp17_;
	GtkMenuButton* _tmp18_ = NULL;
	GtkMenuButton* _tmp19_;
	GtkListBox* _tmp20_ = NULL;
	GtkListBox* _tmp21_;
	TasksWidgetsTaskRow* add_task_row = NULL;
	ESource* _tmp22_;
	TasksWidgetsTaskRow* _tmp23_;
	TasksWidgetsTaskRow* _tmp24_;
	TasksWidgetsTaskRow* _tmp25_;
	GtkListBox* _tmp26_;
	TasksWidgetsTaskRow* _tmp27_;
	GtkLabel* placeholder = NULL;
	GtkLabel* _tmp28_;
	GtkLabel* _tmp29_;
	GtkLabel* _tmp30_;
	GtkListBox* _tmp31_ = NULL;
	GtkListBox* _tmp32_;
	GtkLabel* _tmp33_;
	GtkListBox* _tmp34_;
	GtkListBox* _tmp35_;
	GtkScrolledWindow* scrolled_window = NULL;
	GtkListBox* _tmp36_;
	GtkWidget* _tmp37_;
	GtkScrolledWindow* _tmp38_ = NULL;
	GtkBox* header_box = NULL;
	GtkBox* _tmp39_;
	GtkBox* _tmp40_;
	TasksWidgetsEditableLabel* _tmp41_;
	GtkBox* _tmp42_;
	GtkMenuButton* _tmp43_;
	GtkBox* _tmp44_;
	GtkWindowControls* _tmp45_ = NULL;
	GtkWindowControls* _tmp46_;
	GtkBox* _tmp47_;
	AdwToolbarView* toolbar_view = NULL;
	GtkScrolledWindow* _tmp48_;
	GtkWidget* _tmp49_;
	AdwToolbarView* _tmp50_ = NULL;
	AdwToolbarView* _tmp51_;
	GtkBox* _tmp52_;
	AdwToolbarView* _tmp53_;
	GtkListBox* _tmp54_;
	AdwToolbarView* _tmp55_;
	GSettings* _tmp56_;
	GSettings* _tmp57_;
	GtkMenuButton* _tmp58_;
	GtkListBox* _tmp59_;
	GtkListBox* _tmp60_;
	TasksWidgetsEditableLabel* _tmp61_;
	TasksWidgetsEditableLabel* _tmp62_;
	GError* _inner_error0_ = NULL;
	parent_class = G_OBJECT_CLASS (tasks_list_view_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TASKS_TYPE_LIST_VIEW, TasksListView);
	_data25_ = g_slice_new0 (Block25Data);
	_data25_->_ref_count_ = 1;
	_data25_->self = g_object_ref (self);
	{
		ESourceRegistry* registry = NULL;
		ESourceRegistry* _tmp0_ = NULL;
		TasksTaskModel* _tmp1_;
		ESourceRegistry* _tmp2_;
		ESourceRegistry* _tmp3_;
		TasksTaskModel* _tmp4_;
		ESource* _tmp5_;
		ESourceRegistry* _tmp6_;
		gchar* _tmp7_;
		gchar* _tmp8_;
		registry = NULL;
		_tmp1_ = tasks_application_model;
		_tmp2_ = tasks_task_model_get_registry_sync (_tmp1_, &_inner_error0_);
		_tmp0_ = _tmp2_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_object_unref0 (registry);
			goto __catch0_g_error;
		}
		_tmp3_ = _tmp0_;
		_tmp0_ = NULL;
		_g_object_unref0 (registry);
		registry = _tmp3_;
		_tmp4_ = tasks_application_model;
		_tmp5_ = self->priv->_source;
		_tmp6_ = registry;
		_tmp7_ = tasks_task_model_get_collection_backend_name (_tmp4_, _tmp5_, _tmp6_);
		_tmp8_ = _tmp7_;
		self->priv->is_gtasks = g_strcmp0 (_tmp8_, "google") == 0;
		_g_free0 (_tmp8_);
		_g_object_unref0 (_tmp0_);
		_g_object_unref0 (registry);
	}
	goto __finally0;
	__catch0_g_error:
	{
		g_clear_error (&_inner_error0_);
		g_warning ("ListView.vala:25: unable to get the registry, assuming task list is no" \
"t from gtasks");
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		block25_data_unref (_data25_);
		_data25_ = NULL;
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
	}
	_tmp9_ = tasks_widgets_editable_label_new ();
	gtk_widget_set_hexpand ((GtkWidget*) _tmp9_, TRUE);
	g_object_ref_sink (_tmp9_);
	_g_object_unref0 (self->priv->editable_title);
	self->priv->editable_title = _tmp9_;
	_tmp10_ = self->priv->editable_title;
	gtk_widget_add_css_class ((GtkWidget*) _tmp10_, GRANITE_STYLE_CLASS_H1_LABEL);
	_tmp11_ = self->priv->editable_title;
	gtk_widget_add_css_class ((GtkWidget*) _tmp11_, GRANITE_STYLE_CLASS_ACCENT);
	_tmp12_ = self->priv->_source;
	_tmp13_ = tasks_widgets_list_settings_popover_new (_tmp12_);
	g_object_ref_sink (_tmp13_);
	_data25_->list_settings_popover = _tmp13_;
	_tmp14_ = g_strdup ("view-more-symbolic");
	_tmp15_ = _data25_->list_settings_popover;
	_tmp16_ = _g_object_ref0 ((GtkPopover*) _tmp15_);
	_tmp17_ = g_strdup_printf ("%s\n" GRANITE_TOOLTIP_SECONDARY_TEXT_MARKUP, _ ("Edit Name and Appearance"), "F10");
	_tmp18_ = (GtkMenuButton*) gtk_menu_button_new ();
	gtk_widget_set_halign ((GtkWidget*) _tmp18_, GTK_ALIGN_END);
	gtk_menu_button_set_icon_name (_tmp18_, _tmp14_);
	_g_free0 (_tmp14_);
	gtk_menu_button_set_popover (_tmp18_, _tmp16_);
	_g_object_unref0 (_tmp16_);
	gtk_menu_button_set_primary (_tmp18_, TRUE);
	gtk_widget_set_tooltip_markup ((GtkWidget*) _tmp18_, _tmp17_);
	_g_free0 (_tmp17_);
	gtk_widget_set_valign ((GtkWidget*) _tmp18_, GTK_ALIGN_CENTER);
	g_object_ref_sink (_tmp18_);
	_data25_->settings_button = _tmp18_;
	_tmp19_ = _data25_->settings_button;
	gtk_widget_add_css_class ((GtkWidget*) _tmp19_, GRANITE_STYLE_CLASS_DIM_LABEL);
	_tmp20_ = (GtkListBox*) gtk_list_box_new ();
	gtk_list_box_set_selection_mode (_tmp20_, GTK_SELECTION_SINGLE);
	gtk_list_box_set_activate_on_single_click (_tmp20_, TRUE);
	g_object_ref_sink (_tmp20_);
	_g_object_unref0 (self->priv->add_task_list);
	self->priv->add_task_list = _tmp20_;
	_tmp21_ = self->priv->add_task_list;
	gtk_widget_add_css_class ((GtkWidget*) _tmp21_, GRANITE_STYLE_CLASS_BACKGROUND);
	_tmp22_ = self->priv->_source;
	_tmp23_ = tasks_widgets_task_row_new_for_source (_tmp22_);
	g_object_ref_sink (_tmp23_);
	add_task_row = _tmp23_;
	_tmp24_ = add_task_row;
	g_signal_connect_object (_tmp24_, "unselect", (GCallback) _tasks_list_view_on_row_unselect_tasks_widgets_task_row_unselect, self, 0);
	_tmp25_ = add_task_row;
	g_signal_connect_object (_tmp25_, "task-changed", (GCallback) __tasks_list_view___lambda90__tasks_widgets_task_row_task_changed, self, 0);
	_tmp26_ = self->priv->add_task_list;
	_tmp27_ = add_task_row;
	gtk_list_box_append (_tmp26_, (GtkWidget*) _tmp27_);
	_tmp28_ = (GtkLabel*) gtk_label_new (_ ("No Tasks"));
	g_object_ref_sink (_tmp28_);
	placeholder = _tmp28_;
	_tmp29_ = placeholder;
	gtk_widget_add_css_class ((GtkWidget*) _tmp29_, GRANITE_STYLE_CLASS_DIM_LABEL);
	_tmp30_ = placeholder;
	gtk_widget_add_css_class ((GtkWidget*) _tmp30_, GRANITE_STYLE_CLASS_H2_LABEL);
	_tmp31_ = (GtkListBox*) gtk_list_box_new ();
	gtk_list_box_set_selection_mode (_tmp31_, GTK_SELECTION_MULTIPLE);
	gtk_list_box_set_activate_on_single_click (_tmp31_, TRUE);
	g_object_ref_sink (_tmp31_);
	_g_object_unref0 (self->priv->task_list);
	self->priv->task_list = _tmp31_;
	_tmp32_ = self->priv->task_list;
	_tmp33_ = placeholder;
	gtk_list_box_set_placeholder (_tmp32_, (GtkWidget*) _tmp33_);
	_tmp34_ = self->priv->task_list;
	gtk_list_box_set_sort_func (_tmp34_, _tasks_list_view_sort_function_gtk_list_box_sort_func, g_object_ref (self), g_object_unref);
	_tmp35_ = self->priv->task_list;
	gtk_widget_add_css_class ((GtkWidget*) _tmp35_, GRANITE_STYLE_CLASS_BACKGROUND);
	_tmp36_ = self->priv->task_list;
	_tmp37_ = _g_object_ref0 ((GtkWidget*) _tmp36_);
	_tmp38_ = (GtkScrolledWindow*) gtk_scrolled_window_new ();
	gtk_scrolled_window_set_child (_tmp38_, _tmp37_);
	_g_object_unref0 (_tmp37_);
	gtk_widget_set_hexpand ((GtkWidget*) _tmp38_, TRUE);
	gtk_widget_set_vexpand ((GtkWidget*) _tmp38_, TRUE);
	g_object_set (_tmp38_, "hscrollbar-policy", GTK_POLICY_NEVER, NULL);
	g_object_ref_sink (_tmp38_);
	scrolled_window = _tmp38_;
	_tmp39_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
	g_object_ref_sink (_tmp39_);
	header_box = _tmp39_;
	_tmp40_ = header_box;
	_tmp41_ = self->priv->editable_title;
	gtk_box_append (_tmp40_, (GtkWidget*) _tmp41_);
	_tmp42_ = header_box;
	_tmp43_ = _data25_->settings_button;
	gtk_box_append (_tmp42_, (GtkWidget*) _tmp43_);
	_tmp44_ = header_box;
	_tmp45_ = (GtkWindowControls*) gtk_window_controls_new (GTK_PACK_END);
	gtk_widget_set_valign ((GtkWidget*) _tmp45_, GTK_ALIGN_START);
	g_object_ref_sink (_tmp45_);
	_tmp46_ = _tmp45_;
	gtk_box_append (_tmp44_, (GtkWidget*) _tmp46_);
	_g_object_unref0 (_tmp46_);
	_tmp47_ = header_box;
	gtk_widget_add_css_class ((GtkWidget*) _tmp47_, "titlebar");
	_tmp48_ = scrolled_window;
	_tmp49_ = _g_object_ref0 ((GtkWidget*) _tmp48_);
	_tmp50_ = (AdwToolbarView*) adw_toolbar_view_new ();
	adw_toolbar_view_set_content (_tmp50_, _tmp49_);
	_g_object_unref0 (_tmp49_);
	g_object_ref_sink (_tmp50_);
	toolbar_view = _tmp50_;
	_tmp51_ = toolbar_view;
	_tmp52_ = header_box;
	adw_toolbar_view_add_top_bar (_tmp51_, (GtkWidget*) _tmp52_);
	_tmp53_ = toolbar_view;
	_tmp54_ = self->priv->add_task_list;
	adw_toolbar_view_add_top_bar (_tmp53_, (GtkWidget*) _tmp54_);
	_tmp55_ = toolbar_view;
	granite_bin_set_child ((GraniteBin*) self, (GtkWidget*) _tmp55_);
	_tmp56_ = tasks_application_settings;
	g_signal_connect_object (_tmp56_, "changed::show-completed", (GCallback) __tasks_list_view___lambda93__g_settings_changed, self, 0);
	_tmp57_ = tasks_application_settings;
	tasks_list_view_on_show_completed_changed (self, g_settings_get_boolean (_tmp57_, "show-completed"));
	_tmp58_ = _data25_->settings_button;
	g_signal_connect_data (_tmp58_, "activate", (GCallback) __tasks_list_view___lambda94__gtk_menu_button_activate, block25_data_ref (_data25_), (GClosureNotify) block25_data_unref, 0);
	_tmp59_ = self->priv->add_task_list;
	g_signal_connect_object (_tmp59_, "row-activated", (GCallback) _tasks_list_view_on_row_activated_gtk_list_box_row_activated, self, 0);
	_tmp60_ = self->priv->task_list;
	g_signal_connect_object (_tmp60_, "row-activated", (GCallback) _tasks_list_view_on_row_activated_gtk_list_box_row_activated, self, 0);
	_tmp61_ = self->priv->editable_title;
	g_signal_connect_object ((GObject*) _tmp61_, "notify::editing", (GCallback) __tasks_list_view___lambda96__g_object_notify, self, 0);
	_tmp62_ = self->priv->editable_title;
	g_signal_connect_object (_tmp62_, "changed", (GCallback) __tasks_list_view___lambda97__tasks_widgets_editable_label_changed, self, 0);
	_g_object_unref0 (toolbar_view);
	_g_object_unref0 (header_box);
	_g_object_unref0 (scrolled_window);
	_g_object_unref0 (placeholder);
	_g_object_unref0 (add_task_row);
	block25_data_unref (_data25_);
	_data25_ = NULL;
	return obj;
}

static void
tasks_list_view_class_init (TasksListViewClass * klass,
                            gpointer klass_data)
{
	tasks_list_view_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &TasksListView_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_tasks_list_view_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_tasks_list_view_set_property;
	G_OBJECT_CLASS (klass)->constructor = tasks_list_view_constructor;
	G_OBJECT_CLASS (klass)->finalize = tasks_list_view_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), TASKS_LIST_VIEW_SOURCE_PROPERTY, tasks_list_view_properties[TASKS_LIST_VIEW_SOURCE_PROPERTY] = g_param_spec_object ("source", "source", "source", e_source_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
}

static void
tasks_list_view_instance_init (TasksListView * self,
                               gpointer klass)
{
	self->priv = tasks_list_view_get_instance_private (self);
	self->priv->view = NULL;
}

static void
tasks_list_view_finalize (GObject * obj)
{
	TasksListView * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TASKS_TYPE_LIST_VIEW, TasksListView);
	_g_object_unref0 (self->priv->_source);
	_g_object_unref0 (self->priv->view);
	_g_object_unref0 (self->priv->editable_title);
	_g_object_unref0 (self->priv->add_task_list);
	_g_object_unref0 (self->priv->task_list);
	G_OBJECT_CLASS (tasks_list_view_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
tasks_list_view_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (TasksListViewClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) tasks_list_view_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (TasksListView), 0, (GInstanceInitFunc) tasks_list_view_instance_init, NULL };
	GType tasks_list_view_type_id;
	tasks_list_view_type_id = g_type_register_static (GRANITE_TYPE_BIN, "TasksListView", &g_define_type_info, 0);
	TasksListView_private_offset = g_type_add_instance_private (tasks_list_view_type_id, sizeof (TasksListViewPrivate));
	return tasks_list_view_type_id;
}

GType
tasks_list_view_get_type (void)
{
	static gsize tasks_list_view_type_id__once = 0;
	if (g_once_init_enter (&tasks_list_view_type_id__once)) {
		GType tasks_list_view_type_id;
		tasks_list_view_type_id = tasks_list_view_get_type_once ();
		g_once_init_leave (&tasks_list_view_type_id__once, tasks_list_view_type_id);
	}
	return tasks_list_view_type_id__once;
}

static void
_vala_tasks_list_view_get_property (GObject * object,
                                    guint property_id,
                                    GValue * value,
                                    GParamSpec * pspec)
{
	TasksListView * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TASKS_TYPE_LIST_VIEW, TasksListView);
	switch (property_id) {
		case TASKS_LIST_VIEW_SOURCE_PROPERTY:
		g_value_set_object (value, tasks_list_view_get_source (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_tasks_list_view_set_property (GObject * object,
                                    guint property_id,
                                    const GValue * value,
                                    GParamSpec * pspec)
{
	TasksListView * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TASKS_TYPE_LIST_VIEW, TasksListView);
	switch (property_id) {
		case TASKS_LIST_VIEW_SOURCE_PROPERTY:
		tasks_list_view_set_source (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

