/* Section.c generated by valac 0.56.19, the Vala compiler
 * generated from Section.vala, do not modify */

/*
 * Copyright © 2023 Alain M. (https://github.com/alainm23/planify)
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public
 * License as published by the Free Software Foundation; either
 * version 3 of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public
 * License along with this program; if not, write to the
 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 * Boston, MA 02110-1301 USA
 *
 * Authored by: Alain M. <alainmh23@gmail.com>
 */

#include "planify.h"
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <gee.h>
#include <glib-object.h>
#include <json-glib/json-glib.h>
#include <gio/gio.h>
#include <gtk/gtk.h>
#include <adwaita.h>
#include <glib/gi18n-lib.h>
#include <libical-glib/libical-glib.h>

#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

enum  {
	OBJECTS_SECTION_0_PROPERTY,
	OBJECTS_SECTION_PROJECT_ID_PROPERTY,
	OBJECTS_SECTION_ARCHIVED_AT_PROPERTY,
	OBJECTS_SECTION_ADDED_AT_PROPERTY,
	OBJECTS_SECTION_SECTION_ORDER_PROPERTY,
	OBJECTS_SECTION_COLLAPSED_PROPERTY,
	OBJECTS_SECTION_IS_DELETED_PROPERTY,
	OBJECTS_SECTION_IS_ARCHIVED_PROPERTY,
	OBJECTS_SECTION_DESCRIPTION_PROPERTY,
	OBJECTS_SECTION_HIDDED_PROPERTY,
	OBJECTS_SECTION_EXTRA_DATA_PROPERTY,
	OBJECTS_SECTION_ICAL_URL_PROPERTY,
	OBJECTS_SECTION_ETAG_PROPERTY,
	OBJECTS_SECTION_IS_CALDAV_SECTION_PROPERTY,
	OBJECTS_SECTION_ACTIVATE_NAME_EDITABLE_PROPERTY,
	OBJECTS_SECTION_SHORT_NAME_PROPERTY,
	OBJECTS_SECTION_PROJECT_PROPERTY,
	OBJECTS_SECTION_ITEMS_PROPERTY,
	OBJECTS_SECTION_SECTION_COUNT_PROPERTY,
	OBJECTS_SECTION_NUM_PROPERTIES
};
static GParamSpec* objects_section_properties[OBJECTS_SECTION_NUM_PROPERTIES];
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_date_time_unref0(var) ((var == NULL) ? NULL : (var = (g_date_time_unref (var), NULL)))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _Block61Data Block61Data;
#define _http_response_unref0(var) ((var == NULL) ? NULL : (var = (http_response_unref (var), NULL)))
typedef struct _Block62Data Block62Data;
#define __vala_JsonNode_free0(var) ((var == NULL) ? NULL : (var = (_vala_JsonNode_free (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
typedef struct _ObjectsSectionDeleteCaldavSectionData ObjectsSectionDeleteCaldavSectionData;
typedef struct _ObjectsSectionDeleteItemCaldavRecursiveData ObjectsSectionDeleteItemCaldavRecursiveData;
enum  {
	OBJECTS_SECTION_SECTION_COUNT_UPDATED_SIGNAL,
	OBJECTS_SECTION_ITEM_ADDED_SIGNAL,
	OBJECTS_SECTION_ITEM_DELETED_SIGNAL,
	OBJECTS_SECTION_NUM_SIGNALS
};
static guint objects_section_signals[OBJECTS_SECTION_NUM_SIGNALS] = {0};

struct _ObjectsSectionPrivate {
	gchar* _project_id;
	gchar* _archived_at;
	gchar* _added_at;
	gint _section_order;
	gboolean _collapsed;
	gboolean _is_deleted;
	gboolean _is_archived;
	gchar* _description;
	gboolean _hidded;
	gchar* _extra_data;
	gchar* _ical_url;
	gchar* _etag;
	gboolean _activate_name_editable;
	gchar* _short_name;
	ObjectsProject* _project;
	GeeArrayList* _items;
	GRecMutex __lock__items;
	gint* _section_count;
};

struct _Block61Data {
	int _ref_count_;
	ObjectsSection* self;
	gboolean cloud;
};

struct _Block62Data {
	int _ref_count_;
	Block61Data * _data61_;
	ServicesCalDAVCalDAVClient* caldav_client;
};

struct _ObjectsSectionDeleteCaldavSectionData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	ObjectsSection* self;
	ServicesCalDAVCalDAVClient* caldav_client;
	GeeArrayList* _item_list;
	GeeArrayList* _tmp0_;
	GeeArrayList* _tmp1_;
	gint _item_size;
	GeeArrayList* _tmp2_;
	gint _tmp3_;
	gint _tmp4_;
	gint _item_index;
	gint _tmp5_;
	gint _tmp6_;
	ObjectsItem* item;
	GeeArrayList* _tmp7_;
	gpointer _tmp8_;
	ObjectsItem* _tmp9_;
	HttpResponse* caldav_response;
	HttpResponse* _tmp10_;
	HttpResponse* _tmp11_;
	gboolean _tmp12_;
	gboolean _tmp13_;
	ServicesStore* _tmp14_;
	ServicesEventBus* _tmp15_;
	ServicesEventBus* _tmp16_;
	HttpResponse* _tmp17_;
	gint _tmp18_;
	gint _tmp19_;
	HttpResponse* _tmp20_;
	const gchar* _tmp21_;
	const gchar* _tmp22_;
	GError* e;
	ServicesEventBus* _tmp23_;
	ServicesEventBus* _tmp24_;
	GError* _tmp25_;
	const gchar* _tmp26_;
	GError* _inner_error0_;
};

struct _ObjectsSectionDeleteItemCaldavRecursiveData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	ObjectsSection* self;
	ObjectsItem* item;
	ServicesCalDAVCalDAVClient* caldav_client;
	GeeArrayList* _subitem_list;
	ServicesStore* _tmp0_;
	GeeArrayList* _tmp1_;
	gint _subitem_size;
	GeeArrayList* _tmp2_;
	gint _tmp3_;
	gint _tmp4_;
	gint _subitem_index;
	gint _tmp5_;
	gint _tmp6_;
	ObjectsItem* subitem;
	GeeArrayList* _tmp7_;
	gpointer _tmp8_;
	ObjectsItem* _tmp9_;
	HttpResponse* _tmp10_;
	HttpResponse* _tmp11_;
	GError* _inner_error0_;
};

static gint ObjectsSection_private_offset;
static gpointer objects_section_parent_class = NULL;
gchar* objects_section_CALDAV_PREFIX = NULL;

static gint objects_section_update_section_count (ObjectsSection* self);
static gint* _int_dup (gint* self);
static Block61Data* block61_data_ref (Block61Data* _data61_);
static void block61_data_unref (void * _userdata_);
static gboolean __lambda45_ (Block61Data* _data61_);
static void ___lambda46_ (ObjectsSection* self,
                   GObject* obj,
                   GAsyncResult* res);
static void ____lambda46__gasync_ready_callback (GObject* source_object,
                                          GAsyncResult* res,
                                          gpointer self);
static Block62Data* block62_data_ref (Block62Data* _data62_);
static void block62_data_unref (void * _userdata_);
static void ____lambda47_ (Block62Data* _data62_,
                    GObject* obj,
                    GAsyncResult* res);
static void _____lambda47__gasync_ready_callback (GObject* source_object,
                                           GAsyncResult* res,
                                           gpointer self);
static gboolean ___lambda45__gsource_func (gpointer self);
static gchar* objects_section_real_get_update_json (ObjectsBaseObject* base,
                                             const gchar* uuid,
                                             const gchar* temp_id);
static void _vala_JsonNode_free (JsonNode* self);
static gchar* objects_section_real_get_add_json (ObjectsBaseObject* base,
                                          const gchar* temp_id,
                                          const gchar* uuid);
static gchar* objects_section_real_to_json (ObjectsBaseObject* base);
static gchar* objects_section_real_get_move_json (ObjectsBaseObject* base,
                                           const gchar* uuid,
                                           const gchar* new_project_id);
static gint objects_section_get_subitem_size (ObjectsSection* self,
                                       ObjectsItem* item);
static void __lambda48_ (ObjectsSection* self,
                  const gchar* response);
static void ____lambda49_ (ObjectsSection* self,
                    GObject* obj,
                    GAsyncResult* res);
static void _____lambda49__gasync_ready_callback (GObject* source_object,
                                           GAsyncResult* res,
                                           gpointer self);
static void _objects_section_delete_caldav_section (ObjectsSection* self,
                                             ServicesCalDAVCalDAVClient* caldav_client,
                                             GAsyncReadyCallback _callback_,
                                             gpointer _user_data_);
static void _objects_section_delete_caldav_section_finish (ObjectsSection* self,
                                                    GAsyncResult* _res_);
static void ___lambda48__adw_alert_dialog_response (AdwAlertDialog* _sender,
                                             const gchar* response,
                                             gpointer self);
static void __lambda50_ (ObjectsSection* self,
                  const gchar* response);
static void ___lambda50__adw_alert_dialog_response (AdwAlertDialog* _sender,
                                             const gchar* response,
                                             gpointer self);
static void _objects_section_delete_caldav_section_data_free (gpointer _data);
static gboolean _objects_section_delete_caldav_section_co (ObjectsSectionDeleteCaldavSectionData* _data_);
static void objects_section_delete_item_caldav_recursive (ObjectsSection* self,
                                                   ObjectsItem* item,
                                                   ServicesCalDAVCalDAVClient* caldav_client,
                                                   GAsyncReadyCallback _callback_,
                                                   gpointer _user_data_);
static void objects_section_delete_item_caldav_recursive_finish (ObjectsSection* self,
                                                          GAsyncResult* _res_,
                                                          GError** error);
static void _objects_section_delete_caldav_section_ready (GObject* source_object,
                                                   GAsyncResult* _res_,
                                                   gpointer _user_data_);
static void objects_section_delete_item_caldav_recursive_data_free (gpointer _data);
static gboolean objects_section_delete_item_caldav_recursive_co (ObjectsSectionDeleteItemCaldavRecursiveData* _data_);
static void objects_section_delete_item_caldav_recursive_ready (GObject* source_object,
                                                         GAsyncResult* _res_,
                                                         gpointer _user_data_);
static gint _objects_section_items___lambda26_ (ObjectsSection* self,
                                         ObjectsItem* a,
                                         ObjectsItem* b);
static gint __objects_section_items___lambda26__gcompare_data_func (gconstpointer a,
                                                             gconstpointer b,
                                                             gpointer self);
static GObject * objects_section_constructor (GType type,
                                       guint n_construct_properties,
                                       GObjectConstructParam * construct_properties);
static void _objects_section___lambda51_ (ObjectsSection* self,
                                   ObjectsItem* item);
static void __objects_section___lambda51__services_event_bus_checked_toggled (ServicesEventBus* _sender,
                                                                       ObjectsItem* item,
                                                                       gboolean old_checked,
                                                                       gpointer self);
static void _objects_section___lambda52_ (ObjectsSection* self,
                                   ObjectsItem* item);
static void __objects_section___lambda52__objects_section_item_deleted (ObjectsSection* _sender,
                                                                 ObjectsItem* item,
                                                                 gpointer self);
static void _objects_section___lambda53_ (ObjectsSection* self,
                                   ObjectsItem* item);
static void __objects_section___lambda53__objects_section_item_added (ObjectsSection* _sender,
                                                               ObjectsItem* item,
                                                               gpointer self);
static void _objects_section___lambda54_ (ObjectsSection* self,
                                   ObjectsItem* item,
                                   const gchar* old_project_id,
                                   const gchar* old_section_id);
static void __objects_section___lambda54__services_event_bus_item_moved (ServicesEventBus* _sender,
                                                                  ObjectsItem* item,
                                                                  const gchar* old_project_id,
                                                                  const gchar* old_section_id,
                                                                  const gchar* old_parent_id,
                                                                  gpointer self);
static void _objects_section___lambda55_ (ObjectsSection* self,
                                   ObjectsItem* item);
static void __objects_section___lambda55__services_store_item_deleted (ServicesStore* _sender,
                                                                ObjectsItem* item,
                                                                gpointer self);
static void _objects_section___lambda56_ (ObjectsSection* self,
                                   ObjectsItem* item);
static void __objects_section___lambda56__services_store_item_added (ServicesStore* _sender,
                                                              ObjectsItem* item,
                                                              gboolean insert,
                                                              gpointer self);
static void _objects_section___lambda57_ (ObjectsSection* self,
                                   ObjectsItem* item,
                                   const gchar* old_project_id,
                                   const gchar* old_section_id,
                                   const gchar* old_parent_id);
static void __objects_section___lambda57__services_store_item_moved (ServicesStore* _sender,
                                                              ObjectsItem* item,
                                                              const gchar* old_project_id,
                                                              const gchar* old_section_id,
                                                              const gchar* old_parent_id,
                                                              gpointer self);
static void objects_section_finalize (GObject * obj);
static GType objects_section_get_type_once (void);
static void _vala_objects_section_get_property (GObject * object,
                                         guint property_id,
                                         GValue * value,
                                         GParamSpec * pspec);
static void _vala_objects_section_set_property (GObject * object,
                                         guint property_id,
                                         const GValue * value,
                                         GParamSpec * pspec);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
objects_section_get_instance_private (ObjectsSection* self)
{
	return G_STRUCT_MEMBER_P (self, ObjectsSection_private_offset);
}

static gchar*
g_date_time_to_string (GDateTime* self)
{
	gchar* _tmp0_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = g_date_time_format (self, "%FT%H:%M:%S%z");
	result = _tmp0_;
	return result;
}

static gint*
_int_dup (gint* self)
{
	gint* dup;
	dup = g_new0 (gint, 1);
	memcpy (dup, self, sizeof (gint));
	return dup;
}

static gpointer
__int_dup0 (gpointer self)
{
	return self ? _int_dup (self) : NULL;
}

void
objects_section_update_count (ObjectsSection* self)
{
	gint _tmp0_;
	gint* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = objects_section_update_section_count (self);
	_tmp1_ = __int_dup0 (&_tmp0_);
	_g_free0 (self->priv->_section_count);
	self->priv->_section_count = _tmp1_;
	g_signal_emit (self, objects_section_signals[OBJECTS_SECTION_SECTION_COUNT_UPDATED_SIGNAL], 0);
}

ObjectsSection*
objects_section_construct_from_json (GType object_type,
                                     JsonNode* node)
{
	ObjectsSection * self = NULL;
	JsonObject* _tmp0_;
	const gchar* _tmp1_;
	g_return_val_if_fail (node != NULL, NULL);
	self = (ObjectsSection*) objects_base_object_construct (object_type);
	_tmp0_ = json_node_get_object (node);
	_tmp1_ = json_object_get_string_member (_tmp0_, "id");
	objects_base_object_set_id ((ObjectsBaseObject*) self, _tmp1_);
	objects_section_update_from_json (self, node);
	return self;
}

ObjectsSection*
objects_section_new_from_json (JsonNode* node)
{
	return objects_section_construct_from_json (OBJECTS_TYPE_SECTION, node);
}

ObjectsSection*
objects_section_construct_from_import_json (GType object_type,
                                            JsonNode* node)
{
	ObjectsSection * self = NULL;
	JsonObject* _tmp0_;
	const gchar* _tmp1_;
	JsonObject* _tmp2_;
	const gchar* _tmp3_;
	JsonObject* _tmp4_;
	const gchar* _tmp5_;
	JsonObject* _tmp6_;
	const gchar* _tmp7_;
	JsonObject* _tmp8_;
	const gchar* _tmp9_;
	JsonObject* _tmp10_;
	JsonObject* _tmp11_;
	JsonObject* _tmp12_;
	JsonObject* _tmp13_;
	g_return_val_if_fail (node != NULL, NULL);
	self = (ObjectsSection*) objects_base_object_construct (object_type);
	_tmp0_ = json_node_get_object (node);
	_tmp1_ = json_object_get_string_member (_tmp0_, "id");
	objects_base_object_set_id ((ObjectsBaseObject*) self, _tmp1_);
	_tmp2_ = json_node_get_object (node);
	_tmp3_ = json_object_get_string_member (_tmp2_, "name");
	objects_base_object_set_name ((ObjectsBaseObject*) self, _tmp3_);
	_tmp4_ = json_node_get_object (node);
	_tmp5_ = json_object_get_string_member (_tmp4_, "archived_at");
	objects_section_set_archived_at (self, _tmp5_);
	_tmp6_ = json_node_get_object (node);
	_tmp7_ = json_object_get_string_member (_tmp6_, "added_at");
	objects_section_set_added_at (self, _tmp7_);
	_tmp8_ = json_node_get_object (node);
	_tmp9_ = json_object_get_string_member (_tmp8_, "project_id");
	objects_section_set_project_id (self, _tmp9_);
	_tmp10_ = json_node_get_object (node);
	objects_section_set_section_order (self, (gint) ((gint32) json_object_get_int_member (_tmp10_, "section_order")));
	_tmp11_ = json_node_get_object (node);
	objects_section_set_collapsed (self, json_object_get_boolean_member (_tmp11_, "is_collapsed"));
	_tmp12_ = json_node_get_object (node);
	objects_section_set_is_deleted (self, json_object_get_boolean_member (_tmp12_, "is_deleted"));
	_tmp13_ = json_node_get_object (node);
	objects_section_set_is_archived (self, json_object_get_boolean_member (_tmp13_, "is_archived"));
	return self;
}

ObjectsSection*
objects_section_new_from_import_json (JsonNode* node)
{
	return objects_section_construct_from_import_json (OBJECTS_TYPE_SECTION, node);
}

void
objects_section_update_from_json (ObjectsSection* self,
                                  JsonNode* node)
{
	JsonObject* _tmp0_;
	const gchar* _tmp1_;
	JsonObject* _tmp2_;
	const gchar* _tmp3_;
	JsonObject* _tmp4_;
	const gchar* _tmp5_;
	JsonObject* _tmp6_;
	JsonObject* _tmp7_;
	JsonObject* _tmp8_;
	JsonObject* _tmp9_;
	JsonObject* _tmp10_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (node != NULL);
	_tmp0_ = json_node_get_object (node);
	_tmp1_ = json_object_get_string_member (_tmp0_, "project_id");
	objects_section_set_project_id (self, _tmp1_);
	_tmp2_ = json_node_get_object (node);
	_tmp3_ = json_object_get_string_member (_tmp2_, "name");
	objects_base_object_set_name ((ObjectsBaseObject*) self, _tmp3_);
	_tmp4_ = json_node_get_object (node);
	_tmp5_ = json_object_get_string_member (_tmp4_, "added_at");
	objects_section_set_added_at (self, _tmp5_);
	_tmp6_ = json_node_get_object (node);
	objects_section_set_section_order (self, (gint) ((gint32) json_object_get_int_member (_tmp6_, "section_order")));
	_tmp7_ = json_node_get_object (node);
	objects_section_set_is_deleted (self, json_object_get_boolean_member (_tmp7_, "is_deleted"));
	_tmp8_ = json_node_get_object (node);
	objects_section_set_is_archived (self, json_object_get_boolean_member (_tmp8_, "is_archived"));
	_tmp9_ = json_node_get_object (node);
	objects_section_set_collapsed (self, json_object_get_boolean_member (_tmp9_, "is_collapsed"));
	_tmp10_ = json_node_get_object (node);
	if (!json_object_get_null_member (_tmp10_, "archived_at")) {
		JsonObject* _tmp11_;
		const gchar* _tmp12_;
		_tmp11_ = json_node_get_object (node);
		_tmp12_ = json_object_get_string_member (_tmp11_, "archived_at");
		objects_section_set_archived_at (self, _tmp12_);
	}
}

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

void
objects_section_set_project (ObjectsSection* self,
                             ObjectsProject* project)
{
	ObjectsProject* _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (project != NULL);
	_tmp0_ = _g_object_ref0 (project);
	_g_object_unref0 (self->priv->_project);
	self->priv->_project = _tmp0_;
}

ObjectsItem*
objects_section_add_item_if_not_exists (ObjectsSection* self,
                                        ObjectsItem* new_item,
                                        gboolean insert)
{
	ObjectsItem* return_value = NULL;
	GError* _inner_error0_ = NULL;
	ObjectsItem* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (new_item != NULL, NULL);
	return_value = NULL;
	{
		GeeArrayList* _tmp0_;
		_tmp0_ = self->priv->_items;
		g_rec_mutex_lock (&self->priv->__lock__items);
		{
			const gchar* _tmp1_;
			const gchar* _tmp2_;
			ObjectsItem* _tmp3_;
			ObjectsItem* _tmp4_;
			ObjectsItem* _tmp7_;
			ObjectsItem* _tmp8_;
			_tmp1_ = objects_base_object_get_id ((ObjectsBaseObject*) new_item);
			_tmp2_ = _tmp1_;
			_tmp3_ = objects_section_get_item (self, _tmp2_);
			_g_object_unref0 (return_value);
			return_value = _tmp3_;
			_tmp4_ = return_value;
			if (_tmp4_ == NULL) {
				ServicesStore* _tmp5_;
				ObjectsItem* _tmp6_;
				objects_item_set_section (new_item, self);
				objects_section_add_item (self, new_item);
				_tmp5_ = services_store_instance ();
				services_store_insert_item (_tmp5_, new_item, insert, TRUE);
				_tmp6_ = _g_object_ref0 (new_item);
				_g_object_unref0 (return_value);
				return_value = _tmp6_;
			}
			_tmp7_ = return_value;
			_tmp8_ = _g_object_ref0 (_tmp7_);
			result = _tmp8_;
			{
				GeeArrayList* _tmp9_;
				_tmp9_ = self->priv->_items;
				g_rec_mutex_unlock (&self->priv->__lock__items);
			}
			_g_object_unref0 (return_value);
			return result;
		}
		__finally0:
		{
			GeeArrayList* _tmp10_;
			_tmp10_ = self->priv->_items;
			g_rec_mutex_unlock (&self->priv->__lock__items);
		}
		_g_object_unref0 (return_value);
		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 NULL;
	}
}

ObjectsItem*
objects_section_get_item (ObjectsSection* self,
                          const gchar* id)
{
	ObjectsItem* return_value = NULL;
	GError* _inner_error0_ = NULL;
	ObjectsItem* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (id != NULL, NULL);
	return_value = NULL;
	{
		GeeArrayList* _tmp0_;
		_tmp0_ = self->priv->_items;
		g_rec_mutex_lock (&self->priv->__lock__items);
		{
			{
				GeeArrayList* _item_list = NULL;
				GeeArrayList* _tmp1_;
				GeeArrayList* _tmp2_;
				gint _item_size = 0;
				GeeArrayList* _tmp3_;
				gint _tmp4_;
				gint _tmp5_;
				gint _item_index = 0;
				_tmp1_ = objects_section_get_items (self);
				_tmp2_ = _tmp1_;
				_item_list = _tmp2_;
				_tmp3_ = _item_list;
				_tmp4_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp3_);
				_tmp5_ = _tmp4_;
				_item_size = _tmp5_;
				_item_index = -1;
				while (TRUE) {
					gint _tmp6_;
					gint _tmp7_;
					ObjectsItem* item = NULL;
					GeeArrayList* _tmp8_;
					gpointer _tmp9_;
					ObjectsItem* _tmp10_;
					const gchar* _tmp11_;
					const gchar* _tmp12_;
					_item_index = _item_index + 1;
					_tmp6_ = _item_index;
					_tmp7_ = _item_size;
					if (!(_tmp6_ < _tmp7_)) {
						break;
					}
					_tmp8_ = _item_list;
					_tmp9_ = gee_abstract_list_get ((GeeAbstractList*) _tmp8_, _item_index);
					item = (ObjectsItem*) _tmp9_;
					_tmp10_ = item;
					_tmp11_ = objects_base_object_get_id ((ObjectsBaseObject*) _tmp10_);
					_tmp12_ = _tmp11_;
					if (g_strcmp0 (_tmp12_, id) == 0) {
						ObjectsItem* _tmp13_;
						ObjectsItem* _tmp14_;
						_tmp13_ = item;
						_tmp14_ = _g_object_ref0 (_tmp13_);
						_g_object_unref0 (return_value);
						return_value = _tmp14_;
						_g_object_unref0 (item);
						break;
					}
					_g_object_unref0 (item);
				}
			}
		}
		__finally0:
		{
			GeeArrayList* _tmp15_;
			_tmp15_ = self->priv->_items;
			g_rec_mutex_unlock (&self->priv->__lock__items);
		}
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_object_unref0 (return_value);
			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 NULL;
		}
	}
	result = return_value;
	return result;
}

void
objects_section_add_item (ObjectsSection* self,
                          ObjectsItem* item)
{
	GeeArrayList* _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (item != NULL);
	_tmp0_ = self->priv->_items;
	gee_abstract_collection_add ((GeeAbstractCollection*) _tmp0_, item);
}

static Block61Data*
block61_data_ref (Block61Data* _data61_)
{
	g_atomic_int_inc (&_data61_->_ref_count_);
	return _data61_;
}

static void
block61_data_unref (void * _userdata_)
{
	Block61Data* _data61_;
	_data61_ = (Block61Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data61_->_ref_count_)) {
		ObjectsSection* self;
		self = _data61_->self;
		_g_object_unref0 (self);
		g_slice_free (Block61Data, _data61_);
	}
}

static void
___lambda46_ (ObjectsSection* self,
              GObject* obj,
              GAsyncResult* res)
{
	ServicesTodoist* _tmp0_;
	ServicesTodoist* _tmp1_;
	HttpResponse* _tmp2_;
	HttpResponse* _tmp3_;
	g_return_if_fail (res != NULL);
	_tmp0_ = services_todoist_get_default ();
	_tmp1_ = _tmp0_;
	_tmp2_ = services_todoist_update_finish (_tmp1_, res);
	_tmp3_ = _tmp2_;
	_http_response_unref0 (_tmp3_);
	_g_object_unref0 (_tmp1_);
}

static void
____lambda46__gasync_ready_callback (GObject* source_object,
                                     GAsyncResult* res,
                                     gpointer self)
{
	___lambda46_ ((ObjectsSection*) self, source_object, res);
	g_object_unref (self);
}

static Block62Data*
block62_data_ref (Block62Data* _data62_)
{
	g_atomic_int_inc (&_data62_->_ref_count_);
	return _data62_;
}

static void
block62_data_unref (void * _userdata_)
{
	Block62Data* _data62_;
	_data62_ = (Block62Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data62_->_ref_count_)) {
		ObjectsSection* self;
		self = _data62_->_data61_->self;
		_g_object_unref0 (_data62_->caldav_client);
		block61_data_unref (_data62_->_data61_);
		_data62_->_data61_ = NULL;
		g_slice_free (Block62Data, _data62_);
	}
}

static void
____lambda47_ (Block62Data* _data62_,
               GObject* obj,
               GAsyncResult* res)
{
	Block61Data* _data61_;
	ObjectsSection* self;
	ServicesCalDAVCalDAVClient* _tmp0_;
	HttpResponse* _tmp1_;
	HttpResponse* _tmp2_;
	_data61_ = _data62_->_data61_;
	self = _data61_->self;
	g_return_if_fail (res != NULL);
	_tmp0_ = _data62_->caldav_client;
	_tmp1_ = services_cal_dav_cal_dav_client_add_section_finish (_tmp0_, res);
	_tmp2_ = _tmp1_;
	_http_response_unref0 (_tmp2_);
}

static void
_____lambda47__gasync_ready_callback (GObject* source_object,
                                      GAsyncResult* res,
                                      gpointer self)
{
	____lambda47_ (self, source_object, res);
	block62_data_unref (self);
}

static gboolean
__lambda45_ (Block61Data* _data61_)
{
	ObjectsSection* self;
	ServicesStore* _tmp0_;
	gboolean _tmp1_ = FALSE;
	ObjectsProject* _tmp2_;
	ObjectsProject* _tmp3_;
	SourceType _tmp4_;
	SourceType _tmp5_;
	gboolean result;
	self = _data61_->self;
	objects_base_object_set_update_timeout_id ((ObjectsBaseObject*) self, (guint) 0);
	_tmp0_ = services_store_instance ();
	services_store_update_section (_tmp0_, self);
	_tmp2_ = objects_section_get_project (self);
	_tmp3_ = _tmp2_;
	_tmp4_ = objects_project_get_source_type (_tmp3_);
	_tmp5_ = _tmp4_;
	if (_tmp5_ == SOURCE_TYPE_TODOIST) {
		_tmp1_ = _data61_->cloud;
	} else {
		_tmp1_ = FALSE;
	}
	if (_tmp1_) {
		ServicesTodoist* _tmp6_;
		ServicesTodoist* _tmp7_;
		_tmp6_ = services_todoist_get_default ();
		_tmp7_ = _tmp6_;
		services_todoist_update (_tmp7_, (ObjectsBaseObject*) self, ____lambda46__gasync_ready_callback, g_object_ref (self));
		_g_object_unref0 (_tmp7_);
	} else {
		gboolean _tmp8_ = FALSE;
		ObjectsProject* _tmp9_;
		ObjectsProject* _tmp10_;
		SourceType _tmp11_;
		SourceType _tmp12_;
		_tmp9_ = objects_section_get_project (self);
		_tmp10_ = _tmp9_;
		_tmp11_ = objects_project_get_source_type (_tmp10_);
		_tmp12_ = _tmp11_;
		if (_tmp12_ == SOURCE_TYPE_CALDAV) {
			_tmp8_ = _data61_->cloud;
		} else {
			_tmp8_ = FALSE;
		}
		if (_tmp8_) {
			Block62Data* _data62_;
			ServicesCalDAVCore* _tmp13_;
			ServicesCalDAVCore* _tmp14_;
			ObjectsProject* _tmp15_;
			ObjectsProject* _tmp16_;
			ObjectsSource* _tmp17_;
			ObjectsSource* _tmp18_;
			ServicesCalDAVCalDAVClient* _tmp19_;
			ServicesCalDAVCalDAVClient* _tmp20_;
			ServicesCalDAVCalDAVClient* _tmp21_;
			_data62_ = g_slice_new0 (Block62Data);
			_data62_->_ref_count_ = 1;
			_data62_->_data61_ = block61_data_ref (_data61_);
			_tmp13_ = services_cal_dav_core_get_default ();
			_tmp14_ = _tmp13_;
			_tmp15_ = objects_section_get_project (self);
			_tmp16_ = _tmp15_;
			_tmp17_ = objects_project_get_source (_tmp16_);
			_tmp18_ = _tmp17_;
			_tmp19_ = services_cal_dav_core_get_client (_tmp14_, _tmp18_);
			_tmp20_ = _tmp19_;
			_g_object_unref0 (_tmp14_);
			_data62_->caldav_client = _tmp20_;
			_tmp21_ = _data62_->caldav_client;
			services_cal_dav_cal_dav_client_add_section (_tmp21_, self, TRUE, _____lambda47__gasync_ready_callback, block62_data_ref (_data62_));
			block62_data_unref (_data62_);
			_data62_ = NULL;
		}
	}
	result = G_SOURCE_REMOVE;
	return result;
}

static gboolean
___lambda45__gsource_func (gpointer self)
{
	gboolean result;
	result = __lambda45_ (self);
	return result;
}

void
objects_section_update (ObjectsSection* self,
                        gboolean cloud)
{
	Block61Data* _data61_;
	guint _tmp0_;
	guint _tmp1_;
	g_return_if_fail (self != NULL);
	_data61_ = g_slice_new0 (Block61Data);
	_data61_->_ref_count_ = 1;
	_data61_->self = g_object_ref (self);
	_data61_->cloud = cloud;
	_tmp0_ = objects_base_object_get_update_timeout_id ((ObjectsBaseObject*) self);
	_tmp1_ = _tmp0_;
	if (_tmp1_ != ((guint) 0)) {
		guint _tmp2_;
		guint _tmp3_;
		_tmp2_ = objects_base_object_get_update_timeout_id ((ObjectsBaseObject*) self);
		_tmp3_ = _tmp2_;
		g_source_remove (_tmp3_);
	}
	objects_base_object_set_update_timeout_id ((ObjectsBaseObject*) self, g_timeout_add_full (G_PRIORITY_DEFAULT, (guint) CONSTANTS_UPDATE_TIMEOUT, ___lambda45__gsource_func, block61_data_ref (_data61_), block61_data_unref));
	block61_data_unref (_data61_);
	_data61_ = NULL;
}

void
objects_section_update_local (ObjectsSection* self)
{
	ServicesStore* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = services_store_instance ();
	services_store_update_section (_tmp0_, self);
}

static void
_vala_JsonNode_free (JsonNode* self)
{
	g_boxed_free (json_node_get_type (), self);
}

static gchar*
objects_section_real_get_update_json (ObjectsBaseObject* base,
                                      const gchar* uuid,
                                      const gchar* temp_id)
{
	ObjectsSection * self;
	JsonBuilder* builder = NULL;
	JsonBuilder* _tmp0_;
	JsonBuilder* _tmp1_;
	JsonBuilder* _tmp2_;
	JsonBuilder* _tmp3_;
	JsonBuilder* _tmp4_;
	JsonBuilder* _tmp5_;
	const gchar* _tmp6_ = NULL;
	JsonBuilder* _tmp7_;
	JsonBuilder* _tmp8_;
	JsonBuilder* _tmp9_;
	JsonBuilder* _tmp12_;
	JsonBuilder* _tmp13_;
	JsonBuilder* _tmp21_;
	JsonBuilder* _tmp22_;
	Util* _tmp23_;
	Util* _tmp24_;
	const gchar* _tmp25_;
	const gchar* _tmp26_;
	gchar* _tmp27_;
	gchar* _tmp28_;
	JsonBuilder* _tmp29_;
	JsonBuilder* _tmp30_;
	JsonBuilder* _tmp31_;
	JsonBuilder* _tmp32_;
	JsonGenerator* generator = NULL;
	JsonGenerator* _tmp33_;
	JsonNode* root = NULL;
	JsonBuilder* _tmp34_;
	JsonNode* _tmp35_;
	gchar* _tmp36_;
	gchar* result;
	self = (ObjectsSection*) base;
	g_return_val_if_fail (uuid != NULL, NULL);
	_tmp0_ = json_builder_new ();
	builder = _tmp0_;
	_tmp1_ = builder;
	json_builder_begin_object (_tmp1_);
	_tmp2_ = builder;
	json_builder_set_member_name (_tmp2_, "commands");
	_tmp3_ = builder;
	json_builder_begin_array (_tmp3_);
	_tmp4_ = builder;
	json_builder_begin_object (_tmp4_);
	_tmp5_ = builder;
	json_builder_set_member_name (_tmp5_, "type");
	if (temp_id == NULL) {
		_tmp6_ = "section_update";
	} else {
		_tmp6_ = "section_add";
	}
	_tmp7_ = builder;
	json_builder_add_string_value (_tmp7_, _tmp6_);
	_tmp8_ = builder;
	json_builder_set_member_name (_tmp8_, "uuid");
	_tmp9_ = builder;
	json_builder_add_string_value (_tmp9_, uuid);
	if (temp_id != NULL) {
		JsonBuilder* _tmp10_;
		JsonBuilder* _tmp11_;
		_tmp10_ = builder;
		json_builder_set_member_name (_tmp10_, "temp_id");
		_tmp11_ = builder;
		json_builder_add_string_value (_tmp11_, temp_id);
	}
	_tmp12_ = builder;
	json_builder_set_member_name (_tmp12_, "args");
	_tmp13_ = builder;
	json_builder_begin_object (_tmp13_);
	if (temp_id == NULL) {
		JsonBuilder* _tmp14_;
		JsonBuilder* _tmp15_;
		const gchar* _tmp16_;
		const gchar* _tmp17_;
		_tmp14_ = builder;
		json_builder_set_member_name (_tmp14_, "id");
		_tmp15_ = builder;
		_tmp16_ = objects_base_object_get_id ((ObjectsBaseObject*) self);
		_tmp17_ = _tmp16_;
		json_builder_add_string_value (_tmp15_, _tmp17_);
	}
	if (temp_id != NULL) {
		JsonBuilder* _tmp18_;
		JsonBuilder* _tmp19_;
		const gchar* _tmp20_;
		_tmp18_ = builder;
		json_builder_set_member_name (_tmp18_, "project_id");
		_tmp19_ = builder;
		_tmp20_ = self->priv->_project_id;
		json_builder_add_string_value (_tmp19_, _tmp20_);
	}
	_tmp21_ = builder;
	json_builder_set_member_name (_tmp21_, "name");
	_tmp22_ = builder;
	_tmp23_ = util_get_default ();
	_tmp24_ = _tmp23_;
	_tmp25_ = objects_base_object_get_name ((ObjectsBaseObject*) self);
	_tmp26_ = _tmp25_;
	_tmp27_ = util_get_encode_text (_tmp24_, _tmp26_);
	_tmp28_ = _tmp27_;
	json_builder_add_string_value (_tmp22_, _tmp28_);
	_g_free0 (_tmp28_);
	_g_object_unref0 (_tmp24_);
	_tmp29_ = builder;
	json_builder_end_object (_tmp29_);
	_tmp30_ = builder;
	json_builder_end_object (_tmp30_);
	_tmp31_ = builder;
	json_builder_end_array (_tmp31_);
	_tmp32_ = builder;
	json_builder_end_object (_tmp32_);
	_tmp33_ = json_generator_new ();
	generator = _tmp33_;
	_tmp34_ = builder;
	_tmp35_ = json_builder_get_root (_tmp34_);
	root = _tmp35_;
	json_generator_set_root (generator, root);
	_tmp36_ = json_generator_to_data (generator, NULL);
	result = _tmp36_;
	__vala_JsonNode_free0 (root);
	_g_object_unref0 (generator);
	_g_object_unref0 (builder);
	return result;
}

static gchar*
objects_section_real_get_add_json (ObjectsBaseObject* base,
                                   const gchar* temp_id,
                                   const gchar* uuid)
{
	ObjectsSection * self;
	gchar* _tmp0_;
	gchar* result;
	self = (ObjectsSection*) base;
	g_return_val_if_fail (temp_id != NULL, NULL);
	g_return_val_if_fail (uuid != NULL, NULL);
	_tmp0_ = objects_base_object_get_update_json ((ObjectsBaseObject*) self, uuid, temp_id);
	result = _tmp0_;
	return result;
}

static gchar*
objects_section_real_to_json (ObjectsBaseObject* base)
{
	ObjectsSection * self;
	JsonBuilder* builder = NULL;
	JsonBuilder* _tmp0_;
	JsonBuilder* _tmp1_;
	JsonBuilder* _tmp2_;
	JsonBuilder* _tmp3_;
	const gchar* _tmp4_;
	const gchar* _tmp5_;
	JsonBuilder* _tmp6_;
	ServicesDatabase* _tmp7_;
	ServicesDatabase* _tmp8_;
	const gchar* _tmp9_;
	gboolean _tmp10_;
	JsonBuilder* _tmp19_;
	JsonBuilder* _tmp20_;
	Util* _tmp21_;
	Util* _tmp22_;
	const gchar* _tmp23_;
	const gchar* _tmp24_;
	gchar* _tmp25_;
	gchar* _tmp26_;
	JsonBuilder* _tmp27_;
	JsonGenerator* generator = NULL;
	JsonGenerator* _tmp28_;
	JsonNode* root = NULL;
	JsonBuilder* _tmp29_;
	JsonNode* _tmp30_;
	gchar* _tmp31_;
	gchar* result;
	self = (ObjectsSection*) base;
	_tmp0_ = json_builder_new ();
	builder = _tmp0_;
	_tmp1_ = builder;
	json_builder_begin_object (_tmp1_);
	_tmp2_ = builder;
	json_builder_set_member_name (_tmp2_, "id");
	_tmp3_ = builder;
	_tmp4_ = objects_base_object_get_id ((ObjectsBaseObject*) self);
	_tmp5_ = _tmp4_;
	json_builder_add_string_value (_tmp3_, _tmp5_);
	_tmp6_ = builder;
	json_builder_set_member_name (_tmp6_, "project_id");
	_tmp7_ = services_database_get_default ();
	_tmp8_ = _tmp7_;
	_tmp9_ = self->priv->_project_id;
	_tmp10_ = services_database_curTempIds_exists (_tmp8_, _tmp9_);
	_g_object_unref0 (_tmp8_);
	if (_tmp10_) {
		JsonBuilder* _tmp11_;
		ServicesDatabase* _tmp12_;
		ServicesDatabase* _tmp13_;
		const gchar* _tmp14_;
		gchar* _tmp15_;
		gchar* _tmp16_;
		_tmp11_ = builder;
		_tmp12_ = services_database_get_default ();
		_tmp13_ = _tmp12_;
		_tmp14_ = self->priv->_project_id;
		_tmp15_ = services_database_get_temp_id (_tmp13_, _tmp14_);
		_tmp16_ = _tmp15_;
		json_builder_add_string_value (_tmp11_, _tmp16_);
		_g_free0 (_tmp16_);
		_g_object_unref0 (_tmp13_);
	} else {
		JsonBuilder* _tmp17_;
		const gchar* _tmp18_;
		_tmp17_ = builder;
		_tmp18_ = self->priv->_project_id;
		json_builder_add_string_value (_tmp17_, _tmp18_);
	}
	_tmp19_ = builder;
	json_builder_set_member_name (_tmp19_, "name");
	_tmp20_ = builder;
	_tmp21_ = util_get_default ();
	_tmp22_ = _tmp21_;
	_tmp23_ = objects_base_object_get_name ((ObjectsBaseObject*) self);
	_tmp24_ = _tmp23_;
	_tmp25_ = util_get_encode_text (_tmp22_, _tmp24_);
	_tmp26_ = _tmp25_;
	json_builder_add_string_value (_tmp20_, _tmp26_);
	_g_free0 (_tmp26_);
	_g_object_unref0 (_tmp22_);
	_tmp27_ = builder;
	json_builder_end_object (_tmp27_);
	_tmp28_ = json_generator_new ();
	generator = _tmp28_;
	_tmp29_ = builder;
	_tmp30_ = json_builder_get_root (_tmp29_);
	root = _tmp30_;
	json_generator_set_root (generator, root);
	_tmp31_ = json_generator_to_data (generator, NULL);
	result = _tmp31_;
	__vala_JsonNode_free0 (root);
	_g_object_unref0 (generator);
	_g_object_unref0 (builder);
	return result;
}

static gchar*
objects_section_real_get_move_json (ObjectsBaseObject* base,
                                    const gchar* uuid,
                                    const gchar* new_project_id)
{
	ObjectsSection * self;
	JsonBuilder* builder = NULL;
	JsonBuilder* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	JsonGenerator* generator = NULL;
	JsonGenerator* _tmp3_;
	JsonNode* root = NULL;
	JsonNode* _tmp4_;
	gchar* _tmp5_;
	gchar* result;
	self = (ObjectsSection*) base;
	g_return_val_if_fail (uuid != NULL, NULL);
	g_return_val_if_fail (new_project_id != NULL, NULL);
	_tmp0_ = json_builder_new ();
	builder = _tmp0_;
	json_builder_begin_object (builder);
	json_builder_set_member_name (builder, "commands");
	json_builder_begin_array (builder);
	json_builder_begin_object (builder);
	json_builder_set_member_name (builder, "type");
	json_builder_add_string_value (builder, "section_move");
	json_builder_set_member_name (builder, "uuid");
	json_builder_add_string_value (builder, uuid);
	json_builder_set_member_name (builder, "args");
	json_builder_begin_object (builder);
	json_builder_set_member_name (builder, "id");
	_tmp1_ = objects_base_object_get_id ((ObjectsBaseObject*) self);
	_tmp2_ = _tmp1_;
	json_builder_add_string_value (builder, _tmp2_);
	json_builder_set_member_name (builder, "project_id");
	json_builder_add_string_value (builder, new_project_id);
	json_builder_end_object (builder);
	json_builder_end_object (builder);
	json_builder_end_array (builder);
	json_builder_end_object (builder);
	_tmp3_ = json_generator_new ();
	generator = _tmp3_;
	_tmp4_ = json_builder_get_root (builder);
	root = _tmp4_;
	json_generator_set_root (generator, root);
	_tmp5_ = json_generator_to_data (generator, NULL);
	result = _tmp5_;
	__vala_JsonNode_free0 (root);
	_g_object_unref0 (generator);
	_g_object_unref0 (builder);
	return result;
}

static gint
objects_section_update_section_count (ObjectsSection* self)
{
	gint pending_tasks = 0;
	GeeArrayList* _tmp0_ = NULL;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	GeeArrayList* items = NULL;
	GeeArrayList* _tmp9_;
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	pending_tasks = 0;
	_tmp1_ = objects_base_object_get_id ((ObjectsBaseObject*) self);
	_tmp2_ = _tmp1_;
	if (g_strcmp0 (_tmp2_, "") == 0) {
		ServicesStore* _tmp3_;
		ObjectsProject* _tmp4_;
		ObjectsProject* _tmp5_;
		GeeArrayList* _tmp6_;
		_tmp3_ = services_store_instance ();
		_tmp4_ = objects_section_get_project (self);
		_tmp5_ = _tmp4_;
		_tmp6_ = services_store_get_items_by_baseobject (_tmp3_, (ObjectsBaseObject*) _tmp5_);
		_g_object_unref0 (_tmp0_);
		_tmp0_ = _tmp6_;
	} else {
		ServicesStore* _tmp7_;
		GeeArrayList* _tmp8_;
		_tmp7_ = services_store_instance ();
		_tmp8_ = services_store_get_items_by_baseobject (_tmp7_, (ObjectsBaseObject*) self);
		_g_object_unref0 (_tmp0_);
		_tmp0_ = _tmp8_;
	}
	_tmp9_ = _tmp0_;
	_tmp0_ = NULL;
	items = _tmp9_;
	{
		GeeArrayList* _item_list = NULL;
		GeeArrayList* _tmp10_;
		gint _item_size = 0;
		GeeArrayList* _tmp11_;
		gint _tmp12_;
		gint _tmp13_;
		gint _item_index = 0;
		_tmp10_ = items;
		_item_list = _tmp10_;
		_tmp11_ = _item_list;
		_tmp12_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp11_);
		_tmp13_ = _tmp12_;
		_item_size = _tmp13_;
		_item_index = -1;
		while (TRUE) {
			gint _tmp14_;
			gint _tmp15_;
			ObjectsItem* item = NULL;
			GeeArrayList* _tmp16_;
			gpointer _tmp17_;
			gboolean _tmp18_ = FALSE;
			ObjectsItem* _tmp19_;
			gboolean _tmp20_;
			gboolean _tmp21_;
			_item_index = _item_index + 1;
			_tmp14_ = _item_index;
			_tmp15_ = _item_size;
			if (!(_tmp14_ < _tmp15_)) {
				break;
			}
			_tmp16_ = _item_list;
			_tmp17_ = gee_abstract_list_get ((GeeAbstractList*) _tmp16_, _item_index);
			item = (ObjectsItem*) _tmp17_;
			_tmp19_ = item;
			_tmp20_ = objects_item_get_checked (_tmp19_);
			_tmp21_ = _tmp20_;
			if (!_tmp21_) {
				ObjectsItem* _tmp22_;
				_tmp22_ = item;
				_tmp18_ = !objects_item_was_archived (_tmp22_);
			} else {
				_tmp18_ = FALSE;
			}
			if (_tmp18_) {
				gint _tmp23_;
				ObjectsItem* _tmp24_;
				_tmp23_ = pending_tasks;
				pending_tasks = _tmp23_ + 1;
				_tmp24_ = item;
				pending_tasks += objects_section_get_subitem_size (self, _tmp24_);
			}
			_g_object_unref0 (item);
		}
	}
	result = pending_tasks;
	_g_object_unref0 (items);
	_g_object_unref0 (_tmp0_);
	return result;
}

static gint
objects_section_get_subitem_size (ObjectsSection* self,
                                  ObjectsItem* item)
{
	gint size = 0;
	GeeArrayList* _tmp0_;
	GeeArrayList* _tmp1_;
	gint _tmp2_;
	gint _tmp3_;
	gint count = 0;
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	g_return_val_if_fail (item != NULL, -1);
	_tmp0_ = objects_item_get_items_uncomplete (item);
	_tmp1_ = _tmp0_;
	_tmp2_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp1_);
	_tmp3_ = _tmp2_;
	size = _tmp3_;
	if (size <= 0) {
		result = 0;
		return result;
	}
	count = size;
	{
		GeeArrayList* _subitem_list = NULL;
		GeeArrayList* _tmp4_;
		GeeArrayList* _tmp5_;
		gint _subitem_size = 0;
		GeeArrayList* _tmp6_;
		gint _tmp7_;
		gint _tmp8_;
		gint _subitem_index = 0;
		_tmp4_ = objects_item_get_items_uncomplete (item);
		_tmp5_ = _tmp4_;
		_subitem_list = _tmp5_;
		_tmp6_ = _subitem_list;
		_tmp7_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp6_);
		_tmp8_ = _tmp7_;
		_subitem_size = _tmp8_;
		_subitem_index = -1;
		while (TRUE) {
			gint _tmp9_;
			gint _tmp10_;
			ObjectsItem* subitem = NULL;
			GeeArrayList* _tmp11_;
			gpointer _tmp12_;
			ObjectsItem* _tmp13_;
			_subitem_index = _subitem_index + 1;
			_tmp9_ = _subitem_index;
			_tmp10_ = _subitem_size;
			if (!(_tmp9_ < _tmp10_)) {
				break;
			}
			_tmp11_ = _subitem_list;
			_tmp12_ = gee_abstract_list_get ((GeeAbstractList*) _tmp11_, _subitem_index);
			subitem = (ObjectsItem*) _tmp12_;
			_tmp13_ = subitem;
			count += objects_section_get_subitem_size (self, _tmp13_);
			_g_object_unref0 (subitem);
		}
	}
	result = count;
	return result;
}

ObjectsSection*
objects_section_duplicate (ObjectsSection* self)
{
	ObjectsSection* new_section = NULL;
	ObjectsSection* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	const gchar* _tmp4_;
	const gchar* _tmp5_;
	ObjectsSection* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = objects_section_new ();
	new_section = _tmp0_;
	_tmp1_ = objects_base_object_get_name ((ObjectsBaseObject*) self);
	_tmp2_ = _tmp1_;
	objects_base_object_set_name ((ObjectsBaseObject*) new_section, _tmp2_);
	_tmp3_ = objects_base_object_get_color ((ObjectsBaseObject*) self);
	_tmp4_ = _tmp3_;
	objects_base_object_set_color ((ObjectsBaseObject*) new_section, _tmp4_);
	_tmp5_ = self->priv->_description;
	objects_section_set_description (new_section, _tmp5_);
	result = new_section;
	return result;
}

static void
____lambda49_ (ObjectsSection* self,
               GObject* obj,
               GAsyncResult* res)
{
	ServicesTodoist* _tmp0_;
	ServicesTodoist* _tmp1_;
	HttpResponse* _tmp2_;
	HttpResponse* _tmp3_;
	ServicesStore* _tmp4_;
	g_return_if_fail (res != NULL);
	_tmp0_ = services_todoist_get_default ();
	_tmp1_ = _tmp0_;
	_tmp2_ = services_todoist_delete_finish (_tmp1_, res);
	_tmp3_ = _tmp2_;
	_http_response_unref0 (_tmp3_);
	_g_object_unref0 (_tmp1_);
	_tmp4_ = services_store_instance ();
	services_store_delete_section (_tmp4_, self);
}

static void
_____lambda49__gasync_ready_callback (GObject* source_object,
                                      GAsyncResult* res,
                                      gpointer self)
{
	____lambda49_ ((ObjectsSection*) self, source_object, res);
	g_object_unref (self);
}

static void
__lambda48_ (ObjectsSection* self,
             const gchar* response)
{
	g_return_if_fail (response != NULL);
	if (g_strcmp0 (response, "delete") == 0) {
		ObjectsProject* _tmp0_;
		ObjectsProject* _tmp1_;
		SourceType _tmp2_;
		SourceType _tmp3_;
		objects_base_object_set_loading ((ObjectsBaseObject*) self, TRUE);
		_tmp0_ = objects_section_get_project (self);
		_tmp1_ = _tmp0_;
		_tmp2_ = objects_project_get_source_type (_tmp1_);
		_tmp3_ = _tmp2_;
		if (_tmp3_ == SOURCE_TYPE_TODOIST) {
			ServicesTodoist* _tmp4_;
			ServicesTodoist* _tmp5_;
			_tmp4_ = services_todoist_get_default ();
			_tmp5_ = _tmp4_;
			services_todoist_delete (_tmp5_, (ObjectsBaseObject*) self, _____lambda49__gasync_ready_callback, g_object_ref (self));
			_g_object_unref0 (_tmp5_);
		} else {
			gboolean _tmp6_ = FALSE;
			ObjectsProject* _tmp7_;
			ObjectsProject* _tmp8_;
			SourceType _tmp9_;
			SourceType _tmp10_;
			_tmp7_ = objects_section_get_project (self);
			_tmp8_ = _tmp7_;
			_tmp9_ = objects_project_get_source_type (_tmp8_);
			_tmp10_ = _tmp9_;
			if (_tmp10_ == SOURCE_TYPE_CALDAV) {
				const gchar* _tmp11_;
				const gchar* _tmp12_;
				_tmp11_ = objects_section_get_ical_url (self);
				_tmp12_ = _tmp11_;
				_tmp6_ = g_strcmp0 (_tmp12_, "") != 0;
			} else {
				_tmp6_ = FALSE;
			}
			if (_tmp6_) {
				ServicesCalDAVCalDAVClient* caldav_client = NULL;
				ServicesCalDAVCore* _tmp13_;
				ServicesCalDAVCore* _tmp14_;
				ObjectsProject* _tmp15_;
				ObjectsProject* _tmp16_;
				ObjectsSource* _tmp17_;
				ObjectsSource* _tmp18_;
				ServicesCalDAVCalDAVClient* _tmp19_;
				ServicesCalDAVCalDAVClient* _tmp20_;
				ServicesCalDAVCalDAVClient* _tmp21_;
				_tmp13_ = services_cal_dav_core_get_default ();
				_tmp14_ = _tmp13_;
				_tmp15_ = objects_section_get_project (self);
				_tmp16_ = _tmp15_;
				_tmp17_ = objects_project_get_source (_tmp16_);
				_tmp18_ = _tmp17_;
				_tmp19_ = services_cal_dav_core_get_client (_tmp14_, _tmp18_);
				_tmp20_ = _tmp19_;
				_g_object_unref0 (_tmp14_);
				caldav_client = _tmp20_;
				_tmp21_ = caldav_client;
				_objects_section_delete_caldav_section (self, _tmp21_, NULL, NULL);
				_g_object_unref0 (caldav_client);
			} else {
				ServicesStore* _tmp22_;
				_tmp22_ = services_store_instance ();
				services_store_delete_section (_tmp22_, self);
			}
		}
	}
}

static void
___lambda48__adw_alert_dialog_response (AdwAlertDialog* _sender,
                                        const gchar* response,
                                        gpointer self)
{
	__lambda48_ ((ObjectsSection*) self, response);
}

void
objects_section_delete_section (ObjectsSection* self,
                                GtkWindow* window)
{
	AdwAlertDialog* dialog = NULL;
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	AdwAlertDialog* _tmp4_;
	AdwAlertDialog* _tmp5_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (window != NULL);
	_tmp0_ = objects_base_object_get_name ((ObjectsBaseObject*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = g_strdup_printf ("Delete Section %s", _tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = (AdwAlertDialog*) adw_alert_dialog_new (_ (_tmp3_), _ ("This can not be undone"));
	g_object_ref_sink (_tmp4_);
	_tmp5_ = _tmp4_;
	_g_free0 (_tmp3_);
	dialog = _tmp5_;
	adw_alert_dialog_add_response (dialog, "cancel", _ ("Cancel"));
	adw_alert_dialog_add_response (dialog, "delete", _ ("Delete"));
	adw_alert_dialog_set_response_appearance (dialog, "delete", ADW_RESPONSE_DESTRUCTIVE);
	adw_dialog_present ((AdwDialog*) dialog, (GtkWidget*) window);
	g_signal_connect_object (dialog, "response", (GCallback) ___lambda48__adw_alert_dialog_response, self, 0);
	_g_object_unref0 (dialog);
}

static void
__lambda50_ (ObjectsSection* self,
             const gchar* response)
{
	g_return_if_fail (response != NULL);
	if (g_strcmp0 (response, "archive") == 0) {
		ServicesStore* _tmp0_;
		objects_section_set_is_archived (self, TRUE);
		_tmp0_ = services_store_instance ();
		services_store_archive_section (_tmp0_, self);
	}
}

static void
___lambda50__adw_alert_dialog_response (AdwAlertDialog* _sender,
                                        const gchar* response,
                                        gpointer self)
{
	__lambda50_ ((ObjectsSection*) self, response);
}

void
objects_section_archive_section (ObjectsSection* self,
                                 GtkWindow* window)
{
	AdwAlertDialog* dialog = NULL;
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	AdwAlertDialog* _tmp4_;
	AdwAlertDialog* _tmp5_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (window != NULL);
	_tmp0_ = objects_base_object_get_name ((ObjectsBaseObject*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = g_strdup_printf ("This will archive %s and all its tasks.", _tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = (AdwAlertDialog*) adw_alert_dialog_new (_ ("Archive?"), _ (_tmp3_));
	g_object_ref_sink (_tmp4_);
	_tmp5_ = _tmp4_;
	_g_free0 (_tmp3_);
	dialog = _tmp5_;
	adw_alert_dialog_add_response (dialog, "cancel", _ ("Cancel"));
	adw_alert_dialog_add_response (dialog, "archive", _ ("Archive"));
	adw_alert_dialog_set_close_response (dialog, "cancel");
	adw_alert_dialog_set_response_appearance (dialog, "archive", ADW_RESPONSE_DESTRUCTIVE);
	adw_dialog_present ((AdwDialog*) dialog, (GtkWidget*) window);
	g_signal_connect_object (dialog, "response", (GCallback) ___lambda50__adw_alert_dialog_response, self, 0);
	_g_object_unref0 (dialog);
}

void
objects_section_unarchive_section (ObjectsSection* self)
{
	ServicesStore* _tmp0_;
	g_return_if_fail (self != NULL);
	objects_section_set_is_archived (self, FALSE);
	_tmp0_ = services_store_instance ();
	services_store_archive_section (_tmp0_, self);
}

gboolean
objects_section_was_archived (ObjectsSection* self)
{
	ObjectsProject* _tmp0_;
	ObjectsProject* _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_;
	gboolean _tmp4_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = objects_section_get_project (self);
	_tmp1_ = _tmp0_;
	_tmp2_ = objects_project_get_is_archived (_tmp1_);
	_tmp3_ = _tmp2_;
	if (_tmp3_) {
		result = TRUE;
		return result;
	}
	_tmp4_ = self->priv->_is_archived;
	result = _tmp4_;
	return result;
}

gchar*
objects_section_to_vtodo (ObjectsSection* self)
{
	ICalComponent* ical = NULL;
	ICalComponent* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	ICalTimezone* _tmp3_;
	ICalTime* _tmp4_;
	ICalTime* _tmp5_;
	const gchar* _tmp6_;
	const gchar* _tmp7_;
	const gchar* _tmp8_;
	gchar* _tmp9_;
	gchar* _tmp10_;
	gchar* _tmp11_;
	gchar* _tmp12_;
	gchar* _tmp13_;
	gchar* _tmp14_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = i_cal_component_new_vtodo ();
	ical = _tmp0_;
	_tmp1_ = objects_base_object_get_id ((ObjectsBaseObject*) self);
	_tmp2_ = _tmp1_;
	i_cal_component_set_uid (ical, _tmp2_);
	_tmp3_ = i_cal_timezone_get_utc_timezone ();
	_tmp4_ = i_cal_time_new_current_with_zone (_tmp3_);
	_tmp5_ = _tmp4_;
	i_cal_component_set_dtstamp (ical, _tmp5_);
	_g_object_unref0 (_tmp5_);
	_tmp6_ = objects_section_CALDAV_PREFIX;
	_tmp7_ = objects_base_object_get_name ((ObjectsBaseObject*) self);
	_tmp8_ = _tmp7_;
	_tmp9_ = g_strconcat (_tmp6_, _tmp8_, NULL);
	_tmp10_ = _tmp9_;
	i_cal_component_set_summary (ical, _tmp10_);
	_g_free0 (_tmp10_);
	i_cal_component_set_status (ical, I_CAL_STATUS_NEEDSACTION);
	_tmp11_ = i_cal_component_as_ical_string (ical);
	_tmp12_ = _tmp11_;
	_tmp13_ = g_strdup_printf ("%s%s%s", "BEGIN:VCALENDAR\n" \
"VERSION:2.0\n" \
"PRODID:-//Planify App (https://github.com/alainm23/planify)\n", _tmp12_, "END:VCALENDAR\n");
	_tmp14_ = _tmp13_;
	_g_free0 (_tmp12_);
	result = _tmp14_;
	_g_object_unref0 (ical);
	return result;
}

static glong
string_strnlen (gchar* str,
                glong maxlen)
{
	gchar* end = NULL;
	gchar* _tmp0_;
	gchar* _tmp1_;
	glong result;
	_tmp0_ = memchr (str, 0, (gsize) maxlen);
	end = _tmp0_;
	_tmp1_ = end;
	if (_tmp1_ == NULL) {
		result = maxlen;
		return result;
	} else {
		gchar* _tmp2_;
		_tmp2_ = end;
		result = (glong) (_tmp2_ - str);
		return result;
	}
}

static gchar*
string_substring (const gchar* self,
                  glong offset,
                  glong len)
{
	glong string_length = 0L;
	gboolean _tmp0_ = FALSE;
	gchar* _tmp3_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	if (offset >= ((glong) 0)) {
		_tmp0_ = len >= ((glong) 0);
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		string_length = string_strnlen ((gchar*) self, offset + len);
	} else {
		gint _tmp1_;
		gint _tmp2_;
		_tmp1_ = strlen (self);
		_tmp2_ = _tmp1_;
		string_length = (glong) _tmp2_;
	}
	if (offset < ((glong) 0)) {
		offset = string_length + offset;
		g_return_val_if_fail (offset >= ((glong) 0), NULL);
	} else {
		g_return_val_if_fail (offset <= string_length, NULL);
	}
	if (len < ((glong) 0)) {
		len = string_length - offset;
	}
	g_return_val_if_fail ((offset + len) <= string_length, NULL);
	_tmp3_ = g_strndup (((gchar*) self) + offset, (gsize) len);
	result = _tmp3_;
	return result;
}

static gchar*
string_strip (const gchar* self)
{
	gchar* _result_ = NULL;
	gchar* _tmp0_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = g_strdup (self);
	_result_ = _tmp0_;
	g_strstrip (_result_);
	result = _result_;
	return result;
}

void
objects_section_patch_from_vtodo (ObjectsSection* self,
                                  const gchar* data,
                                  const gchar* _ical_url)
{
	ICalComponent* ical = NULL;
	ICalComponent* _tmp0_;
	ICalComponent* _tmp1_;
	const gchar* _tmp2_;
	gchar* summary = NULL;
	ICalComponent* _tmp3_;
	const gchar* _tmp4_;
	gchar* _tmp5_;
	gboolean _tmp6_ = FALSE;
	const gchar* _tmp7_;
	ICalComponent* _tmp20_;
	gchar* _tmp21_;
	gchar* _tmp22_;
	gchar* _tmp23_;
	gchar* _tmp24_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (data != NULL);
	g_return_if_fail (_ical_url != NULL);
	_tmp0_ = i_cal_parser_parse_string (data);
	ical = _tmp0_;
	_tmp1_ = ical;
	_tmp2_ = i_cal_component_get_uid (_tmp1_);
	objects_base_object_set_id ((ObjectsBaseObject*) self, _tmp2_);
	_tmp3_ = ical;
	_tmp4_ = i_cal_component_get_summary (_tmp3_);
	_tmp5_ = g_strdup (_tmp4_);
	summary = _tmp5_;
	_tmp7_ = summary;
	if (_tmp7_ != NULL) {
		const gchar* _tmp8_;
		const gchar* _tmp9_;
		_tmp8_ = summary;
		_tmp9_ = objects_section_CALDAV_PREFIX;
		_tmp6_ = g_str_has_prefix (_tmp8_, _tmp9_);
	} else {
		_tmp6_ = FALSE;
	}
	if (_tmp6_) {
		const gchar* _tmp10_;
		const gchar* _tmp11_;
		gint _tmp12_;
		gint _tmp13_;
		gchar* _tmp14_;
		gchar* _tmp15_;
		gchar* _tmp16_;
		gchar* _tmp17_;
		_tmp10_ = summary;
		_tmp11_ = objects_section_CALDAV_PREFIX;
		_tmp12_ = strlen (_tmp11_);
		_tmp13_ = _tmp12_;
		_tmp14_ = string_substring (_tmp10_, (glong) _tmp13_, (glong) -1);
		_tmp15_ = _tmp14_;
		_tmp16_ = string_strip (_tmp15_);
		_tmp17_ = _tmp16_;
		objects_base_object_set_name ((ObjectsBaseObject*) self, _tmp17_);
		_g_free0 (_tmp17_);
		_g_free0 (_tmp15_);
	} else {
		const gchar* _tmp18_ = NULL;
		const gchar* _tmp19_;
		_tmp19_ = summary;
		_tmp18_ = _tmp19_;
		if (_tmp18_ == NULL) {
			_tmp18_ = "";
		}
		objects_base_object_set_name ((ObjectsBaseObject*) self, _tmp18_);
	}
	_tmp20_ = ical;
	_tmp21_ = i_cal_component_as_ical_string (_tmp20_);
	_tmp22_ = _tmp21_;
	_tmp23_ = util_generate_extra_data (_ical_url, "", _tmp22_);
	_tmp24_ = _tmp23_;
	objects_section_set_extra_data (self, _tmp24_);
	_g_free0 (_tmp24_);
	_g_free0 (_tmp22_);
	_g_free0 (summary);
	_g_object_unref0 (ical);
}

gboolean
objects_section_is_vtodo_section (const gchar* summary)
{
	gboolean _tmp0_ = FALSE;
	gboolean result;
	g_return_val_if_fail (summary != NULL, FALSE);
	if (summary != NULL) {
		const gchar* _tmp1_;
		_tmp1_ = objects_section_CALDAV_PREFIX;
		_tmp0_ = g_str_has_prefix (summary, _tmp1_);
	} else {
		_tmp0_ = FALSE;
	}
	result = _tmp0_;
	return result;
}

static void
_objects_section_delete_caldav_section_data_free (gpointer _data)
{
	ObjectsSectionDeleteCaldavSectionData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->caldav_client);
	_g_object_unref0 (_data_->self);
	g_slice_free (ObjectsSectionDeleteCaldavSectionData, _data_);
}

static void
_objects_section_delete_caldav_section (ObjectsSection* self,
                                        ServicesCalDAVCalDAVClient* caldav_client,
                                        GAsyncReadyCallback _callback_,
                                        gpointer _user_data_)
{
	ObjectsSectionDeleteCaldavSectionData* _data_;
	ObjectsSection* _tmp0_;
	ServicesCalDAVCalDAVClient* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (caldav_client != NULL);
	_data_ = g_slice_new0 (ObjectsSectionDeleteCaldavSectionData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, _objects_section_delete_caldav_section_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (caldav_client);
	_g_object_unref0 (_data_->caldav_client);
	_data_->caldav_client = _tmp1_;
	_objects_section_delete_caldav_section_co (_data_);
}

static void
_objects_section_delete_caldav_section_finish (ObjectsSection* self,
                                               GAsyncResult* _res_)
{
	ObjectsSectionDeleteCaldavSectionData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
_objects_section_delete_caldav_section_ready (GObject* source_object,
                                              GAsyncResult* _res_,
                                              gpointer _user_data_)
{
	ObjectsSectionDeleteCaldavSectionData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	_objects_section_delete_caldav_section_co (_data_);
}

static gboolean
_objects_section_delete_caldav_section_co (ObjectsSectionDeleteCaldavSectionData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	objects_base_object_set_loading ((ObjectsBaseObject*) _data_->self, TRUE);
	{
		{
			_data_->_tmp0_ = objects_section_get_items (_data_->self);
			_data_->_tmp1_ = _data_->_tmp0_;
			_data_->_item_list = _data_->_tmp1_;
			_data_->_tmp2_ = _data_->_item_list;
			_data_->_tmp3_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _data_->_tmp2_);
			_data_->_tmp4_ = _data_->_tmp3_;
			_data_->_item_size = _data_->_tmp4_;
			_data_->_item_index = -1;
			while (TRUE) {
				_data_->_item_index = _data_->_item_index + 1;
				_data_->_tmp5_ = _data_->_item_index;
				_data_->_tmp6_ = _data_->_item_size;
				if (!(_data_->_tmp5_ < _data_->_tmp6_)) {
					break;
				}
				_data_->_tmp7_ = _data_->_item_list;
				_data_->_tmp8_ = gee_abstract_list_get ((GeeAbstractList*) _data_->_tmp7_, _data_->_item_index);
				_data_->item = (ObjectsItem*) _data_->_tmp8_;
				_data_->_tmp9_ = _data_->item;
				_data_->_state_ = 1;
				objects_section_delete_item_caldav_recursive (_data_->self, _data_->_tmp9_, _data_->caldav_client, _objects_section_delete_caldav_section_ready, _data_);
				return FALSE;
				_state_1:
				objects_section_delete_item_caldav_recursive_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
				if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
					_g_object_unref0 (_data_->item);
					goto __catch0_g_error;
				}
				_g_object_unref0 (_data_->item);
			}
		}
		_data_->_state_ = 2;
		services_cal_dav_cal_dav_client_delete_section (_data_->caldav_client, _data_->self, _objects_section_delete_caldav_section_ready, _data_);
		return FALSE;
		_state_2:
		_data_->_tmp10_ = services_cal_dav_cal_dav_client_delete_section_finish (_data_->caldav_client, _data_->_res_);
		_data_->caldav_response = _data_->_tmp10_;
		_data_->_tmp11_ = _data_->caldav_response;
		_data_->_tmp12_ = http_response_get_status (_data_->_tmp11_);
		_data_->_tmp13_ = _data_->_tmp12_;
		if (_data_->_tmp13_) {
			_data_->_tmp14_ = services_store_instance ();
			services_store_delete_section (_data_->_tmp14_, _data_->self);
		} else {
			_data_->_tmp15_ = services_event_bus_get_default ();
			_data_->_tmp16_ = _data_->_tmp15_;
			_data_->_tmp17_ = _data_->caldav_response;
			_data_->_tmp18_ = http_response_get_error_code (_data_->_tmp17_);
			_data_->_tmp19_ = _data_->_tmp18_;
			_data_->_tmp20_ = _data_->caldav_response;
			_data_->_tmp21_ = http_response_get_error (_data_->_tmp20_);
			_data_->_tmp22_ = _data_->_tmp21_;
			g_signal_emit_by_name (_data_->_tmp16_, "send-error-toast", _data_->_tmp19_, _data_->_tmp22_);
			_g_object_unref0 (_data_->_tmp16_);
		}
		_http_response_unref0 (_data_->caldav_response);
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->e = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp23_ = services_event_bus_get_default ();
		_data_->_tmp24_ = _data_->_tmp23_;
		_data_->_tmp25_ = _data_->e;
		_data_->_tmp26_ = _data_->_tmp25_->message;
		g_signal_emit_by_name (_data_->_tmp24_, "send-error-toast", 0, _data_->_tmp26_);
		_g_object_unref0 (_data_->_tmp24_);
		_g_error_free0 (_data_->e);
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
		g_clear_error (&_data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	objects_base_object_set_loading ((ObjectsBaseObject*) _data_->self, FALSE);
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
objects_section_delete_item_caldav_recursive_data_free (gpointer _data)
{
	ObjectsSectionDeleteItemCaldavRecursiveData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->item);
	_g_object_unref0 (_data_->caldav_client);
	_g_object_unref0 (_data_->self);
	g_slice_free (ObjectsSectionDeleteItemCaldavRecursiveData, _data_);
}

static void
objects_section_delete_item_caldav_recursive (ObjectsSection* self,
                                              ObjectsItem* item,
                                              ServicesCalDAVCalDAVClient* caldav_client,
                                              GAsyncReadyCallback _callback_,
                                              gpointer _user_data_)
{
	ObjectsSectionDeleteItemCaldavRecursiveData* _data_;
	ObjectsSection* _tmp0_;
	ObjectsItem* _tmp1_;
	ServicesCalDAVCalDAVClient* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (item != NULL);
	g_return_if_fail (caldav_client != NULL);
	_data_ = g_slice_new0 (ObjectsSectionDeleteItemCaldavRecursiveData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, objects_section_delete_item_caldav_recursive_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (item);
	_g_object_unref0 (_data_->item);
	_data_->item = _tmp1_;
	_tmp2_ = _g_object_ref0 (caldav_client);
	_g_object_unref0 (_data_->caldav_client);
	_data_->caldav_client = _tmp2_;
	objects_section_delete_item_caldav_recursive_co (_data_);
}

static void
objects_section_delete_item_caldav_recursive_finish (ObjectsSection* self,
                                                     GAsyncResult* _res_,
                                                     GError** error)
{
	ObjectsSectionDeleteItemCaldavRecursiveData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static void
objects_section_delete_item_caldav_recursive_ready (GObject* source_object,
                                                    GAsyncResult* _res_,
                                                    gpointer _user_data_)
{
	ObjectsSectionDeleteItemCaldavRecursiveData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	objects_section_delete_item_caldav_recursive_co (_data_);
}

static gboolean
objects_section_delete_item_caldav_recursive_co (ObjectsSectionDeleteItemCaldavRecursiveData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	{
		_data_->_tmp0_ = services_store_instance ();
		_data_->_tmp1_ = services_store_get_subitems (_data_->_tmp0_, _data_->item);
		_data_->_subitem_list = _data_->_tmp1_;
		_data_->_tmp2_ = _data_->_subitem_list;
		_data_->_tmp3_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _data_->_tmp2_);
		_data_->_tmp4_ = _data_->_tmp3_;
		_data_->_subitem_size = _data_->_tmp4_;
		_data_->_subitem_index = -1;
		while (TRUE) {
			_data_->_subitem_index = _data_->_subitem_index + 1;
			_data_->_tmp5_ = _data_->_subitem_index;
			_data_->_tmp6_ = _data_->_subitem_size;
			if (!(_data_->_tmp5_ < _data_->_tmp6_)) {
				break;
			}
			_data_->_tmp7_ = _data_->_subitem_list;
			_data_->_tmp8_ = gee_abstract_list_get ((GeeAbstractList*) _data_->_tmp7_, _data_->_subitem_index);
			_data_->subitem = (ObjectsItem*) _data_->_tmp8_;
			_data_->_tmp9_ = _data_->subitem;
			_data_->_state_ = 1;
			objects_section_delete_item_caldav_recursive (_data_->self, _data_->_tmp9_, _data_->caldav_client, objects_section_delete_item_caldav_recursive_ready, _data_);
			return FALSE;
			_state_1:
			objects_section_delete_item_caldav_recursive_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
			if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
				g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
				_g_object_unref0 (_data_->subitem);
				_g_object_unref0 (_data_->_subitem_list);
				g_object_unref (_data_->_async_result);
				return FALSE;
			}
			_g_object_unref0 (_data_->subitem);
		}
		_g_object_unref0 (_data_->_subitem_list);
	}
	_data_->_state_ = 2;
	services_cal_dav_cal_dav_client_delete_item (_data_->caldav_client, _data_->item, objects_section_delete_item_caldav_recursive_ready, _data_);
	return FALSE;
	_state_2:
	_data_->_tmp10_ = services_cal_dav_cal_dav_client_delete_item_finish (_data_->caldav_client, _data_->_res_);
	_data_->_tmp11_ = _data_->_tmp10_;
	_http_response_unref0 (_data_->_tmp11_);
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

ObjectsSection*
objects_section_construct (GType object_type)
{
	ObjectsSection * self = NULL;
	self = (ObjectsSection*) objects_base_object_construct (object_type);
	return self;
}

ObjectsSection*
objects_section_new (void)
{
	return objects_section_construct (OBJECTS_TYPE_SECTION);
}

const gchar*
objects_section_get_project_id (ObjectsSection* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_project_id;
	result = _tmp0_;
	return result;
}

void
objects_section_set_project_id (ObjectsSection* self,
                                const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = objects_section_get_project_id (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_project_id);
		self->priv->_project_id = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, objects_section_properties[OBJECTS_SECTION_PROJECT_ID_PROPERTY]);
	}
}

const gchar*
objects_section_get_archived_at (ObjectsSection* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_archived_at;
	result = _tmp0_;
	return result;
}

void
objects_section_set_archived_at (ObjectsSection* self,
                                 const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = objects_section_get_archived_at (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_archived_at);
		self->priv->_archived_at = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, objects_section_properties[OBJECTS_SECTION_ARCHIVED_AT_PROPERTY]);
	}
}

const gchar*
objects_section_get_added_at (ObjectsSection* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_added_at;
	result = _tmp0_;
	return result;
}

void
objects_section_set_added_at (ObjectsSection* self,
                              const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = objects_section_get_added_at (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_added_at);
		self->priv->_added_at = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, objects_section_properties[OBJECTS_SECTION_ADDED_AT_PROPERTY]);
	}
}

gint
objects_section_get_section_order (ObjectsSection* self)
{
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	result = self->priv->_section_order;
	return result;
}

void
objects_section_set_section_order (ObjectsSection* self,
                                   gint value)
{
	gint old_value;
	g_return_if_fail (self != NULL);
	old_value = objects_section_get_section_order (self);
	if (old_value != value) {
		self->priv->_section_order = value;
		g_object_notify_by_pspec ((GObject *) self, objects_section_properties[OBJECTS_SECTION_SECTION_ORDER_PROPERTY]);
	}
}

gboolean
objects_section_get_collapsed (ObjectsSection* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_collapsed;
	return result;
}

void
objects_section_set_collapsed (ObjectsSection* self,
                               gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = objects_section_get_collapsed (self);
	if (old_value != value) {
		self->priv->_collapsed = value;
		g_object_notify_by_pspec ((GObject *) self, objects_section_properties[OBJECTS_SECTION_COLLAPSED_PROPERTY]);
	}
}

gboolean
objects_section_get_is_deleted (ObjectsSection* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_is_deleted;
	return result;
}

void
objects_section_set_is_deleted (ObjectsSection* self,
                                gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = objects_section_get_is_deleted (self);
	if (old_value != value) {
		self->priv->_is_deleted = value;
		g_object_notify_by_pspec ((GObject *) self, objects_section_properties[OBJECTS_SECTION_IS_DELETED_PROPERTY]);
	}
}

gboolean
objects_section_get_is_archived (ObjectsSection* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_is_archived;
	return result;
}

void
objects_section_set_is_archived (ObjectsSection* self,
                                 gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = objects_section_get_is_archived (self);
	if (old_value != value) {
		self->priv->_is_archived = value;
		g_object_notify_by_pspec ((GObject *) self, objects_section_properties[OBJECTS_SECTION_IS_ARCHIVED_PROPERTY]);
	}
}

const gchar*
objects_section_get_description (ObjectsSection* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_description;
	result = _tmp0_;
	return result;
}

void
objects_section_set_description (ObjectsSection* self,
                                 const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = objects_section_get_description (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_description);
		self->priv->_description = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, objects_section_properties[OBJECTS_SECTION_DESCRIPTION_PROPERTY]);
	}
}

gboolean
objects_section_get_hidded (ObjectsSection* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_hidded;
	return result;
}

void
objects_section_set_hidded (ObjectsSection* self,
                            gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = objects_section_get_hidded (self);
	if (old_value != value) {
		self->priv->_hidded = value;
		g_object_notify_by_pspec ((GObject *) self, objects_section_properties[OBJECTS_SECTION_HIDDED_PROPERTY]);
	}
}

const gchar*
objects_section_get_extra_data (ObjectsSection* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_extra_data;
	result = _tmp0_;
	return result;
}

void
objects_section_set_extra_data (ObjectsSection* self,
                                const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = objects_section_get_extra_data (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_extra_data);
		self->priv->_extra_data = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, objects_section_properties[OBJECTS_SECTION_EXTRA_DATA_PROPERTY]);
	}
}

const gchar*
objects_section_get_ical_url (ObjectsSection* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	const gchar* _tmp2_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_extra_data;
	_tmp1_ = utils_json_utils_get_string (_tmp0_, "ical_url");
	_g_free0 (self->priv->_ical_url);
	self->priv->_ical_url = _tmp1_;
	_tmp2_ = self->priv->_ical_url;
	result = _tmp2_;
	return result;
}

const gchar*
objects_section_get_etag (ObjectsSection* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	const gchar* _tmp2_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_extra_data;
	_tmp1_ = utils_json_utils_get_string (_tmp0_, "etag");
	_g_free0 (self->priv->_etag);
	self->priv->_etag = _tmp1_;
	_tmp2_ = self->priv->_etag;
	result = _tmp2_;
	return result;
}

gboolean
objects_section_get_is_caldav_section (ObjectsSection* self)
{
	gboolean result;
	gboolean _tmp0_ = FALSE;
	ObjectsProject* _tmp1_;
	ObjectsProject* _tmp2_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp1_ = objects_section_get_project (self);
	_tmp2_ = _tmp1_;
	if (_tmp2_ != NULL) {
		ObjectsProject* _tmp3_;
		ObjectsProject* _tmp4_;
		SourceType _tmp5_;
		SourceType _tmp6_;
		_tmp3_ = objects_section_get_project (self);
		_tmp4_ = _tmp3_;
		_tmp5_ = objects_project_get_source_type (_tmp4_);
		_tmp6_ = _tmp5_;
		_tmp0_ = _tmp6_ == SOURCE_TYPE_CALDAV;
	} else {
		_tmp0_ = FALSE;
	}
	result = _tmp0_;
	return result;
}

gboolean
objects_section_get_activate_name_editable (ObjectsSection* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_activate_name_editable;
	return result;
}

void
objects_section_set_activate_name_editable (ObjectsSection* self,
                                            gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = objects_section_get_activate_name_editable (self);
	if (old_value != value) {
		self->priv->_activate_name_editable = value;
		g_object_notify_by_pspec ((GObject *) self, objects_section_properties[OBJECTS_SECTION_ACTIVATE_NAME_EDITABLE_PROPERTY]);
	}
}

const gchar*
objects_section_get_short_name (ObjectsSection* self)
{
	const gchar* result;
	Util* _tmp0_;
	Util* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	gchar* _tmp4_;
	const gchar* _tmp5_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = util_get_default ();
	_tmp1_ = _tmp0_;
	_tmp2_ = objects_base_object_get_name ((ObjectsBaseObject*) self);
	_tmp3_ = _tmp2_;
	_tmp4_ = util_get_short_name (_tmp1_, _tmp3_, CONSTANTS_SHORT_NAME_SIZE);
	_g_free0 (self->priv->_short_name);
	self->priv->_short_name = _tmp4_;
	_g_object_unref0 (_tmp1_);
	_tmp5_ = self->priv->_short_name;
	result = _tmp5_;
	return result;
}

ObjectsProject*
objects_section_get_project (ObjectsSection* self)
{
	ObjectsProject* result;
	ServicesStore* _tmp0_;
	const gchar* _tmp1_;
	ObjectsProject* _tmp2_;
	ObjectsProject* _tmp3_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = services_store_instance ();
	_tmp1_ = self->priv->_project_id;
	_tmp2_ = services_store_get_project (_tmp0_, _tmp1_);
	_g_object_unref0 (self->priv->_project);
	self->priv->_project = _tmp2_;
	_tmp3_ = self->priv->_project;
	result = _tmp3_;
	return result;
}

static gint
_objects_section_items___lambda26_ (ObjectsSection* self,
                                    ObjectsItem* a,
                                    ObjectsItem* b)
{
	gint _tmp0_;
	gint _tmp1_;
	gint _tmp2_;
	gint _tmp3_;
	gint _tmp4_;
	gint _tmp5_;
	gint _tmp6_;
	gint _tmp7_;
	gint result;
	g_return_val_if_fail (a != NULL, -1);
	g_return_val_if_fail (b != NULL, -1);
	_tmp0_ = objects_item_get_child_order (a);
	_tmp1_ = _tmp0_;
	_tmp2_ = objects_item_get_child_order (b);
	_tmp3_ = _tmp2_;
	if (_tmp1_ > _tmp3_) {
		result = 1;
		return result;
	}
	_tmp4_ = objects_item_get_child_order (a);
	_tmp5_ = _tmp4_;
	_tmp6_ = objects_item_get_child_order (b);
	_tmp7_ = _tmp6_;
	if (_tmp5_ == _tmp7_) {
		result = 0;
		return result;
	}
	result = -1;
	return result;
}

static gint
__objects_section_items___lambda26__gcompare_data_func (gconstpointer a,
                                                        gconstpointer b,
                                                        gpointer self)
{
	gint result;
	result = _objects_section_items___lambda26_ ((ObjectsSection*) self, (ObjectsItem*) a, (ObjectsItem*) b);
	return result;
}

GeeArrayList*
objects_section_get_items (ObjectsSection* self)
{
	GeeArrayList* result;
	ServicesStore* _tmp0_;
	GeeArrayList* _tmp1_;
	GeeArrayList* _tmp2_;
	GeeArrayList* _tmp3_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = services_store_instance ();
	_tmp1_ = services_store_get_items_by_baseobject (_tmp0_, (ObjectsBaseObject*) self);
	_g_object_unref0 (self->priv->_items);
	self->priv->_items = _tmp1_;
	_tmp2_ = self->priv->_items;
	gee_list_sort ((GeeList*) _tmp2_, __objects_section_items___lambda26__gcompare_data_func, g_object_ref (self), g_object_unref);
	_tmp3_ = self->priv->_items;
	result = _tmp3_;
	return result;
}

gint
objects_section_get_section_count (ObjectsSection* self)
{
	gint result;
	gint* _tmp0_;
	gint* _tmp3_;
	g_return_val_if_fail (self != NULL, -1);
	_tmp0_ = self->priv->_section_count;
	if (_tmp0_ == NULL) {
		gint _tmp1_;
		gint* _tmp2_;
		_tmp1_ = objects_section_update_section_count (self);
		_tmp2_ = __int_dup0 (&_tmp1_);
		_g_free0 (self->priv->_section_count);
		self->priv->_section_count = _tmp2_;
	}
	_tmp3_ = self->priv->_section_count;
	result = *_tmp3_;
	return result;
}

void
objects_section_set_section_count (ObjectsSection* self,
                                   gint value)
{
	gint* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = __int_dup0 (&value);
	_g_free0 (self->priv->_section_count);
	self->priv->_section_count = _tmp0_;
	g_object_notify_by_pspec ((GObject *) self, objects_section_properties[OBJECTS_SECTION_SECTION_COUNT_PROPERTY]);
}

static void
_objects_section___lambda51_ (ObjectsSection* self,
                              ObjectsItem* item)
{
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	g_return_if_fail (item != NULL);
	_tmp0_ = objects_item_get_section_id (item);
	_tmp1_ = _tmp0_;
	_tmp2_ = objects_base_object_get_id ((ObjectsBaseObject*) self);
	_tmp3_ = _tmp2_;
	if (g_strcmp0 (_tmp1_, _tmp3_) == 0) {
		objects_section_update_count (self);
	}
}

static void
__objects_section___lambda51__services_event_bus_checked_toggled (ServicesEventBus* _sender,
                                                                  ObjectsItem* item,
                                                                  gboolean old_checked,
                                                                  gpointer self)
{
	_objects_section___lambda51_ ((ObjectsSection*) self, item);
}

static void
_objects_section___lambda52_ (ObjectsSection* self,
                              ObjectsItem* item)
{
	g_return_if_fail (item != NULL);
	objects_section_update_count (self);
}

static void
__objects_section___lambda52__objects_section_item_deleted (ObjectsSection* _sender,
                                                            ObjectsItem* item,
                                                            gpointer self)
{
	_objects_section___lambda52_ ((ObjectsSection*) self, item);
}

static void
_objects_section___lambda53_ (ObjectsSection* self,
                              ObjectsItem* item)
{
	g_return_if_fail (item != NULL);
	objects_section_update_count (self);
}

static void
__objects_section___lambda53__objects_section_item_added (ObjectsSection* _sender,
                                                          ObjectsItem* item,
                                                          gpointer self)
{
	_objects_section___lambda53_ ((ObjectsSection*) self, item);
}

static void
_objects_section___lambda54_ (ObjectsSection* self,
                              ObjectsItem* item,
                              const gchar* old_project_id,
                              const gchar* old_section_id)
{
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	g_return_if_fail (item != NULL);
	g_return_if_fail (old_project_id != NULL);
	g_return_if_fail (old_section_id != NULL);
	_tmp0_ = objects_item_get_project_id (item);
	_tmp1_ = _tmp0_;
	_tmp2_ = self->priv->_project_id;
	if (g_strcmp0 (_tmp1_, _tmp2_) == 0) {
		objects_section_update_count (self);
	}
}

static void
__objects_section___lambda54__services_event_bus_item_moved (ServicesEventBus* _sender,
                                                             ObjectsItem* item,
                                                             const gchar* old_project_id,
                                                             const gchar* old_section_id,
                                                             const gchar* old_parent_id,
                                                             gpointer self)
{
	_objects_section___lambda54_ ((ObjectsSection*) self, item, old_project_id, old_section_id);
}

static void
_objects_section___lambda55_ (ObjectsSection* self,
                              ObjectsItem* item)
{
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	g_return_if_fail (item != NULL);
	_tmp0_ = objects_item_get_project_id (item);
	_tmp1_ = _tmp0_;
	_tmp2_ = self->priv->_project_id;
	if (g_strcmp0 (_tmp1_, _tmp2_) == 0) {
		objects_section_update_count (self);
	}
}

static void
__objects_section___lambda55__services_store_item_deleted (ServicesStore* _sender,
                                                           ObjectsItem* item,
                                                           gpointer self)
{
	_objects_section___lambda55_ ((ObjectsSection*) self, item);
}

static void
_objects_section___lambda56_ (ObjectsSection* self,
                              ObjectsItem* item)
{
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	g_return_if_fail (item != NULL);
	_tmp0_ = objects_item_get_project_id (item);
	_tmp1_ = _tmp0_;
	_tmp2_ = self->priv->_project_id;
	if (g_strcmp0 (_tmp1_, _tmp2_) == 0) {
		objects_section_update_count (self);
	}
}

static void
__objects_section___lambda56__services_store_item_added (ServicesStore* _sender,
                                                         ObjectsItem* item,
                                                         gboolean insert,
                                                         gpointer self)
{
	_objects_section___lambda56_ ((ObjectsSection*) self, item);
}

static void
_objects_section___lambda57_ (ObjectsSection* self,
                              ObjectsItem* item,
                              const gchar* old_project_id,
                              const gchar* old_section_id,
                              const gchar* old_parent_id)
{
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	g_return_if_fail (item != NULL);
	g_return_if_fail (old_project_id != NULL);
	g_return_if_fail (old_section_id != NULL);
	g_return_if_fail (old_parent_id != NULL);
	_tmp0_ = objects_item_get_project_id (item);
	_tmp1_ = _tmp0_;
	_tmp2_ = self->priv->_project_id;
	if (g_strcmp0 (_tmp1_, _tmp2_) == 0) {
		objects_section_update_count (self);
	}
}

static void
__objects_section___lambda57__services_store_item_moved (ServicesStore* _sender,
                                                         ObjectsItem* item,
                                                         const gchar* old_project_id,
                                                         const gchar* old_section_id,
                                                         const gchar* old_parent_id,
                                                         gpointer self)
{
	_objects_section___lambda57_ ((ObjectsSection*) self, item, old_project_id, old_section_id, old_parent_id);
}

static GObject *
objects_section_constructor (GType type,
                             guint n_construct_properties,
                             GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	ObjectsSection * self;
	ServicesEventBus* _tmp0_;
	ServicesEventBus* _tmp1_;
	ServicesEventBus* _tmp2_;
	ServicesEventBus* _tmp3_;
	ServicesStore* _tmp4_;
	ServicesStore* _tmp5_;
	ServicesStore* _tmp6_;
	parent_class = G_OBJECT_CLASS (objects_section_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, OBJECTS_TYPE_SECTION, ObjectsSection);
	_tmp0_ = services_event_bus_get_default ();
	_tmp1_ = _tmp0_;
	g_signal_connect_object (_tmp1_, "checked-toggled", (GCallback) __objects_section___lambda51__services_event_bus_checked_toggled, self, 0);
	_g_object_unref0 (_tmp1_);
	g_signal_connect_object (self, "item-deleted", (GCallback) __objects_section___lambda52__objects_section_item_deleted, self, 0);
	g_signal_connect_object (self, "item-added", (GCallback) __objects_section___lambda53__objects_section_item_added, self, 0);
	_tmp2_ = services_event_bus_get_default ();
	_tmp3_ = _tmp2_;
	g_signal_connect_object (_tmp3_, "item-moved", (GCallback) __objects_section___lambda54__services_event_bus_item_moved, self, 0);
	_g_object_unref0 (_tmp3_);
	_tmp4_ = services_store_instance ();
	g_signal_connect_object (_tmp4_, "item-deleted", (GCallback) __objects_section___lambda55__services_store_item_deleted, self, 0);
	_tmp5_ = services_store_instance ();
	g_signal_connect_object (_tmp5_, "item-added", (GCallback) __objects_section___lambda56__services_store_item_added, self, 0);
	_tmp6_ = services_store_instance ();
	g_signal_connect_object (_tmp6_, "item-moved", (GCallback) __objects_section___lambda57__services_store_item_moved, self, 0);
	return obj;
}

static void
objects_section_class_init (ObjectsSectionClass * klass,
                            gpointer klass_data)
{
	gchar* _tmp0_;
	objects_section_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ObjectsSection_private_offset);
	((ObjectsBaseObjectClass *) klass)->get_update_json = (gchar* (*) (ObjectsBaseObject*, const gchar*, const gchar*)) objects_section_real_get_update_json;
	((ObjectsBaseObjectClass *) klass)->get_add_json = (gchar* (*) (ObjectsBaseObject*, const gchar*, const gchar*)) objects_section_real_get_add_json;
	((ObjectsBaseObjectClass *) klass)->to_json = (gchar* (*) (ObjectsBaseObject*)) objects_section_real_to_json;
	((ObjectsBaseObjectClass *) klass)->get_move_json = (gchar* (*) (ObjectsBaseObject*, const gchar*, const gchar*)) objects_section_real_get_move_json;
	G_OBJECT_CLASS (klass)->get_property = _vala_objects_section_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_objects_section_set_property;
	G_OBJECT_CLASS (klass)->constructor = objects_section_constructor;
	G_OBJECT_CLASS (klass)->finalize = objects_section_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), OBJECTS_SECTION_PROJECT_ID_PROPERTY, objects_section_properties[OBJECTS_SECTION_PROJECT_ID_PROPERTY] = g_param_spec_string ("project-id", "project-id", "project-id", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), OBJECTS_SECTION_ARCHIVED_AT_PROPERTY, objects_section_properties[OBJECTS_SECTION_ARCHIVED_AT_PROPERTY] = g_param_spec_string ("archived-at", "archived-at", "archived-at", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), OBJECTS_SECTION_ADDED_AT_PROPERTY, objects_section_properties[OBJECTS_SECTION_ADDED_AT_PROPERTY] = g_param_spec_string ("added-at", "added-at", "added-at", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), OBJECTS_SECTION_SECTION_ORDER_PROPERTY, objects_section_properties[OBJECTS_SECTION_SECTION_ORDER_PROPERTY] = g_param_spec_int ("section-order", "section-order", "section-order", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), OBJECTS_SECTION_COLLAPSED_PROPERTY, objects_section_properties[OBJECTS_SECTION_COLLAPSED_PROPERTY] = g_param_spec_boolean ("collapsed", "collapsed", "collapsed", TRUE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), OBJECTS_SECTION_IS_DELETED_PROPERTY, objects_section_properties[OBJECTS_SECTION_IS_DELETED_PROPERTY] = g_param_spec_boolean ("is-deleted", "is-deleted", "is-deleted", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), OBJECTS_SECTION_IS_ARCHIVED_PROPERTY, objects_section_properties[OBJECTS_SECTION_IS_ARCHIVED_PROPERTY] = g_param_spec_boolean ("is-archived", "is-archived", "is-archived", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), OBJECTS_SECTION_DESCRIPTION_PROPERTY, objects_section_properties[OBJECTS_SECTION_DESCRIPTION_PROPERTY] = g_param_spec_string ("description", "description", "description", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), OBJECTS_SECTION_HIDDED_PROPERTY, objects_section_properties[OBJECTS_SECTION_HIDDED_PROPERTY] = g_param_spec_boolean ("hidded", "hidded", "hidded", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), OBJECTS_SECTION_EXTRA_DATA_PROPERTY, objects_section_properties[OBJECTS_SECTION_EXTRA_DATA_PROPERTY] = g_param_spec_string ("extra-data", "extra-data", "extra-data", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), OBJECTS_SECTION_ICAL_URL_PROPERTY, objects_section_properties[OBJECTS_SECTION_ICAL_URL_PROPERTY] = g_param_spec_string ("ical-url", "ical-url", "ical-url", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), OBJECTS_SECTION_ETAG_PROPERTY, objects_section_properties[OBJECTS_SECTION_ETAG_PROPERTY] = g_param_spec_string ("etag", "etag", "etag", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), OBJECTS_SECTION_IS_CALDAV_SECTION_PROPERTY, objects_section_properties[OBJECTS_SECTION_IS_CALDAV_SECTION_PROPERTY] = g_param_spec_boolean ("is-caldav-section", "is-caldav-section", "is-caldav-section", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), OBJECTS_SECTION_ACTIVATE_NAME_EDITABLE_PROPERTY, objects_section_properties[OBJECTS_SECTION_ACTIVATE_NAME_EDITABLE_PROPERTY] = g_param_spec_boolean ("activate-name-editable", "activate-name-editable", "activate-name-editable", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), OBJECTS_SECTION_SHORT_NAME_PROPERTY, objects_section_properties[OBJECTS_SECTION_SHORT_NAME_PROPERTY] = g_param_spec_string ("short-name", "short-name", "short-name", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), OBJECTS_SECTION_PROJECT_PROPERTY, objects_section_properties[OBJECTS_SECTION_PROJECT_PROPERTY] = g_param_spec_object ("project", "project", "project", OBJECTS_TYPE_PROJECT, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), OBJECTS_SECTION_ITEMS_PROPERTY, objects_section_properties[OBJECTS_SECTION_ITEMS_PROPERTY] = g_param_spec_object ("items", "items", "items", GEE_TYPE_ARRAY_LIST, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), OBJECTS_SECTION_SECTION_COUNT_PROPERTY, objects_section_properties[OBJECTS_SECTION_SECTION_COUNT_PROPERTY] = g_param_spec_int ("section-count", "section-count", "section-count", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	objects_section_signals[OBJECTS_SECTION_SECTION_COUNT_UPDATED_SIGNAL] = g_signal_new ("section-count-updated", OBJECTS_TYPE_SECTION, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	objects_section_signals[OBJECTS_SECTION_ITEM_ADDED_SIGNAL] = g_signal_new ("item-added", OBJECTS_TYPE_SECTION, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, OBJECTS_TYPE_ITEM);
	objects_section_signals[OBJECTS_SECTION_ITEM_DELETED_SIGNAL] = g_signal_new ("item-deleted", OBJECTS_TYPE_SECTION, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, OBJECTS_TYPE_ITEM);
	_tmp0_ = g_strdup ("List : ");
	objects_section_CALDAV_PREFIX = _tmp0_;
}

static void
objects_section_instance_init (ObjectsSection * self,
                               gpointer klass)
{
	gchar* _tmp0_;
	gchar* _tmp1_;
	GDateTime* _tmp2_;
	GDateTime* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	gchar* _tmp6_;
	gchar* _tmp7_;
	gchar* _tmp8_;
	self->priv = objects_section_get_instance_private (self);
	_tmp0_ = g_strdup ("");
	self->priv->_project_id = _tmp0_;
	_tmp1_ = g_strdup ("");
	self->priv->_archived_at = _tmp1_;
	_tmp2_ = g_date_time_new_now_local ();
	_tmp3_ = _tmp2_;
	_tmp4_ = g_date_time_to_string (_tmp3_);
	self->priv->_added_at = _tmp4_;
	_g_date_time_unref0 (_tmp3_);
	self->priv->_section_order = 0;
	self->priv->_collapsed = TRUE;
	self->priv->_is_deleted = FALSE;
	self->priv->_is_archived = FALSE;
	_tmp5_ = g_strdup ("");
	self->priv->_description = _tmp5_;
	self->priv->_hidded = FALSE;
	_tmp6_ = g_strdup ("");
	self->priv->_extra_data = _tmp6_;
	_tmp7_ = g_strdup ("");
	self->priv->_ical_url = _tmp7_;
	_tmp8_ = g_strdup ("");
	self->priv->_etag = _tmp8_;
	self->priv->_activate_name_editable = FALSE;
	g_rec_mutex_init (&self->priv->__lock__items);
	self->priv->_section_count = NULL;
}

static void
objects_section_finalize (GObject * obj)
{
	ObjectsSection * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, OBJECTS_TYPE_SECTION, ObjectsSection);
	_g_free0 (self->priv->_project_id);
	_g_free0 (self->priv->_archived_at);
	_g_free0 (self->priv->_added_at);
	_g_free0 (self->priv->_description);
	_g_free0 (self->priv->_extra_data);
	_g_free0 (self->priv->_ical_url);
	_g_free0 (self->priv->_etag);
	_g_free0 (self->priv->_short_name);
	_g_object_unref0 (self->priv->_project);
	g_rec_mutex_clear (&self->priv->__lock__items);
	_g_object_unref0 (self->priv->_items);
	_g_free0 (self->priv->_section_count);
	G_OBJECT_CLASS (objects_section_parent_class)->finalize (obj);
}

static GType
objects_section_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ObjectsSectionClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) objects_section_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ObjectsSection), 0, (GInstanceInitFunc) objects_section_instance_init, NULL };
	GType objects_section_type_id;
	objects_section_type_id = g_type_register_static (OBJECTS_TYPE_BASE_OBJECT, "ObjectsSection", &g_define_type_info, 0);
	ObjectsSection_private_offset = g_type_add_instance_private (objects_section_type_id, sizeof (ObjectsSectionPrivate));
	return objects_section_type_id;
}

GType
objects_section_get_type (void)
{
	static volatile gsize objects_section_type_id__once = 0;
	if (g_once_init_enter (&objects_section_type_id__once)) {
		GType objects_section_type_id;
		objects_section_type_id = objects_section_get_type_once ();
		g_once_init_leave (&objects_section_type_id__once, objects_section_type_id);
	}
	return objects_section_type_id__once;
}

static void
_vala_objects_section_get_property (GObject * object,
                                    guint property_id,
                                    GValue * value,
                                    GParamSpec * pspec)
{
	ObjectsSection * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, OBJECTS_TYPE_SECTION, ObjectsSection);
	switch (property_id) {
		case OBJECTS_SECTION_PROJECT_ID_PROPERTY:
		g_value_set_string (value, objects_section_get_project_id (self));
		break;
		case OBJECTS_SECTION_ARCHIVED_AT_PROPERTY:
		g_value_set_string (value, objects_section_get_archived_at (self));
		break;
		case OBJECTS_SECTION_ADDED_AT_PROPERTY:
		g_value_set_string (value, objects_section_get_added_at (self));
		break;
		case OBJECTS_SECTION_SECTION_ORDER_PROPERTY:
		g_value_set_int (value, objects_section_get_section_order (self));
		break;
		case OBJECTS_SECTION_COLLAPSED_PROPERTY:
		g_value_set_boolean (value, objects_section_get_collapsed (self));
		break;
		case OBJECTS_SECTION_IS_DELETED_PROPERTY:
		g_value_set_boolean (value, objects_section_get_is_deleted (self));
		break;
		case OBJECTS_SECTION_IS_ARCHIVED_PROPERTY:
		g_value_set_boolean (value, objects_section_get_is_archived (self));
		break;
		case OBJECTS_SECTION_DESCRIPTION_PROPERTY:
		g_value_set_string (value, objects_section_get_description (self));
		break;
		case OBJECTS_SECTION_HIDDED_PROPERTY:
		g_value_set_boolean (value, objects_section_get_hidded (self));
		break;
		case OBJECTS_SECTION_EXTRA_DATA_PROPERTY:
		g_value_set_string (value, objects_section_get_extra_data (self));
		break;
		case OBJECTS_SECTION_ICAL_URL_PROPERTY:
		g_value_set_string (value, objects_section_get_ical_url (self));
		break;
		case OBJECTS_SECTION_ETAG_PROPERTY:
		g_value_set_string (value, objects_section_get_etag (self));
		break;
		case OBJECTS_SECTION_IS_CALDAV_SECTION_PROPERTY:
		g_value_set_boolean (value, objects_section_get_is_caldav_section (self));
		break;
		case OBJECTS_SECTION_ACTIVATE_NAME_EDITABLE_PROPERTY:
		g_value_set_boolean (value, objects_section_get_activate_name_editable (self));
		break;
		case OBJECTS_SECTION_SHORT_NAME_PROPERTY:
		g_value_set_string (value, objects_section_get_short_name (self));
		break;
		case OBJECTS_SECTION_PROJECT_PROPERTY:
		g_value_set_object (value, objects_section_get_project (self));
		break;
		case OBJECTS_SECTION_ITEMS_PROPERTY:
		g_value_set_object (value, objects_section_get_items (self));
		break;
		case OBJECTS_SECTION_SECTION_COUNT_PROPERTY:
		g_value_set_int (value, objects_section_get_section_count (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_objects_section_set_property (GObject * object,
                                    guint property_id,
                                    const GValue * value,
                                    GParamSpec * pspec)
{
	ObjectsSection * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, OBJECTS_TYPE_SECTION, ObjectsSection);
	switch (property_id) {
		case OBJECTS_SECTION_PROJECT_ID_PROPERTY:
		objects_section_set_project_id (self, g_value_get_string (value));
		break;
		case OBJECTS_SECTION_ARCHIVED_AT_PROPERTY:
		objects_section_set_archived_at (self, g_value_get_string (value));
		break;
		case OBJECTS_SECTION_ADDED_AT_PROPERTY:
		objects_section_set_added_at (self, g_value_get_string (value));
		break;
		case OBJECTS_SECTION_SECTION_ORDER_PROPERTY:
		objects_section_set_section_order (self, g_value_get_int (value));
		break;
		case OBJECTS_SECTION_COLLAPSED_PROPERTY:
		objects_section_set_collapsed (self, g_value_get_boolean (value));
		break;
		case OBJECTS_SECTION_IS_DELETED_PROPERTY:
		objects_section_set_is_deleted (self, g_value_get_boolean (value));
		break;
		case OBJECTS_SECTION_IS_ARCHIVED_PROPERTY:
		objects_section_set_is_archived (self, g_value_get_boolean (value));
		break;
		case OBJECTS_SECTION_DESCRIPTION_PROPERTY:
		objects_section_set_description (self, g_value_get_string (value));
		break;
		case OBJECTS_SECTION_HIDDED_PROPERTY:
		objects_section_set_hidded (self, g_value_get_boolean (value));
		break;
		case OBJECTS_SECTION_EXTRA_DATA_PROPERTY:
		objects_section_set_extra_data (self, g_value_get_string (value));
		break;
		case OBJECTS_SECTION_ACTIVATE_NAME_EDITABLE_PROPERTY:
		objects_section_set_activate_name_editable (self, g_value_get_boolean (value));
		break;
		case OBJECTS_SECTION_SECTION_COUNT_PROPERTY:
		objects_section_set_section_count (self, g_value_get_int (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static inline gpointer
_vala_memdup2 (gconstpointer mem,
               gsize byte_size)
{
	gpointer new_mem;
	if (mem && byte_size != 0) {
		new_mem = g_malloc (byte_size);
		memcpy (new_mem, mem, byte_size);
	} else {
		new_mem = NULL;
	}
	return new_mem;
}

