/* Project.c generated by valac 0.56.19, the Vala compiler
 * generated from Project.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 <glib.h>
#include <stdlib.h>
#include <string.h>
#include <gee.h>
#include <glib-object.h>
#include <float.h>
#include <math.h>
#include <json-glib/json-glib.h>
#include <gxml/gxml.h>
#include <gio/gio.h>
#include <gdk/gdk.h>
#include <glib/gi18n-lib.h>
#include <adwaita.h>
#include <gtk/gtk.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_PROJECT_0_PROPERTY,
	OBJECTS_PROJECT_FREEZE_UPDATE_PROPERTY,
	OBJECTS_PROJECT_PARENT_ID_PROPERTY,
	OBJECTS_PROJECT_DUE_DATE_PROPERTY,
	OBJECTS_PROJECT_EMOJI_PROPERTY,
	OBJECTS_PROJECT_DESCRIPTION_PROPERTY,
	OBJECTS_PROJECT_ICON_STYLE_PROPERTY,
	OBJECTS_PROJECT_BACKEND_TYPE_PROPERTY,
	OBJECTS_PROJECT_INBOX_PROJECT_PROPERTY,
	OBJECTS_PROJECT_TEAM_INBOX_PROPERTY,
	OBJECTS_PROJECT_IS_DELETED_PROPERTY,
	OBJECTS_PROJECT_IS_ARCHIVED_PROPERTY,
	OBJECTS_PROJECT_IS_FAVORITE_PROPERTY,
	OBJECTS_PROJECT_SHARED_PROPERTY,
	OBJECTS_PROJECT_COLLAPSED_PROPERTY,
	OBJECTS_PROJECT_INBOX_SECTION_HIDDED_PROPERTY,
	OBJECTS_PROJECT_SYNC_ID_PROPERTY,
	OBJECTS_PROJECT_SOURCE_ID_PROPERTY,
	OBJECTS_PROJECT_CALENDAR_URL_PROPERTY,
	OBJECTS_PROJECT_CALENDAR_SOURCE_UID_PROPERTY,
	OBJECTS_PROJECT_MARKDOWN_SETTING_PROPERTY,
	OBJECTS_PROJECT_IS_MARKDOWN_ENABLED_PROPERTY,
	OBJECTS_PROJECT_SHOW_COMPLETED_PROPERTY,
	OBJECTS_PROJECT_VIEW_STYLE_PROPERTY,
	OBJECTS_PROJECT_SORTED_BY_PROPERTY,
	OBJECTS_PROJECT_SORT_ORDER_PROPERTY,
	OBJECTS_PROJECT_SOURCE_TYPE_PROPERTY,
	OBJECTS_PROJECT_SOURCE_PROPERTY,
	OBJECTS_PROJECT_COLOR_HEX_PROPERTY,
	OBJECTS_PROJECT_CHILD_ORDER_PROPERTY,
	OBJECTS_PROJECT_VIEW_ID_PROPERTY,
	OBJECTS_PROJECT_PARENT_ID_STRING_PROPERTY,
	OBJECTS_PROJECT_SHORT_NAME_PROPERTY,
	OBJECTS_PROJECT_IS_INBOX_PROJECT_PROPERTY,
	OBJECTS_PROJECT_SECTIONS_PROPERTY,
	OBJECTS_PROJECT_SECTIONS_ARCHIVED_PROPERTY,
	OBJECTS_PROJECT_ITEMS_PROPERTY,
	OBJECTS_PROJECT_ITEMS_CHECKED_PROPERTY,
	OBJECTS_PROJECT_ALL_ITEMS_PROPERTY,
	OBJECTS_PROJECT_ITEMS_PINNED_PROPERTY,
	OBJECTS_PROJECT_SUBPROJECTS_PROPERTY,
	OBJECTS_PROJECT_PARENT_PROPERTY,
	OBJECTS_PROJECT_SHOW_MULTI_SELECT_PROPERTY,
	OBJECTS_PROJECT_IS_DECK_PROPERTY,
	OBJECTS_PROJECT_NUM_PROPERTIES
};
static GParamSpec* objects_project_properties[OBJECTS_PROJECT_NUM_PROPERTIES];
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _Block57Data Block57Data;
#define _http_response_unref0(var) ((var == NULL) ? NULL : (var = (http_response_unref (var), NULL)))
typedef struct _Block58Data Block58Data;
typedef struct _Block59Data Block59Data;
#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 _Block60Data Block60Data;
enum  {
	OBJECTS_PROJECT_SECTION_ADDED_SIGNAL,
	OBJECTS_PROJECT_SUBPROJECT_ADDED_SIGNAL,
	OBJECTS_PROJECT_ITEM_ADDED_SIGNAL,
	OBJECTS_PROJECT_ITEM_DELETED_SIGNAL,
	OBJECTS_PROJECT_SHOW_COMPLETED_CHANGED_SIGNAL,
	OBJECTS_PROJECT_SORT_ORDER_CHANGED_SIGNAL,
	OBJECTS_PROJECT_SORTED_BY_CHANGED_SIGNAL,
	OBJECTS_PROJECT_SECTION_SORT_ORDER_CHANGED_SIGNAL,
	OBJECTS_PROJECT_VIEW_STYLE_CHANGED_SIGNAL,
	OBJECTS_PROJECT_SYNC_STARTED_SIGNAL,
	OBJECTS_PROJECT_SYNC_FINISHED_SIGNAL,
	OBJECTS_PROJECT_LOADING_CHANGED_SIGNAL,
	OBJECTS_PROJECT_SHOW_MULTI_SELECT_CHANGE_SIGNAL,
	OBJECTS_PROJECT_NUM_SIGNALS
};
static guint objects_project_signals[OBJECTS_PROJECT_NUM_SIGNALS] = {0};

struct _ObjectsProjectPrivate {
	gboolean _freeze_update;
	gchar* _parent_id;
	gchar* _due_date;
	gchar* _emoji;
	gchar* _description;
	ProjectIconStyle _icon_style;
	SourceType _backend_type;
	gboolean _inbox_project;
	gboolean _team_inbox;
	gboolean _is_deleted;
	gboolean _is_archived;
	gboolean _is_favorite;
	gboolean _shared;
	gboolean _collapsed;
	gboolean _inbox_section_hidded;
	gchar* _sync_id;
	gchar* _source_id;
	gchar* _calendar_url;
	gchar* _calendar_source_uid;
	MarkdownSetting _markdown_setting;
	gboolean _show_completed;
	ProjectViewStyle _view_style;
	SortedByType _sorted_by;
	SortOrderType _sort_order;
	ObjectsSource* _source;
	gchar* _color_hex;
	gint _child_order;
	gchar* _view_id;
	gchar* _parent_id_string;
	gchar* _short_name;
	GeeArrayList* _sections;
	GRecMutex __lock__sections;
	GeeArrayList* _sections_archived;
	GeeArrayList* _items;
	GRecMutex __lock__items;
	GeeArrayList* _items_checked;
	GeeArrayList* _all_items;
	GeeArrayList* _items_pinned;
	GeeArrayList* _subprojects;
	GRecMutex __lock__subprojects;
	ObjectsProject* _parent;
	gboolean _show_multi_select;
	GRecMutex __lock_subprojects;
};

struct _Block57Data {
	int _ref_count_;
	ObjectsProject* self;
	gboolean show_loading;
};

struct _Block58Data {
	int _ref_count_;
	Block57Data * _data57_;
	ServicesCalDAVCalDAVClient* caldav_client;
};

struct _Block59Data {
	int _ref_count_;
	ObjectsProject* self;
	ObjectsSection* section;
};

struct _Block60Data {
	int _ref_count_;
	ObjectsProject* self;
	ServicesCalDAVCalDAVClient* caldav_client;
};

static gint ObjectsProject_private_offset;
static gpointer objects_project_parent_class = NULL;

static Block57Data* block57_data_ref (Block57Data* _data57_);
static void block57_data_unref (void * _userdata_);
static gboolean __lambda58_ (Block57Data* _data57_);
static void ____lambda59_ (ObjectsProject* self,
                    GObject* obj,
                    GAsyncResult* res);
static void _____lambda59__gasync_ready_callback (GObject* source_object,
                                           GAsyncResult* res,
                                           gpointer self);
static Block58Data* block58_data_ref (Block58Data* _data58_);
static void block58_data_unref (void * _userdata_);
static void _____lambda60_ (Block58Data* _data58_,
                     GObject* obj,
                     GAsyncResult* res);
static void ______lambda60__gasync_ready_callback (GObject* source_object,
                                            GAsyncResult* res,
                                            gpointer self);
static gboolean ___lambda58__gsource_func (gpointer self);
static Block59Data* block59_data_ref (Block59Data* _data59_);
static void block59_data_unref (void * _userdata_);
static void __lambda8_ (Block59Data* _data59_);
static void ___lambda8__objects_base_object_deleted (ObjectsBaseObject* _sender,
                                              gpointer self);
static gchar* objects_project_real_get_add_json (ObjectsBaseObject* base,
                                          const gchar* temp_id,
                                          const gchar* uuid);
static gchar* objects_project_real_get_update_json (ObjectsBaseObject* base,
                                             const gchar* uuid,
                                             const gchar* temp_id);
static void _vala_JsonNode_free (JsonNode* self);
static gchar* objects_project_real_to_json (ObjectsBaseObject* base);
static gchar* objects_project_real_get_move_json (ObjectsBaseObject* base,
                                           const gchar* uuid,
                                           const gchar* new_parent_id);
static void objects_project_real_count_update (ObjectsBaseObject* base);
static gint* _int_dup (gint* self);
static gdouble* _double_dup (gdouble* self);
static gint objects_project_real_update_count (ObjectsBaseObject* base);
static gdouble objects_project_real_update_percentage (ObjectsBaseObject* base);
static gchar* objects_project_to_markdown (ObjectsProject* self);
static void __lambda61_ (ObjectsProject* self,
                  const gchar* response);
static void objects_project_handle_project_deletion (ObjectsProject* self);
static void ___lambda61__adw_alert_dialog_response (AdwAlertDialog* _sender,
                                             const gchar* response,
                                             gpointer self);
static void objects_project_delete_from_todoist (ObjectsProject* self);
static void objects_project_delete_from_caldav (ObjectsProject* self);
static void __lambda62_ (ObjectsProject* self,
                  GObject* obj,
                  GAsyncResult* res);
static void objects_project_handle_remote_delete_response (ObjectsProject* self,
                                                    HttpResponse* response);
static void ___lambda62__gasync_ready_callback (GObject* source_object,
                                         GAsyncResult* res,
                                         gpointer self);
static Block60Data* block60_data_ref (Block60Data* _data60_);
static void block60_data_unref (void * _userdata_);
static void __lambda63_ (Block60Data* _data60_,
                  GObject* obj,
                  GAsyncResult* res);
static void ___lambda63__gasync_ready_callback (GObject* source_object,
                                         GAsyncResult* res,
                                         gpointer self);
static void __lambda64_ (ObjectsProject* self,
                  const gchar* response);
static void ___lambda64__adw_alert_dialog_response (AdwAlertDialog* _sender,
                                             const gchar* response,
                                             gpointer self);
static gint _objects_project_items___lambda27_ (ObjectsProject* self,
                                         ObjectsItem* a,
                                         ObjectsItem* b);
static gint __objects_project_items___lambda27__gcompare_data_func (gconstpointer a,
                                                             gconstpointer b,
                                                             gpointer self);
static GObject * objects_project_constructor (GType type,
                                       guint n_construct_properties,
                                       GObjectConstructParam * construct_properties);
static void _objects_project___lambda65_ (ObjectsProject* self,
                                   ObjectsItem* item);
static void __objects_project___lambda65__services_event_bus_checked_toggled (ServicesEventBus* _sender,
                                                                       ObjectsItem* item,
                                                                       gboolean old_checked,
                                                                       gpointer self);
static void _objects_project___lambda66_ (ObjectsProject* self,
                                   ObjectsItem* item);
static void __objects_project___lambda66__services_store_item_deleted (ServicesStore* _sender,
                                                                ObjectsItem* item,
                                                                gpointer self);
static void _objects_project___lambda67_ (ObjectsProject* self,
                                   ObjectsItem* item);
static void __objects_project___lambda67__services_store_item_added (ServicesStore* _sender,
                                                              ObjectsItem* item,
                                                              gboolean insert,
                                                              gpointer self);
static void _objects_project___lambda68_ (ObjectsProject* self,
                                   ObjectsItem* item,
                                   const gchar* old_project_id);
static void __objects_project___lambda68__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_project___lambda69_ (ObjectsProject* self,
                                   ObjectsSection* section,
                                   const gchar* old_project_id);
static void __objects_project___lambda69__services_store_section_moved (ServicesStore* _sender,
                                                                 ObjectsSection* section,
                                                                 const gchar* old_project_id,
                                                                 gpointer self);
static void _objects_project___lambda70_ (ObjectsProject* self,
                                   ObjectsItem* item);
static void __objects_project___lambda70__services_store_item_archived (ServicesStore* _sender,
                                                                 ObjectsItem* item,
                                                                 gpointer self);
static void _objects_project___lambda71_ (ObjectsProject* self,
                                   ObjectsItem* item);
static void __objects_project___lambda71__services_store_item_unarchived (ServicesStore* _sender,
                                                                   ObjectsItem* item,
                                                                   gpointer self);
static void objects_project_finalize (GObject * obj);
static GType objects_project_get_type_once (void);
static void _vala_objects_project_get_property (GObject * object,
                                         guint property_id,
                                         GValue * value,
                                         GParamSpec * pspec);
static void _vala_objects_project_set_property (GObject * object,
                                         guint property_id,
                                         const GValue * value,
                                         GParamSpec * pspec);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);
static gssize _vala_array_length (gpointer array);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
objects_project_get_instance_private (ObjectsProject* self)
{
	return G_STRUCT_MEMBER_P (self, ObjectsProject_private_offset);
}

ObjectsProject*
objects_project_construct_from_json (GType object_type,
                                     JsonNode* node)
{
	ObjectsProject * self = NULL;
	JsonObject* _tmp0_;
	const gchar* _tmp1_;
	g_return_val_if_fail (node != NULL, NULL);
	self = (ObjectsProject*) 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_project_update_from_json (self, node);
	objects_project_set_backend_type (self, SOURCE_TYPE_TODOIST);
	return self;
}

ObjectsProject*
objects_project_new_from_json (JsonNode* node)
{
	return objects_project_construct_from_json (OBJECTS_TYPE_PROJECT, node);
}

ObjectsProject*
objects_project_construct_from_google_tasklist_json (GType object_type,
                                                     JsonNode* node)
{
	ObjectsProject * self = NULL;
	JsonObject* _tmp0_;
	const gchar* _tmp1_;
	g_return_val_if_fail (node != NULL, NULL);
	self = (ObjectsProject*) 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_project_update_from_google_tasklist_json (self, node);
	objects_project_set_backend_type (self, SOURCE_TYPE_GOOGLE_TASKS);
	return self;
}

ObjectsProject*
objects_project_new_from_google_tasklist_json (JsonNode* node)
{
	return objects_project_construct_from_google_tasklist_json (OBJECTS_TYPE_PROJECT, node);
}

ObjectsProject*
objects_project_construct_from_propstat (GType object_type,
                                         ServicesCalDAVWebDAVPropStat* propstat,
                                         const gchar* url)
{
	ObjectsProject * self = NULL;
	Util* _tmp0_;
	Util* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	g_return_val_if_fail (propstat != NULL, NULL);
	g_return_val_if_fail (url != NULL, NULL);
	self = (ObjectsProject*) objects_base_object_construct (object_type);
	_tmp0_ = util_get_default ();
	_tmp1_ = _tmp0_;
	_tmp2_ = util_generate_id (_tmp1_, (ObjectsBaseObject*) self);
	_tmp3_ = _tmp2_;
	objects_base_object_set_id ((ObjectsBaseObject*) self, _tmp3_);
	_g_free0 (_tmp3_);
	_g_object_unref0 (_tmp1_);
	objects_project_set_calendar_url (self, url);
	objects_project_update_from_propstat (self, propstat, TRUE);
	objects_project_set_backend_type (self, SOURCE_TYPE_CALDAV);
	return self;
}

ObjectsProject*
objects_project_new_from_propstat (ServicesCalDAVWebDAVPropStat* propstat,
                                   const gchar* url)
{
	return objects_project_construct_from_propstat (OBJECTS_TYPE_PROJECT, propstat, url);
}

void
objects_project_update_from_propstat (ObjectsProject* self,
                                      ServicesCalDAVWebDAVPropStat* propstat,
                                      gboolean update_sync_token)
{
	GXmlDomElement* _tmp0_;
	GXmlDomElement* _tmp1_;
	gboolean _tmp2_;
	GXmlDomElement* _tmp8_;
	GXmlDomElement* _tmp9_;
	gboolean _tmp10_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (propstat != NULL);
	_tmp0_ = services_cal_dav_web_dav_prop_stat_get_first_prop_with_tagname (propstat, "displayname");
	_tmp1_ = _tmp0_;
	_tmp2_ = _tmp1_ != NULL;
	_g_object_unref0 (_tmp1_);
	if (_tmp2_) {
		GXmlDomElement* _tmp3_;
		GXmlDomElement* _tmp4_;
		gchar* _tmp5_;
		gchar* _tmp6_;
		gchar* _tmp7_;
		_tmp3_ = services_cal_dav_web_dav_prop_stat_get_first_prop_with_tagname (propstat, "displayname");
		_tmp4_ = _tmp3_;
		_tmp5_ = gxml_dom_node_get_text_content ((GXmlDomNode*) _tmp4_);
		_tmp6_ = _tmp5_;
		_tmp7_ = _tmp6_;
		objects_base_object_set_name ((ObjectsBaseObject*) self, _tmp7_);
		_g_free0 (_tmp7_);
		_g_object_unref0 (_tmp4_);
	}
	_tmp8_ = services_cal_dav_web_dav_prop_stat_get_first_prop_with_tagname (propstat, "calendar-color");
	_tmp9_ = _tmp8_;
	_tmp10_ = _tmp9_ != NULL;
	_g_object_unref0 (_tmp9_);
	if (_tmp10_) {
		GXmlDomElement* _tmp11_;
		GXmlDomElement* _tmp12_;
		gchar* _tmp13_;
		gchar* _tmp14_;
		gchar* _tmp15_;
		_tmp11_ = services_cal_dav_web_dav_prop_stat_get_first_prop_with_tagname (propstat, "calendar-color");
		_tmp12_ = _tmp11_;
		_tmp13_ = gxml_dom_node_get_text_content ((GXmlDomNode*) _tmp12_);
		_tmp14_ = _tmp13_;
		_tmp15_ = _tmp14_;
		objects_base_object_set_color ((ObjectsBaseObject*) self, _tmp15_);
		_g_free0 (_tmp15_);
		_g_object_unref0 (_tmp12_);
	}
	if (update_sync_token) {
		GXmlDomElement* _tmp16_;
		GXmlDomElement* _tmp17_;
		gchar* _tmp18_;
		gchar* _tmp19_;
		gchar* _tmp20_;
		_tmp16_ = services_cal_dav_web_dav_prop_stat_get_first_prop_with_tagname (propstat, "sync-token");
		_tmp17_ = _tmp16_;
		_tmp18_ = gxml_dom_node_get_text_content ((GXmlDomNode*) _tmp17_);
		_tmp19_ = _tmp18_;
		_tmp20_ = _tmp19_;
		objects_project_set_sync_id (self, _tmp20_);
		_g_free0 (_tmp20_);
		_g_object_unref0 (_tmp17_);
	}
}

gchar*
objects_project_get_id_from_url (ObjectsProject* self,
                                 GXmlDomElement* element)
{
	GXmlDomHTMLCollection* _tmp0_;
	GXmlDomHTMLCollection* _tmp1_;
	gint _tmp2_;
	gint _tmp3_;
	gboolean _tmp4_;
	GXmlDomElement* href = NULL;
	GXmlDomHTMLCollection* _tmp6_;
	GXmlDomHTMLCollection* _tmp7_;
	GXmlDomElement* _tmp8_;
	GXmlDomElement* _tmp9_;
	gchar** parts = NULL;
	GXmlDomElement* _tmp10_;
	gchar* _tmp11_;
	gchar* _tmp12_;
	gchar* _tmp13_;
	gchar** _tmp14_;
	gchar** _tmp15_;
	gchar** _tmp16_;
	gint _tmp16__length1;
	gint parts_length1;
	gint _parts_size_;
	gchar** _tmp17_;
	gint _tmp17__length1;
	gchar** _tmp18_;
	gint _tmp18__length1;
	const gchar* _tmp19_;
	gchar* _tmp20_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (element != NULL, NULL);
	_tmp0_ = gxml_dom_element_get_elements_by_tag_name (element, "d:href");
	_tmp1_ = _tmp0_;
	_tmp2_ = gxml_dom_html_collection_get_length (_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = _tmp3_ <= 0;
	_g_object_unref0 (_tmp1_);
	if (_tmp4_) {
		gchar* _tmp5_;
		_tmp5_ = g_strdup ("");
		result = _tmp5_;
		return result;
	}
	_tmp6_ = gxml_dom_element_get_elements_by_tag_name (element, "d:href");
	_tmp7_ = _tmp6_;
	_tmp8_ = gxml_dom_html_collection_get_element (_tmp7_, 0);
	_tmp9_ = _tmp8_;
	_g_object_unref0 (_tmp7_);
	href = _tmp9_;
	_tmp10_ = href;
	_tmp11_ = gxml_dom_node_get_text_content ((GXmlDomNode*) _tmp10_);
	_tmp12_ = _tmp11_;
	_tmp13_ = _tmp12_;
	_tmp15_ = _tmp14_ = g_strsplit (_tmp13_, "/", 0);
	_tmp16_ = _tmp15_;
	_tmp16__length1 = _vala_array_length (_tmp14_);
	_g_free0 (_tmp13_);
	parts = _tmp16_;
	parts_length1 = _tmp16__length1;
	_parts_size_ = parts_length1;
	_tmp17_ = parts;
	_tmp17__length1 = parts_length1;
	_tmp18_ = parts;
	_tmp18__length1 = parts_length1;
	_tmp19_ = _tmp17_[_tmp18__length1 - 2];
	_tmp20_ = g_strdup (_tmp19_);
	result = _tmp20_;
	parts = (_vala_array_free (parts, parts_length1, (GDestroyNotify) g_free), NULL);
	_g_object_unref0 (href);
	return result;
}

gchar*
objects_project_get_content (ObjectsProject* self,
                             GXmlDomElement* element)
{
	gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (element != NULL, NULL);
	_tmp0_ = gxml_dom_node_get_text_content ((GXmlDomNode*) element);
	_tmp1_ = _tmp0_;
	result = _tmp1_;
	return result;
}

ObjectsProject*
objects_project_construct_from_import_json (GType object_type,
                                            JsonNode* node)
{
	ObjectsProject * self = NULL;
	JsonObject* _tmp0_;
	const gchar* _tmp1_;
	JsonObject* _tmp2_;
	const gchar* _tmp3_;
	JsonObject* _tmp4_;
	const gchar* _tmp5_;
	JsonObject* _tmp6_;
	const gchar* _tmp7_;
	JsonObject* _tmp8_;
	JsonObject* _tmp9_;
	JsonObject* _tmp10_;
	JsonObject* _tmp11_;
	JsonObject* _tmp12_;
	JsonObject* _tmp13_;
	JsonObject* _tmp14_;
	ProjectViewStyle _tmp15_ = 0;
	JsonObject* _tmp16_;
	const gchar* _tmp17_;
	JsonObject* _tmp18_;
	JsonObject* _tmp19_;
	const gchar* _tmp20_;
	JsonObject* _tmp21_;
	ProjectIconStyle _tmp22_ = 0;
	JsonObject* _tmp23_;
	const gchar* _tmp24_;
	JsonObject* _tmp25_;
	const gchar* _tmp26_;
	JsonObject* _tmp27_;
	JsonObject* _tmp28_;
	const gchar* _tmp29_;
	JsonObject* _tmp30_;
	const gchar* _tmp31_;
	JsonObject* _tmp32_;
	JsonObject* _tmp35_;
	JsonObject* _tmp38_;
	g_return_val_if_fail (node != NULL, NULL);
	self = (ObjectsProject*) 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_, "color");
	objects_base_object_set_color ((ObjectsBaseObject*) self, _tmp5_);
	_tmp6_ = json_node_get_object (node);
	_tmp7_ = json_object_get_string_member (_tmp6_, "backend_type");
	objects_project_set_backend_type (self, source_type_parse (_tmp7_));
	_tmp8_ = json_node_get_object (node);
	objects_project_set_inbox_project (self, json_object_get_boolean_member (_tmp8_, "inbox_project"));
	_tmp9_ = json_node_get_object (node);
	objects_project_set_team_inbox (self, json_object_get_boolean_member (_tmp9_, "team_inbox"));
	_tmp10_ = json_node_get_object (node);
	objects_project_set_child_order (self, (gint) ((gint32) json_object_get_int_member (_tmp10_, "child_order")));
	_tmp11_ = json_node_get_object (node);
	objects_project_set_is_deleted (self, json_object_get_boolean_member (_tmp11_, "is_deleted"));
	_tmp12_ = json_node_get_object (node);
	objects_project_set_is_archived (self, json_object_get_boolean_member (_tmp12_, "is_archived"));
	_tmp13_ = json_node_get_object (node);
	objects_project_set_is_favorite (self, json_object_get_boolean_member (_tmp13_, "is_favorite"));
	_tmp14_ = json_node_get_object (node);
	objects_project_set_shared (self, json_object_get_boolean_member (_tmp14_, "shared"));
	_tmp16_ = json_node_get_object (node);
	_tmp17_ = json_object_get_string_member (_tmp16_, "view_style");
	if (g_strcmp0 (_tmp17_, "board") == 0) {
		_tmp15_ = PROJECT_VIEW_STYLE_BOARD;
	} else {
		_tmp15_ = PROJECT_VIEW_STYLE_LIST;
	}
	objects_project_set_view_style (self, _tmp15_);
	_tmp18_ = json_node_get_object (node);
	objects_project_set_sort_order (self, (gint32) json_object_get_int_member (_tmp18_, "sort_order"));
	_tmp19_ = json_node_get_object (node);
	_tmp20_ = json_object_get_string_member (_tmp19_, "parent_id");
	objects_project_set_parent_id (self, _tmp20_);
	_tmp21_ = json_node_get_object (node);
	objects_project_set_collapsed (self, json_object_get_boolean_member (_tmp21_, "collapsed"));
	_tmp23_ = json_node_get_object (node);
	_tmp24_ = json_object_get_string_member (_tmp23_, "icon_style");
	if (g_strcmp0 (_tmp24_, "progress") == 0) {
		_tmp22_ = PROJECT_ICON_STYLE_PROGRESS;
	} else {
		_tmp22_ = PROJECT_ICON_STYLE_EMOJI;
	}
	objects_project_set_icon_style (self, _tmp22_);
	_tmp25_ = json_node_get_object (node);
	_tmp26_ = json_object_get_string_member (_tmp25_, "emoji");
	objects_project_set_emoji (self, _tmp26_);
	_tmp27_ = json_node_get_object (node);
	objects_project_set_show_completed (self, json_object_get_boolean_member (_tmp27_, "show_completed"));
	_tmp28_ = json_node_get_object (node);
	_tmp29_ = json_object_get_string_member (_tmp28_, "description");
	objects_project_set_description (self, _tmp29_);
	_tmp30_ = json_node_get_object (node);
	_tmp31_ = json_object_get_string_member (_tmp30_, "due_date");
	objects_project_set_due_date (self, _tmp31_);
	_tmp32_ = json_node_get_object (node);
	if (json_object_has_member (_tmp32_, "source_id")) {
		JsonObject* _tmp33_;
		const gchar* _tmp34_;
		_tmp33_ = json_node_get_object (node);
		_tmp34_ = json_object_get_string_member (_tmp33_, "source_id");
		objects_project_set_source_id (self, _tmp34_);
	}
	_tmp35_ = json_node_get_object (node);
	if (json_object_has_member (_tmp35_, "calendar_url")) {
		JsonObject* _tmp36_;
		const gchar* _tmp37_;
		_tmp36_ = json_node_get_object (node);
		_tmp37_ = json_object_get_string_member (_tmp36_, "calendar_url");
		objects_project_set_calendar_url (self, _tmp37_);
	}
	_tmp38_ = json_node_get_object (node);
	if (json_object_has_member (_tmp38_, "markdown_setting")) {
		JsonObject* _tmp39_;
		const gchar* _tmp40_;
		_tmp39_ = json_node_get_object (node);
		_tmp40_ = json_object_get_string_member (_tmp39_, "markdown_setting");
		objects_project_set_markdown_setting (self, markdown_setting_parse (_tmp40_));
	}
	return self;
}

ObjectsProject*
objects_project_new_from_import_json (JsonNode* node)
{
	return objects_project_construct_from_import_json (OBJECTS_TYPE_PROJECT, node);
}

void
objects_project_update_from_json (ObjectsProject* self,
                                  JsonNode* node)
{
	JsonObject* _tmp0_;
	const gchar* _tmp1_;
	JsonObject* _tmp2_;
	JsonObject* _tmp5_;
	JsonObject* _tmp7_;
	JsonObject* _tmp9_;
	JsonObject* _tmp11_;
	JsonObject* _tmp13_;
	gboolean _tmp16_ = FALSE;
	JsonObject* _tmp17_;
	gboolean _tmp20_ = FALSE;
	JsonObject* _tmp21_;
	JsonObject* _tmp24_;
	ProjectViewStyle _tmp25_ = 0;
	JsonObject* _tmp26_;
	const gchar* _tmp27_;
	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_, "name");
	objects_base_object_set_name ((ObjectsBaseObject*) self, _tmp1_);
	_tmp2_ = json_node_get_object (node);
	if (!json_object_get_null_member (_tmp2_, "color")) {
		JsonObject* _tmp3_;
		const gchar* _tmp4_;
		_tmp3_ = json_node_get_object (node);
		_tmp4_ = json_object_get_string_member (_tmp3_, "color");
		objects_base_object_set_color ((ObjectsBaseObject*) self, _tmp4_);
	}
	_tmp5_ = json_node_get_object (node);
	if (!json_object_get_null_member (_tmp5_, "is_deleted")) {
		JsonObject* _tmp6_;
		_tmp6_ = json_node_get_object (node);
		objects_project_set_is_deleted (self, json_object_get_boolean_member (_tmp6_, "is_deleted"));
	}
	_tmp7_ = json_node_get_object (node);
	if (!json_object_get_null_member (_tmp7_, "is_archived")) {
		JsonObject* _tmp8_;
		_tmp8_ = json_node_get_object (node);
		objects_project_set_is_archived (self, json_object_get_boolean_member (_tmp8_, "is_archived"));
	}
	_tmp9_ = json_node_get_object (node);
	if (!json_object_get_null_member (_tmp9_, "is_favorite")) {
		JsonObject* _tmp10_;
		_tmp10_ = json_node_get_object (node);
		objects_project_set_is_favorite (self, json_object_get_boolean_member (_tmp10_, "is_favorite"));
	}
	_tmp11_ = json_node_get_object (node);
	if (!json_object_get_null_member (_tmp11_, "child_order")) {
		JsonObject* _tmp12_;
		_tmp12_ = json_node_get_object (node);
		objects_project_set_child_order (self, (gint) ((gint32) json_object_get_int_member (_tmp12_, "child_order")));
	}
	_tmp13_ = json_node_get_object (node);
	if (!json_object_get_null_member (_tmp13_, "parent_id")) {
		JsonObject* _tmp14_;
		const gchar* _tmp15_;
		_tmp14_ = json_node_get_object (node);
		_tmp15_ = json_object_get_string_member (_tmp14_, "parent_id");
		objects_project_set_parent_id (self, _tmp15_);
	} else {
		objects_project_set_parent_id (self, "");
	}
	_tmp17_ = json_node_get_object (node);
	if (json_object_has_member (_tmp17_, "team_inbox")) {
		JsonObject* _tmp18_;
		_tmp18_ = json_node_get_object (node);
		_tmp16_ = !json_object_get_null_member (_tmp18_, "team_inbox");
	} else {
		_tmp16_ = FALSE;
	}
	if (_tmp16_) {
		JsonObject* _tmp19_;
		_tmp19_ = json_node_get_object (node);
		objects_project_set_team_inbox (self, json_object_get_boolean_member (_tmp19_, "team_inbox"));
	}
	_tmp21_ = json_node_get_object (node);
	if (json_object_has_member (_tmp21_, "inbox_project")) {
		JsonObject* _tmp22_;
		_tmp22_ = json_node_get_object (node);
		_tmp20_ = !json_object_get_null_member (_tmp22_, "inbox_project");
	} else {
		_tmp20_ = FALSE;
	}
	if (_tmp20_) {
		JsonObject* _tmp23_;
		_tmp23_ = json_node_get_object (node);
		objects_project_set_inbox_project (self, json_object_get_boolean_member (_tmp23_, "inbox_project"));
	}
	_tmp24_ = json_node_get_object (node);
	objects_project_set_shared (self, json_object_get_boolean_member (_tmp24_, "shared"));
	_tmp26_ = json_node_get_object (node);
	_tmp27_ = json_object_get_string_member (_tmp26_, "view_style");
	if (g_strcmp0 (_tmp27_, "board") == 0) {
		_tmp25_ = PROJECT_VIEW_STYLE_BOARD;
	} else {
		_tmp25_ = PROJECT_VIEW_STYLE_LIST;
	}
	objects_project_set_view_style (self, _tmp25_);
}

void
objects_project_update_from_google_tasklist_json (ObjectsProject* self,
                                                  JsonNode* node)
{
	JsonObject* _tmp0_;
	const gchar* _tmp1_;
	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_, "title");
	objects_base_object_set_name ((ObjectsBaseObject*) self, _tmp1_);
}

void
objects_project_update_local (ObjectsProject* self)
{
	ServicesStore* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = services_store_instance ();
	services_store_update_project (_tmp0_, self);
}

static Block57Data*
block57_data_ref (Block57Data* _data57_)
{
	g_atomic_int_inc (&_data57_->_ref_count_);
	return _data57_;
}

static void
block57_data_unref (void * _userdata_)
{
	Block57Data* _data57_;
	_data57_ = (Block57Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data57_->_ref_count_)) {
		ObjectsProject* self;
		self = _data57_->self;
		_g_object_unref0 (self);
		g_slice_free (Block57Data, _data57_);
	}
}

static void
____lambda59_ (ObjectsProject* 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_update_finish (_tmp1_, res);
	_tmp3_ = _tmp2_;
	_http_response_unref0 (_tmp3_);
	_g_object_unref0 (_tmp1_);
	_tmp4_ = services_store_instance ();
	services_store_update_project (_tmp4_, self);
	objects_base_object_set_loading ((ObjectsBaseObject*) self, FALSE);
}

static void
_____lambda59__gasync_ready_callback (GObject* source_object,
                                      GAsyncResult* res,
                                      gpointer self)
{
	____lambda59_ ((ObjectsProject*) self, source_object, res);
	g_object_unref (self);
}

static Block58Data*
block58_data_ref (Block58Data* _data58_)
{
	g_atomic_int_inc (&_data58_->_ref_count_);
	return _data58_;
}

static void
block58_data_unref (void * _userdata_)
{
	Block58Data* _data58_;
	_data58_ = (Block58Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data58_->_ref_count_)) {
		ObjectsProject* self;
		self = _data58_->_data57_->self;
		_g_object_unref0 (_data58_->caldav_client);
		block57_data_unref (_data58_->_data57_);
		_data58_->_data57_ = NULL;
		g_slice_free (Block58Data, _data58_);
	}
}

static void
_____lambda60_ (Block58Data* _data58_,
                GObject* obj,
                GAsyncResult* res)
{
	Block57Data* _data57_;
	ObjectsProject* self;
	ServicesCalDAVCalDAVClient* _tmp0_;
	HttpResponse* _tmp1_;
	HttpResponse* _tmp2_;
	ServicesStore* _tmp3_;
	_data57_ = _data58_->_data57_;
	self = _data57_->self;
	g_return_if_fail (res != NULL);
	_tmp0_ = _data58_->caldav_client;
	_tmp1_ = services_cal_dav_cal_dav_client_update_project_finish (_tmp0_, res);
	_tmp2_ = _tmp1_;
	_http_response_unref0 (_tmp2_);
	_tmp3_ = services_store_instance ();
	services_store_update_project (_tmp3_, self);
	objects_base_object_set_loading ((ObjectsBaseObject*) self, FALSE);
}

static void
______lambda60__gasync_ready_callback (GObject* source_object,
                                       GAsyncResult* res,
                                       gpointer self)
{
	_____lambda60_ (self, source_object, res);
	block58_data_unref (self);
}

static gboolean
__lambda58_ (Block57Data* _data57_)
{
	ObjectsProject* self;
	SourceType _tmp0_;
	gboolean result;
	self = _data57_->self;
	objects_base_object_set_update_timeout_id ((ObjectsBaseObject*) self, (guint) 0);
	_tmp0_ = self->priv->_backend_type;
	if (_tmp0_ == SOURCE_TYPE_LOCAL) {
		ServicesStore* _tmp1_;
		_tmp1_ = services_store_instance ();
		services_store_update_project (_tmp1_, self);
	} else {
		SourceType _tmp2_;
		_tmp2_ = self->priv->_backend_type;
		if (_tmp2_ == SOURCE_TYPE_TODOIST) {
			ServicesTodoist* _tmp3_;
			ServicesTodoist* _tmp4_;
			if (_data57_->show_loading) {
				objects_base_object_set_loading ((ObjectsBaseObject*) self, TRUE);
			}
			_tmp3_ = services_todoist_get_default ();
			_tmp4_ = _tmp3_;
			services_todoist_update (_tmp4_, (ObjectsBaseObject*) self, _____lambda59__gasync_ready_callback, g_object_ref (self));
			_g_object_unref0 (_tmp4_);
		} else {
			SourceType _tmp5_;
			_tmp5_ = self->priv->_backend_type;
			if (_tmp5_ == SOURCE_TYPE_CALDAV) {
				Block58Data* _data58_;
				ServicesCalDAVCore* _tmp6_;
				ServicesCalDAVCore* _tmp7_;
				ObjectsSource* _tmp8_;
				ObjectsSource* _tmp9_;
				ServicesCalDAVCalDAVClient* _tmp10_;
				ServicesCalDAVCalDAVClient* _tmp11_;
				ServicesCalDAVCalDAVClient* _tmp12_;
				_data58_ = g_slice_new0 (Block58Data);
				_data58_->_ref_count_ = 1;
				_data58_->_data57_ = block57_data_ref (_data57_);
				if (_data57_->show_loading) {
					objects_base_object_set_loading ((ObjectsBaseObject*) self, TRUE);
				}
				_tmp6_ = services_cal_dav_core_get_default ();
				_tmp7_ = _tmp6_;
				_tmp8_ = objects_project_get_source (self);
				_tmp9_ = _tmp8_;
				_tmp10_ = services_cal_dav_core_get_client (_tmp7_, _tmp9_);
				_tmp11_ = _tmp10_;
				_g_object_unref0 (_tmp7_);
				_data58_->caldav_client = _tmp11_;
				_tmp12_ = _data58_->caldav_client;
				services_cal_dav_cal_dav_client_update_project (_tmp12_, self, ______lambda60__gasync_ready_callback, block58_data_ref (_data58_));
				block58_data_unref (_data58_);
				_data58_ = NULL;
			}
		}
	}
	result = G_SOURCE_REMOVE;
	return result;
}

static gboolean
___lambda58__gsource_func (gpointer self)
{
	gboolean result;
	result = __lambda58_ (self);
	return result;
}

void
objects_project_update (ObjectsProject* self,
                        gboolean use_timeout,
                        gboolean show_loading)
{
	Block57Data* _data57_;
	guint _tmp0_;
	guint _tmp1_;
	guint timeout = 0U;
	g_return_if_fail (self != NULL);
	_data57_ = g_slice_new0 (Block57Data);
	_data57_->_ref_count_ = 1;
	_data57_->self = g_object_ref (self);
	_data57_->show_loading = show_loading;
	_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_);
	}
	timeout = (guint) CONSTANTS_UPDATE_TIMEOUT;
	if (use_timeout) {
		timeout = (guint) 0;
	}
	objects_base_object_set_update_timeout_id ((ObjectsBaseObject*) self, g_timeout_add_full (G_PRIORITY_DEFAULT, timeout, ___lambda58__gsource_func, block57_data_ref (_data57_), block57_data_unref));
	block57_data_unref (_data57_);
	_data57_ = NULL;
}

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

ObjectsProject*
objects_project_add_subproject_if_not_exists (ObjectsProject* self,
                                              ObjectsProject* new_project)
{
	ObjectsProject* return_value = NULL;
	GError* _inner_error0_ = NULL;
	ObjectsProject* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (new_project != NULL, NULL);
	return_value = NULL;
	{
		GeeArrayList* _tmp0_;
		GeeArrayList* _tmp1_;
		_tmp0_ = objects_project_get_subprojects (self);
		_tmp1_ = _tmp0_;
		g_rec_mutex_lock (&self->priv->__lock_subprojects);
		{
			const gchar* _tmp2_;
			const gchar* _tmp3_;
			ObjectsProject* _tmp4_;
			ObjectsProject* _tmp5_;
			ObjectsProject* _tmp8_;
			ObjectsProject* _tmp9_;
			_tmp2_ = objects_base_object_get_id ((ObjectsBaseObject*) new_project);
			_tmp3_ = _tmp2_;
			_tmp4_ = objects_project_get_subproject (self, _tmp3_);
			_g_object_unref0 (return_value);
			return_value = _tmp4_;
			_tmp5_ = return_value;
			if (_tmp5_ == NULL) {
				ServicesStore* _tmp6_;
				ObjectsProject* _tmp7_;
				objects_project_set_parent (new_project, self);
				_tmp6_ = services_store_instance ();
				services_store_insert_project (_tmp6_, new_project);
				_tmp7_ = _g_object_ref0 (new_project);
				_g_object_unref0 (return_value);
				return_value = _tmp7_;
			}
			_tmp8_ = return_value;
			_tmp9_ = _g_object_ref0 (_tmp8_);
			result = _tmp9_;
			{
				GeeArrayList* _tmp10_;
				GeeArrayList* _tmp11_;
				_tmp10_ = objects_project_get_subprojects (self);
				_tmp11_ = _tmp10_;
				g_rec_mutex_unlock (&self->priv->__lock_subprojects);
			}
			_g_object_unref0 (return_value);
			return result;
		}
		__finally0:
		{
			GeeArrayList* _tmp12_;
			GeeArrayList* _tmp13_;
			_tmp12_ = objects_project_get_subprojects (self);
			_tmp13_ = _tmp12_;
			g_rec_mutex_unlock (&self->priv->__lock_subprojects);
		}
		_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;
	}
}

ObjectsProject*
objects_project_get_subproject (ObjectsProject* self,
                                const gchar* id)
{
	ObjectsProject* return_value = NULL;
	GError* _inner_error0_ = NULL;
	ObjectsProject* 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->_subprojects;
		g_rec_mutex_lock (&self->priv->__lock__subprojects);
		{
			{
				GeeArrayList* _project_list = NULL;
				GeeArrayList* _tmp1_;
				GeeArrayList* _tmp2_;
				gint _project_size = 0;
				GeeArrayList* _tmp3_;
				gint _tmp4_;
				gint _tmp5_;
				gint _project_index = 0;
				_tmp1_ = objects_project_get_subprojects (self);
				_tmp2_ = _tmp1_;
				_project_list = _tmp2_;
				_tmp3_ = _project_list;
				_tmp4_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp3_);
				_tmp5_ = _tmp4_;
				_project_size = _tmp5_;
				_project_index = -1;
				while (TRUE) {
					gint _tmp6_;
					gint _tmp7_;
					ObjectsProject* project = NULL;
					GeeArrayList* _tmp8_;
					gpointer _tmp9_;
					ObjectsProject* _tmp10_;
					const gchar* _tmp11_;
					const gchar* _tmp12_;
					_project_index = _project_index + 1;
					_tmp6_ = _project_index;
					_tmp7_ = _project_size;
					if (!(_tmp6_ < _tmp7_)) {
						break;
					}
					_tmp8_ = _project_list;
					_tmp9_ = gee_abstract_list_get ((GeeAbstractList*) _tmp8_, _project_index);
					project = (ObjectsProject*) _tmp9_;
					_tmp10_ = project;
					_tmp11_ = objects_base_object_get_id ((ObjectsBaseObject*) _tmp10_);
					_tmp12_ = _tmp11_;
					if (g_strcmp0 (_tmp12_, id) == 0) {
						ObjectsProject* _tmp13_;
						ObjectsProject* _tmp14_;
						_tmp13_ = project;
						_tmp14_ = _g_object_ref0 (_tmp13_);
						_g_object_unref0 (return_value);
						return_value = _tmp14_;
						_g_object_unref0 (project);
						break;
					}
					_g_object_unref0 (project);
				}
			}
		}
		__finally0:
		{
			GeeArrayList* _tmp15_;
			_tmp15_ = self->priv->_subprojects;
			g_rec_mutex_unlock (&self->priv->__lock__subprojects);
		}
		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_project_set_parent (ObjectsProject* 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->_parent);
	self->priv->_parent = _tmp0_;
}

ObjectsSection*
objects_project_add_section_if_not_exists (ObjectsProject* self,
                                           ObjectsSection* new_section)
{
	ObjectsSection* return_value = NULL;
	GError* _inner_error0_ = NULL;
	ObjectsSection* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (new_section != NULL, NULL);
	return_value = NULL;
	{
		GeeArrayList* _tmp0_;
		_tmp0_ = self->priv->_sections;
		g_rec_mutex_lock (&self->priv->__lock__sections);
		{
			const gchar* _tmp1_;
			const gchar* _tmp2_;
			ObjectsSection* _tmp3_;
			ObjectsSection* _tmp4_;
			ObjectsSection* _tmp13_;
			ObjectsSection* _tmp14_;
			_tmp1_ = objects_base_object_get_id ((ObjectsBaseObject*) new_section);
			_tmp2_ = _tmp1_;
			_tmp3_ = objects_project_get_section (self, _tmp2_);
			_g_object_unref0 (return_value);
			return_value = _tmp3_;
			_tmp4_ = return_value;
			if (_tmp4_ == NULL) {
				ObjectsProject* _tmp5_;
				ObjectsProject* _tmp6_;
				GeeArrayList* _tmp7_;
				GeeArrayList* _tmp8_;
				gint _tmp9_;
				gint _tmp10_;
				ServicesStore* _tmp11_;
				ObjectsSection* _tmp12_;
				objects_section_set_project (new_section, self);
				_tmp5_ = objects_section_get_project (new_section);
				_tmp6_ = _tmp5_;
				_tmp7_ = objects_project_get_sections (_tmp6_);
				_tmp8_ = _tmp7_;
				_tmp9_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp8_);
				_tmp10_ = _tmp9_;
				objects_section_set_section_order (new_section, _tmp10_);
				objects_project_add_section (self, new_section);
				_tmp11_ = services_store_instance ();
				services_store_insert_section (_tmp11_, new_section);
				_tmp12_ = _g_object_ref0 (new_section);
				_g_object_unref0 (return_value);
				return_value = _tmp12_;
			}
			_tmp13_ = return_value;
			_tmp14_ = _g_object_ref0 (_tmp13_);
			result = _tmp14_;
			{
				GeeArrayList* _tmp15_;
				_tmp15_ = self->priv->_sections;
				g_rec_mutex_unlock (&self->priv->__lock__sections);
			}
			_g_object_unref0 (return_value);
			return result;
		}
		__finally0:
		{
			GeeArrayList* _tmp16_;
			_tmp16_ = self->priv->_sections;
			g_rec_mutex_unlock (&self->priv->__lock__sections);
		}
		_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;
	}
}

ObjectsSection*
objects_project_get_section (ObjectsProject* self,
                             const gchar* id)
{
	ObjectsSection* return_value = NULL;
	GError* _inner_error0_ = NULL;
	ObjectsSection* 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->_sections;
		g_rec_mutex_lock (&self->priv->__lock__sections);
		{
			{
				GeeArrayList* _section_list = NULL;
				GeeArrayList* _tmp1_;
				GeeArrayList* _tmp2_;
				gint _section_size = 0;
				GeeArrayList* _tmp3_;
				gint _tmp4_;
				gint _tmp5_;
				gint _section_index = 0;
				_tmp1_ = objects_project_get_sections (self);
				_tmp2_ = _tmp1_;
				_section_list = _tmp2_;
				_tmp3_ = _section_list;
				_tmp4_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp3_);
				_tmp5_ = _tmp4_;
				_section_size = _tmp5_;
				_section_index = -1;
				while (TRUE) {
					gint _tmp6_;
					gint _tmp7_;
					ObjectsSection* section = NULL;
					GeeArrayList* _tmp8_;
					gpointer _tmp9_;
					ObjectsSection* _tmp10_;
					const gchar* _tmp11_;
					const gchar* _tmp12_;
					_section_index = _section_index + 1;
					_tmp6_ = _section_index;
					_tmp7_ = _section_size;
					if (!(_tmp6_ < _tmp7_)) {
						break;
					}
					_tmp8_ = _section_list;
					_tmp9_ = gee_abstract_list_get ((GeeAbstractList*) _tmp8_, _section_index);
					section = (ObjectsSection*) _tmp9_;
					_tmp10_ = section;
					_tmp11_ = objects_base_object_get_id ((ObjectsBaseObject*) _tmp10_);
					_tmp12_ = _tmp11_;
					if (g_strcmp0 (_tmp12_, id) == 0) {
						ObjectsSection* _tmp13_;
						ObjectsSection* _tmp14_;
						_tmp13_ = section;
						_tmp14_ = _g_object_ref0 (_tmp13_);
						_g_object_unref0 (return_value);
						return_value = _tmp14_;
						_g_object_unref0 (section);
						break;
					}
					_g_object_unref0 (section);
				}
			}
		}
		__finally0:
		{
			GeeArrayList* _tmp15_;
			_tmp15_ = self->priv->_sections;
			g_rec_mutex_unlock (&self->priv->__lock__sections);
		}
		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;
}

static Block59Data*
block59_data_ref (Block59Data* _data59_)
{
	g_atomic_int_inc (&_data59_->_ref_count_);
	return _data59_;
}

static void
block59_data_unref (void * _userdata_)
{
	Block59Data* _data59_;
	_data59_ = (Block59Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data59_->_ref_count_)) {
		ObjectsProject* self;
		self = _data59_->self;
		_g_object_unref0 (_data59_->section);
		_g_object_unref0 (self);
		g_slice_free (Block59Data, _data59_);
	}
}

static void
__lambda8_ (Block59Data* _data59_)
{
	ObjectsProject* self;
	GeeArrayList* _tmp0_;
	self = _data59_->self;
	_tmp0_ = self->priv->_sections;
	gee_abstract_collection_remove ((GeeAbstractCollection*) _tmp0_, _data59_->section);
}

static void
___lambda8__objects_base_object_deleted (ObjectsBaseObject* _sender,
                                         gpointer self)
{
	__lambda8_ (self);
}

void
objects_project_add_section (ObjectsProject* self,
                             ObjectsSection* section)
{
	Block59Data* _data59_;
	ObjectsSection* _tmp0_;
	GeeArrayList* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (section != NULL);
	_data59_ = g_slice_new0 (Block59Data);
	_data59_->_ref_count_ = 1;
	_data59_->self = g_object_ref (self);
	_tmp0_ = _g_object_ref0 (section);
	_g_object_unref0 (_data59_->section);
	_data59_->section = _tmp0_;
	_tmp1_ = self->priv->_sections;
	gee_abstract_collection_add ((GeeAbstractCollection*) _tmp1_, _data59_->section);
	g_signal_connect_data ((ObjectsBaseObject*) _data59_->section, "deleted", (GCallback) ___lambda8__objects_base_object_deleted, block59_data_ref (_data59_), (GClosureNotify) block59_data_unref, 0);
	block59_data_unref (_data59_);
	_data59_ = NULL;
}

void
objects_project_remove_section (ObjectsProject* self,
                                ObjectsSection* section)
{
	GeeArrayList* _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (section != NULL);
	_tmp0_ = self->priv->_sections;
	if (_tmp0_ != NULL) {
		GeeArrayList* _tmp1_;
		_tmp1_ = self->priv->_sections;
		gee_abstract_collection_remove ((GeeAbstractCollection*) _tmp1_, section);
	}
}

void
objects_project_add_items_batched (ObjectsProject* self,
                                   GeeArrayList* items)
{
	GeeArrayList* related_items = NULL;
	GeeArrayList* _tmp0_;
	GeeHashMap* batch_map = NULL;
	GeeHashMap* _tmp1_;
	ServicesStore* _tmp57_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (items != NULL);
	_tmp0_ = gee_array_list_new (OBJECTS_TYPE_ITEM, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL);
	related_items = _tmp0_;
	_tmp1_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, OBJECTS_TYPE_ITEM, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
	batch_map = _tmp1_;
	{
		GeeArrayList* _item_list = NULL;
		gint _item_size = 0;
		GeeArrayList* _tmp2_;
		gint _tmp3_;
		gint _tmp4_;
		gint _item_index = 0;
		_item_list = items;
		_tmp2_ = _item_list;
		_tmp3_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp2_);
		_tmp4_ = _tmp3_;
		_item_size = _tmp4_;
		_item_index = -1;
		while (TRUE) {
			gint _tmp5_;
			gint _tmp6_;
			ObjectsItem* item = NULL;
			GeeArrayList* _tmp7_;
			gpointer _tmp8_;
			GeeHashMap* _tmp9_;
			ObjectsItem* _tmp10_;
			const gchar* _tmp11_;
			const gchar* _tmp12_;
			ObjectsItem* _tmp13_;
			_item_index = _item_index + 1;
			_tmp5_ = _item_index;
			_tmp6_ = _item_size;
			if (!(_tmp5_ < _tmp6_)) {
				break;
			}
			_tmp7_ = _item_list;
			_tmp8_ = gee_abstract_list_get ((GeeAbstractList*) _tmp7_, _item_index);
			item = (ObjectsItem*) _tmp8_;
			_tmp9_ = batch_map;
			_tmp10_ = item;
			_tmp11_ = objects_base_object_get_id ((ObjectsBaseObject*) _tmp10_);
			_tmp12_ = _tmp11_;
			_tmp13_ = item;
			gee_abstract_map_set ((GeeAbstractMap*) _tmp9_, _tmp12_, _tmp13_);
			_g_object_unref0 (item);
		}
	}
	{
		GeeArrayList* _item_list = NULL;
		gint _item_size = 0;
		GeeArrayList* _tmp14_;
		gint _tmp15_;
		gint _tmp16_;
		gint _item_index = 0;
		_item_list = items;
		_tmp14_ = _item_list;
		_tmp15_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp14_);
		_tmp16_ = _tmp15_;
		_item_size = _tmp16_;
		_item_index = -1;
		while (TRUE) {
			gint _tmp17_;
			gint _tmp18_;
			ObjectsItem* item = NULL;
			GeeArrayList* _tmp19_;
			gpointer _tmp20_;
			ObjectsItem* _tmp21_;
			const gchar* _tmp22_;
			const gchar* _tmp23_;
			_item_index = _item_index + 1;
			_tmp17_ = _item_index;
			_tmp18_ = _item_size;
			if (!(_tmp17_ < _tmp18_)) {
				break;
			}
			_tmp19_ = _item_list;
			_tmp20_ = gee_abstract_list_get ((GeeAbstractList*) _tmp19_, _item_index);
			item = (ObjectsItem*) _tmp20_;
			_tmp21_ = item;
			_tmp22_ = objects_item_get_parent_id (_tmp21_);
			_tmp23_ = _tmp22_;
			if (g_strcmp0 (_tmp23_, "") != 0) {
				ObjectsItem* parent_item = NULL;
				ServicesStore* _tmp24_;
				ObjectsItem* _tmp25_;
				const gchar* _tmp26_;
				const gchar* _tmp27_;
				ObjectsItem* _tmp28_;
				ObjectsItem* _tmp29_;
				ObjectsItem* _tmp41_;
				_tmp24_ = services_store_instance ();
				_tmp25_ = item;
				_tmp26_ = objects_item_get_parent_id (_tmp25_);
				_tmp27_ = _tmp26_;
				_tmp28_ = services_store_get_item (_tmp24_, _tmp27_);
				parent_item = _tmp28_;
				_tmp29_ = parent_item;
				if (_tmp29_ == NULL) {
					ObjectsItem* _tmp30_ = NULL;
					GeeHashMap* _tmp31_;
					ObjectsItem* _tmp32_;
					const gchar* _tmp33_;
					const gchar* _tmp34_;
					ObjectsItem* _tmp40_;
					_tmp31_ = batch_map;
					_tmp32_ = item;
					_tmp33_ = objects_item_get_parent_id (_tmp32_);
					_tmp34_ = _tmp33_;
					if (gee_abstract_map_has_key ((GeeAbstractMap*) _tmp31_, _tmp34_)) {
						GeeHashMap* _tmp35_;
						ObjectsItem* _tmp36_;
						const gchar* _tmp37_;
						const gchar* _tmp38_;
						gpointer _tmp39_;
						_tmp35_ = batch_map;
						_tmp36_ = item;
						_tmp37_ = objects_item_get_parent_id (_tmp36_);
						_tmp38_ = _tmp37_;
						_tmp39_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp35_, _tmp38_);
						_g_object_unref0 (_tmp30_);
						_tmp30_ = (ObjectsItem*) _tmp39_;
					} else {
						_g_object_unref0 (_tmp30_);
						_tmp30_ = NULL;
					}
					_tmp40_ = _tmp30_;
					_tmp30_ = NULL;
					_g_object_unref0 (parent_item);
					parent_item = _tmp40_;
					_g_object_unref0 (_tmp30_);
				}
				_tmp41_ = parent_item;
				if (_tmp41_ != NULL) {
					ObjectsItem* _tmp42_;
					ObjectsItem* _tmp43_;
					ObjectsItem* _tmp44_;
					ObjectsItem* _tmp45_;
					GeeArrayList* _tmp46_;
					ObjectsItem* _tmp47_;
					_tmp42_ = parent_item;
					_tmp43_ = item;
					_tmp44_ = objects_item_add_item_if_not_exists (_tmp42_, _tmp43_, TRUE);
					_tmp45_ = _tmp44_;
					_g_object_unref0 (_tmp45_);
					_tmp46_ = related_items;
					_tmp47_ = item;
					gee_abstract_collection_add ((GeeAbstractCollection*) _tmp46_, _tmp47_);
				}
				_g_object_unref0 (parent_item);
			}
			_g_object_unref0 (item);
		}
	}
	{
		GeeArrayList* _item_list = NULL;
		GeeArrayList* _tmp48_;
		gint _item_size = 0;
		GeeArrayList* _tmp49_;
		gint _tmp50_;
		gint _tmp51_;
		gint _item_index = 0;
		_tmp48_ = related_items;
		_item_list = _tmp48_;
		_tmp49_ = _item_list;
		_tmp50_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp49_);
		_tmp51_ = _tmp50_;
		_item_size = _tmp51_;
		_item_index = -1;
		while (TRUE) {
			gint _tmp52_;
			gint _tmp53_;
			ObjectsItem* item = NULL;
			GeeArrayList* _tmp54_;
			gpointer _tmp55_;
			ObjectsItem* _tmp56_;
			_item_index = _item_index + 1;
			_tmp52_ = _item_index;
			_tmp53_ = _item_size;
			if (!(_tmp52_ < _tmp53_)) {
				break;
			}
			_tmp54_ = _item_list;
			_tmp55_ = gee_abstract_list_get ((GeeAbstractList*) _tmp54_, _item_index);
			item = (ObjectsItem*) _tmp55_;
			_tmp56_ = item;
			gee_abstract_collection_remove ((GeeAbstractCollection*) items, _tmp56_);
			_g_object_unref0 (item);
		}
	}
	_tmp57_ = services_store_instance ();
	if (!services_store_insert_items_transaction (_tmp57_, items, TRUE)) {
		g_error ("Project.vala:575: Failed to insert items in transaction");
	}
	_g_object_unref0 (batch_map);
	_g_object_unref0 (related_items);
}

ObjectsItem*
objects_project_add_item_if_not_exists (ObjectsProject* 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_project_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_project (new_item, self);
				objects_project_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;
	}
}

void
objects_project_add_item (ObjectsProject* 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);
	g_signal_emit (self, objects_project_signals[OBJECTS_PROJECT_ITEM_ADDED_SIGNAL], 0, item);
}

ObjectsItem*
objects_project_get_item (ObjectsProject* 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_project_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;
}

static gchar*
objects_project_real_get_add_json (ObjectsBaseObject* base,
                                   const gchar* temp_id,
                                   const gchar* uuid)
{
	ObjectsProject * self;
	gchar* _tmp0_;
	gchar* result;
	self = (ObjectsProject*) 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 void
_vala_JsonNode_free (JsonNode* self)
{
	g_boxed_free (json_node_get_type (), self);
}

static gchar*
objects_project_real_get_update_json (ObjectsBaseObject* base,
                                      const gchar* uuid,
                                      const gchar* temp_id)
{
	ObjectsProject * 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* _tmp18_;
	JsonBuilder* _tmp19_;
	const gchar* _tmp20_;
	const gchar* _tmp21_;
	JsonBuilder* _tmp22_;
	JsonBuilder* _tmp23_;
	const gchar* _tmp24_;
	const gchar* _tmp25_;
	JsonBuilder* _tmp26_;
	JsonBuilder* _tmp27_;
	gboolean _tmp28_;
	JsonBuilder* _tmp29_;
	JsonBuilder* _tmp30_;
	gboolean _tmp31_;
	const gchar* _tmp32_;
	const gchar* _tmp38_;
	JsonBuilder* _tmp42_;
	JsonBuilder* _tmp43_;
	JsonBuilder* _tmp44_;
	JsonBuilder* _tmp45_;
	JsonGenerator* generator = NULL;
	JsonGenerator* _tmp46_;
	JsonNode* root = NULL;
	JsonBuilder* _tmp47_;
	JsonNode* _tmp48_;
	gchar* _tmp49_;
	gchar* result;
	self = (ObjectsProject*) 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_ = "project_update";
	} else {
		_tmp6_ = "project_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_);
	}
	_tmp18_ = builder;
	json_builder_set_member_name (_tmp18_, "name");
	_tmp19_ = builder;
	_tmp20_ = objects_base_object_get_name ((ObjectsBaseObject*) self);
	_tmp21_ = _tmp20_;
	json_builder_add_string_value (_tmp19_, _tmp21_);
	_tmp22_ = builder;
	json_builder_set_member_name (_tmp22_, "color");
	_tmp23_ = builder;
	_tmp24_ = objects_base_object_get_color ((ObjectsBaseObject*) self);
	_tmp25_ = _tmp24_;
	json_builder_add_string_value (_tmp23_, _tmp25_);
	_tmp26_ = builder;
	json_builder_set_member_name (_tmp26_, "is_collapsed");
	_tmp27_ = builder;
	_tmp28_ = self->priv->_collapsed;
	json_builder_add_boolean_value (_tmp27_, _tmp28_);
	_tmp29_ = builder;
	json_builder_set_member_name (_tmp29_, "is_favorite");
	_tmp30_ = builder;
	_tmp31_ = self->priv->_is_favorite;
	json_builder_add_boolean_value (_tmp30_, _tmp31_);
	_tmp32_ = self->priv->_parent_id;
	if (g_strcmp0 (_tmp32_, "") != 0) {
		JsonBuilder* _tmp33_;
		JsonBuilder* _tmp34_;
		const gchar* _tmp35_;
		_tmp33_ = builder;
		json_builder_set_member_name (_tmp33_, "parent_id");
		_tmp34_ = builder;
		_tmp35_ = self->priv->_parent_id;
		json_builder_add_string_value (_tmp34_, _tmp35_);
	} else {
		JsonBuilder* _tmp36_;
		JsonBuilder* _tmp37_;
		_tmp36_ = builder;
		json_builder_set_member_name (_tmp36_, "parent_id");
		_tmp37_ = builder;
		json_builder_add_null_value (_tmp37_);
	}
	_tmp38_ = self->priv->_description;
	if (g_strcmp0 (_tmp38_, "") != 0) {
		JsonBuilder* _tmp39_;
		JsonBuilder* _tmp40_;
		const gchar* _tmp41_;
		_tmp39_ = builder;
		json_builder_set_member_name (_tmp39_, "description");
		_tmp40_ = builder;
		_tmp41_ = self->priv->_description;
		json_builder_add_string_value (_tmp40_, _tmp41_);
	}
	_tmp42_ = builder;
	json_builder_end_object (_tmp42_);
	_tmp43_ = builder;
	json_builder_end_object (_tmp43_);
	_tmp44_ = builder;
	json_builder_end_array (_tmp44_);
	_tmp45_ = builder;
	json_builder_end_object (_tmp45_);
	_tmp46_ = json_generator_new ();
	generator = _tmp46_;
	_tmp47_ = builder;
	_tmp48_ = json_builder_get_root (_tmp47_);
	root = _tmp48_;
	json_generator_set_root (generator, root);
	_tmp49_ = json_generator_to_data (generator, NULL);
	result = _tmp49_;
	__vala_JsonNode_free0 (root);
	_g_object_unref0 (generator);
	_g_object_unref0 (builder);
	return result;
}

static gchar*
objects_project_real_to_json (ObjectsBaseObject* base)
{
	ObjectsProject * self;
	JsonBuilder* builder = NULL;
	JsonBuilder* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	Util* _tmp3_;
	Util* _tmp4_;
	const gchar* _tmp5_;
	const gchar* _tmp6_;
	gchar* _tmp7_;
	gchar* _tmp8_;
	const gchar* _tmp9_;
	const gchar* _tmp10_;
	gboolean _tmp11_;
	gboolean _tmp12_;
	JsonGenerator* generator = NULL;
	JsonGenerator* _tmp13_;
	JsonNode* root = NULL;
	JsonNode* _tmp14_;
	gchar* _tmp15_;
	gchar* result;
	self = (ObjectsProject*) base;
	_tmp0_ = json_builder_new ();
	builder = _tmp0_;
	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, "name");
	_tmp3_ = util_get_default ();
	_tmp4_ = _tmp3_;
	_tmp5_ = objects_base_object_get_name ((ObjectsBaseObject*) self);
	_tmp6_ = _tmp5_;
	_tmp7_ = util_get_encode_text (_tmp4_, _tmp6_);
	_tmp8_ = _tmp7_;
	json_builder_add_string_value (builder, _tmp8_);
	_g_free0 (_tmp8_);
	_g_object_unref0 (_tmp4_);
	json_builder_set_member_name (builder, "color");
	_tmp9_ = objects_base_object_get_color ((ObjectsBaseObject*) self);
	_tmp10_ = _tmp9_;
	json_builder_add_string_value (builder, _tmp10_);
	json_builder_set_member_name (builder, "collapsed");
	_tmp11_ = self->priv->_collapsed;
	json_builder_add_boolean_value (builder, _tmp11_);
	json_builder_set_member_name (builder, "is_favorite");
	_tmp12_ = self->priv->_is_favorite;
	json_builder_add_boolean_value (builder, _tmp12_);
	json_builder_end_object (builder);
	_tmp13_ = json_generator_new ();
	generator = _tmp13_;
	_tmp14_ = json_builder_get_root (builder);
	root = _tmp14_;
	json_generator_set_root (generator, root);
	_tmp15_ = json_generator_to_data (generator, NULL);
	result = _tmp15_;
	__vala_JsonNode_free0 (root);
	_g_object_unref0 (generator);
	_g_object_unref0 (builder);
	return result;
}

static gchar*
objects_project_real_get_move_json (ObjectsBaseObject* base,
                                    const gchar* uuid,
                                    const gchar* new_parent_id)
{
	ObjectsProject * self;
	JsonBuilder* builder = NULL;
	JsonBuilder* _tmp0_;
	JsonBuilder* _tmp1_;
	JsonBuilder* _tmp2_;
	JsonBuilder* _tmp3_;
	JsonBuilder* _tmp4_;
	JsonBuilder* _tmp5_;
	JsonBuilder* _tmp6_;
	JsonBuilder* _tmp7_;
	JsonBuilder* _tmp8_;
	JsonBuilder* _tmp9_;
	JsonBuilder* _tmp10_;
	const gchar* _tmp11_;
	const gchar* _tmp12_;
	JsonBuilder* _tmp17_;
	JsonBuilder* _tmp18_;
	JsonBuilder* _tmp19_;
	JsonGenerator* generator = NULL;
	JsonGenerator* _tmp20_;
	JsonNode* root = NULL;
	JsonBuilder* _tmp21_;
	JsonNode* _tmp22_;
	gchar* _tmp23_;
	gchar* result;
	self = (ObjectsProject*) base;
	g_return_val_if_fail (uuid != NULL, NULL);
	g_return_val_if_fail (new_parent_id != NULL, NULL);
	_tmp0_ = json_builder_new ();
	builder = _tmp0_;
	_tmp1_ = builder;
	json_builder_begin_array (_tmp1_);
	_tmp2_ = builder;
	json_builder_begin_object (_tmp2_);
	_tmp3_ = builder;
	json_builder_set_member_name (_tmp3_, "type");
	_tmp4_ = builder;
	json_builder_add_string_value (_tmp4_, "project_move");
	_tmp5_ = builder;
	json_builder_set_member_name (_tmp5_, "uuid");
	_tmp6_ = builder;
	json_builder_add_string_value (_tmp6_, uuid);
	_tmp7_ = builder;
	json_builder_set_member_name (_tmp7_, "args");
	_tmp8_ = builder;
	json_builder_begin_object (_tmp8_);
	_tmp9_ = builder;
	json_builder_set_member_name (_tmp9_, "id");
	_tmp10_ = builder;
	_tmp11_ = objects_base_object_get_id ((ObjectsBaseObject*) self);
	_tmp12_ = _tmp11_;
	json_builder_add_string_value (_tmp10_, _tmp12_);
	if (g_strcmp0 (new_parent_id, "") != 0) {
		JsonBuilder* _tmp13_;
		JsonBuilder* _tmp14_;
		_tmp13_ = builder;
		json_builder_set_member_name (_tmp13_, "parent_id");
		_tmp14_ = builder;
		json_builder_add_string_value (_tmp14_, new_parent_id);
	} else {
		JsonBuilder* _tmp15_;
		JsonBuilder* _tmp16_;
		_tmp15_ = builder;
		json_builder_set_member_name (_tmp15_, "parent_id");
		_tmp16_ = builder;
		json_builder_add_null_value (_tmp16_);
	}
	_tmp17_ = builder;
	json_builder_end_object (_tmp17_);
	_tmp18_ = builder;
	json_builder_end_object (_tmp18_);
	_tmp19_ = builder;
	json_builder_end_array (_tmp19_);
	_tmp20_ = json_generator_new ();
	generator = _tmp20_;
	_tmp21_ = builder;
	_tmp22_ = json_builder_get_root (_tmp21_);
	root = _tmp22_;
	json_generator_set_root (generator, root);
	_tmp23_ = json_generator_to_data (generator, NULL);
	result = _tmp23_;
	__vala_JsonNode_free0 (root);
	_g_object_unref0 (generator);
	_g_object_unref0 (builder);
	return result;
}

static gchar*
bool_to_string (gboolean self)
{
	gchar* result;
	if (self) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup ("true");
		result = _tmp0_;
		return result;
	} else {
		gchar* _tmp1_;
		_tmp1_ = g_strdup ("false");
		result = _tmp1_;
		return result;
	}
}

static const gchar*
string_to_string (const gchar* self)
{
	const gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	result = self;
	return result;
}

gchar*
objects_project_to_string (ObjectsProject* self)
{
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	const gchar* _tmp4_;
	const gchar* _tmp5_;
	const gchar* _tmp6_;
	SourceType _tmp7_;
	gchar* _tmp8_;
	gchar* _tmp9_;
	gboolean _tmp10_;
	gchar* _tmp11_;
	gchar* _tmp12_;
	gboolean _tmp13_;
	gchar* _tmp14_;
	gchar* _tmp15_;
	gint _tmp16_;
	gboolean _tmp17_;
	gchar* _tmp18_;
	gchar* _tmp19_;
	gboolean _tmp20_;
	gchar* _tmp21_;
	gchar* _tmp22_;
	gboolean _tmp23_;
	gchar* _tmp24_;
	gchar* _tmp25_;
	gboolean _tmp26_;
	gchar* _tmp27_;
	gchar* _tmp28_;
	ProjectViewStyle _tmp29_;
	ProjectViewStyle _tmp30_;
	gchar* _tmp31_;
	gchar* _tmp32_;
	gboolean _tmp33_;
	gboolean _tmp34_;
	gchar* _tmp35_;
	gchar* _tmp36_;
	SortOrderType _tmp37_;
	SortOrderType _tmp38_;
	gboolean _tmp39_;
	gchar* _tmp40_;
	gchar* _tmp41_;
	const gchar* _tmp42_;
	const gchar* _tmp43_;
	const gchar* _tmp44_;
	const gchar* _tmp45_;
	const gchar* _tmp46_;
	const gchar* _tmp47_;
	gchar* _tmp48_;
	gchar* _tmp49_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = objects_base_object_get_id ((ObjectsBaseObject*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = objects_base_object_get_name ((ObjectsBaseObject*) self);
	_tmp3_ = _tmp2_;
	_tmp4_ = self->priv->_description;
	_tmp5_ = objects_base_object_get_color ((ObjectsBaseObject*) self);
	_tmp6_ = _tmp5_;
	_tmp7_ = self->priv->_backend_type;
	_tmp8_ = source_type_to_string (_tmp7_);
	_tmp9_ = _tmp8_;
	_tmp10_ = self->priv->_inbox_project;
	_tmp11_ = bool_to_string (_tmp10_);
	_tmp12_ = _tmp11_;
	_tmp13_ = self->priv->_team_inbox;
	_tmp14_ = bool_to_string (_tmp13_);
	_tmp15_ = _tmp14_;
	_tmp16_ = self->priv->_child_order;
	_tmp17_ = self->priv->_is_deleted;
	_tmp18_ = bool_to_string (_tmp17_);
	_tmp19_ = _tmp18_;
	_tmp20_ = self->priv->_is_archived;
	_tmp21_ = bool_to_string (_tmp20_);
	_tmp22_ = _tmp21_;
	_tmp23_ = self->priv->_is_favorite;
	_tmp24_ = bool_to_string (_tmp23_);
	_tmp25_ = _tmp24_;
	_tmp26_ = self->priv->_shared;
	_tmp27_ = bool_to_string (_tmp26_);
	_tmp28_ = _tmp27_;
	_tmp29_ = objects_project_get_view_style (self);
	_tmp30_ = _tmp29_;
	_tmp31_ = project_view_style_to_string (_tmp30_);
	_tmp32_ = _tmp31_;
	_tmp33_ = objects_project_get_show_completed (self);
	_tmp34_ = _tmp33_;
	_tmp35_ = bool_to_string (_tmp34_);
	_tmp36_ = _tmp35_;
	_tmp37_ = objects_project_get_sort_order (self);
	_tmp38_ = _tmp37_;
	_tmp39_ = self->priv->_collapsed;
	_tmp40_ = bool_to_string (_tmp39_);
	_tmp41_ = _tmp40_;
	_tmp42_ = self->priv->_parent_id;
	_tmp43_ = string_to_string (_tmp42_);
	_tmp44_ = self->priv->_source_id;
	_tmp45_ = self->priv->_calendar_url;
	_tmp46_ = objects_project_get_view_id (self);
	_tmp47_ = _tmp46_;
	_tmp48_ = g_strdup_printf ("\n" \
"        _________________________________\n" \
"            ID: %s\n" \
"            NAME: %s\n" \
"            DESCRIPTION: %s\n" \
"            COLOR: %s\n" \
"            BACKEND TYPE: %s\n" \
"            INBOX: %s\n" \
"            TEAM INBOX: %s\n" \
"            CHILD ORDER: %i\n" \
"            DELETED: %s\n" \
"            ARCHIVED: %s\n" \
"            FAVORITE: %s\n" \
"            SHARED: %s\n" \
"            VIEW: %s\n" \
"            SHOW COMPLETED: %s\n" \
"            SORT ORDER: %i\n" \
"            COLLAPSED: %s\n" \
"            PARENT ID: %s\n" \
"            SOURCE ID: %s\n" \
"            Calendar URL: %s\n" \
"            VIEW_ID: %s\n" \
"        ---------------------------------\n" \
"        ", _tmp1_, _tmp3_, _tmp4_, _tmp6_, _tmp9_, _tmp12_, _tmp15_, _tmp16_, _tmp19_, _tmp22_, _tmp25_, _tmp28_, _tmp32_, _tmp36_, (gint) _tmp38_, _tmp41_, _tmp43_, _tmp44_, _tmp45_, _tmp47_);
	_tmp49_ = _tmp48_;
	_g_free0 (_tmp41_);
	_g_free0 (_tmp36_);
	_g_free0 (_tmp32_);
	_g_free0 (_tmp28_);
	_g_free0 (_tmp25_);
	_g_free0 (_tmp22_);
	_g_free0 (_tmp19_);
	_g_free0 (_tmp15_);
	_g_free0 (_tmp12_);
	_g_free0 (_tmp9_);
	result = _tmp49_;
	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;
}

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

static gpointer
__double_dup0 (gpointer self)
{
	return self ? _double_dup (self) : NULL;
}

static void
objects_project_real_count_update (ObjectsBaseObject* base)
{
	ObjectsProject * self;
	gboolean _tmp0_;
	GeeArrayList* project_items = NULL;
	ServicesStore* _tmp1_;
	GeeArrayList* _tmp2_;
	gint pending_tasks = 0;
	gint items_total = 0;
	gint items_checked = 0;
	gint* _tmp24_;
	gdouble _tmp25_ = 0.0;
	gdouble* _tmp26_;
	self = (ObjectsProject*) base;
	_tmp0_ = self->priv->_freeze_update;
	if (_tmp0_) {
		return;
	}
	_tmp1_ = services_store_instance ();
	_tmp2_ = services_store_get_items_by_project (_tmp1_, self);
	project_items = _tmp2_;
	pending_tasks = 0;
	items_total = 0;
	items_checked = 0;
	{
		GeeArrayList* _item_list = NULL;
		GeeArrayList* _tmp3_;
		gint _item_size = 0;
		GeeArrayList* _tmp4_;
		gint _tmp5_;
		gint _tmp6_;
		gint _item_index = 0;
		_tmp3_ = project_items;
		_item_list = _tmp3_;
		_tmp4_ = _item_list;
		_tmp5_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp4_);
		_tmp6_ = _tmp5_;
		_item_size = _tmp6_;
		_item_index = -1;
		while (TRUE) {
			gint _tmp7_;
			gint _tmp8_;
			ObjectsItem* item = NULL;
			GeeArrayList* _tmp9_;
			gpointer _tmp10_;
			gboolean archived = FALSE;
			ObjectsItem* _tmp11_;
			gboolean _tmp12_ = FALSE;
			ObjectsItem* _tmp13_;
			gboolean _tmp14_;
			gboolean _tmp15_;
			gboolean _tmp17_ = FALSE;
			gboolean _tmp18_;
			gint _tmp19_;
			ObjectsItem* _tmp20_;
			gboolean _tmp21_;
			gboolean _tmp22_;
			_item_index = _item_index + 1;
			_tmp7_ = _item_index;
			_tmp8_ = _item_size;
			if (!(_tmp7_ < _tmp8_)) {
				break;
			}
			_tmp9_ = _item_list;
			_tmp10_ = gee_abstract_list_get ((GeeAbstractList*) _tmp9_, _item_index);
			item = (ObjectsItem*) _tmp10_;
			_tmp11_ = item;
			archived = objects_item_was_archived (_tmp11_);
			_tmp13_ = item;
			_tmp14_ = objects_item_get_checked (_tmp13_);
			_tmp15_ = _tmp14_;
			if (!_tmp15_) {
				_tmp12_ = !archived;
			} else {
				_tmp12_ = FALSE;
			}
			if (_tmp12_) {
				gint _tmp16_;
				_tmp16_ = pending_tasks;
				pending_tasks = _tmp16_ + 1;
			}
			_tmp18_ = self->priv->_is_archived;
			if (!_tmp18_) {
				_tmp17_ = archived;
			} else {
				_tmp17_ = FALSE;
			}
			if (_tmp17_) {
				_g_object_unref0 (item);
				continue;
			}
			_tmp19_ = items_total;
			items_total = _tmp19_ + 1;
			_tmp20_ = item;
			_tmp21_ = objects_item_get_checked (_tmp20_);
			_tmp22_ = _tmp21_;
			if (_tmp22_) {
				gint _tmp23_;
				_tmp23_ = items_checked;
				items_checked = _tmp23_ + 1;
			}
			_g_object_unref0 (item);
		}
	}
	_tmp24_ = __int_dup0 (&pending_tasks);
	_g_free0 (((ObjectsBaseObject*) self)->_item_count);
	((ObjectsBaseObject*) self)->_item_count = _tmp24_;
	if (items_total == 0) {
		_tmp25_ = 0.0;
	} else {
		_tmp25_ = ((gdouble) items_checked) / ((gdouble) items_total);
	}
	_tmp26_ = __double_dup0 (&_tmp25_);
	_g_free0 (((ObjectsBaseObject*) self)->_percentage);
	((ObjectsBaseObject*) self)->_percentage = _tmp26_;
	g_signal_emit_by_name ((ObjectsBaseObject*) self, "count-updated");
	_g_object_unref0 (project_items);
}

static gint
objects_project_real_update_count (ObjectsBaseObject* base)
{
	ObjectsProject * self;
	gint* _tmp0_;
	gint* _tmp1_ = NULL;
	gint* _tmp2_;
	gint* _tmp3_;
	gint* _tmp6_;
	gint* _tmp7_;
	gint _tmp8_;
	gint result;
	self = (ObjectsProject*) base;
	_tmp0_ = ((ObjectsBaseObject*) self)->_item_count;
	if (_tmp0_ == NULL) {
		objects_base_object_count_update ((ObjectsBaseObject*) self);
	}
	_tmp2_ = ((ObjectsBaseObject*) self)->_item_count;
	_tmp3_ = __int_dup0 (_tmp2_);
	_tmp1_ = _tmp3_;
	if (_tmp1_ == NULL) {
		gint _tmp4_;
		gint* _tmp5_;
		_tmp4_ = 0;
		_tmp5_ = __int_dup0 (&_tmp4_);
		_g_free0 (_tmp1_);
		_tmp1_ = _tmp5_;
	}
	_tmp6_ = _tmp1_;
	_tmp1_ = NULL;
	_tmp7_ = _tmp6_;
	_tmp8_ = *_tmp7_;
	_g_free0 (_tmp7_);
	result = _tmp8_;
	_g_free0 (_tmp1_);
	return result;
}

static gdouble
objects_project_real_update_percentage (ObjectsBaseObject* base)
{
	ObjectsProject * self;
	gdouble* _tmp0_;
	gdouble* _tmp1_ = NULL;
	gdouble* _tmp2_;
	gdouble* _tmp3_;
	gdouble* _tmp6_;
	gdouble* _tmp7_;
	gdouble _tmp8_;
	gdouble result;
	self = (ObjectsProject*) base;
	_tmp0_ = ((ObjectsBaseObject*) self)->_percentage;
	if (_tmp0_ == NULL) {
		objects_base_object_count_update ((ObjectsBaseObject*) self);
	}
	_tmp2_ = ((ObjectsBaseObject*) self)->_percentage;
	_tmp3_ = __double_dup0 (_tmp2_);
	_tmp1_ = _tmp3_;
	if (_tmp1_ == NULL) {
		gdouble _tmp4_;
		gdouble* _tmp5_;
		_tmp4_ = 0.0;
		_tmp5_ = __double_dup0 (&_tmp4_);
		_g_free0 (_tmp1_);
		_tmp1_ = _tmp5_;
	}
	_tmp6_ = _tmp1_;
	_tmp1_ = NULL;
	_tmp7_ = _tmp6_;
	_tmp8_ = *_tmp7_;
	_g_free0 (_tmp7_);
	result = _tmp8_;
	_g_free0 (_tmp1_);
	return result;
}

void
objects_project_share_markdown (ObjectsProject* self)
{
	GdkClipboard* clipboard = NULL;
	GdkDisplay* _tmp0_;
	GdkClipboard* _tmp1_;
	GdkClipboard* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	ServicesEventBus* _tmp5_;
	ServicesEventBus* _tmp6_;
	Util* _tmp7_;
	Util* _tmp8_;
	AdwToast* _tmp9_;
	AdwToast* _tmp10_;
	g_return_if_fail (self != NULL);
	_tmp0_ = gdk_display_get_default ();
	_tmp1_ = gdk_display_get_clipboard (_tmp0_);
	_tmp2_ = _g_object_ref0 (_tmp1_);
	clipboard = _tmp2_;
	_tmp3_ = objects_project_to_markdown (self);
	_tmp4_ = _tmp3_;
	gdk_clipboard_set_text (clipboard, _tmp4_);
	_g_free0 (_tmp4_);
	_tmp5_ = services_event_bus_get_default ();
	_tmp6_ = _tmp5_;
	_tmp7_ = util_get_default ();
	_tmp8_ = _tmp7_;
	_tmp9_ = util_create_toast (_tmp8_, _ ("The project was copied to the Clipboard."), (guint) 0, ADW_TOAST_PRIORITY_NORMAL);
	_tmp10_ = _tmp9_;
	g_signal_emit_by_name (_tmp6_, "send-toast", _tmp10_);
	_g_object_unref0 (_tmp10_);
	_g_object_unref0 (_tmp8_);
	_g_object_unref0 (_tmp6_);
	_g_object_unref0 (clipboard);
}

void
objects_project_share_mail (ObjectsProject* self)
{
	gchar* uri = NULL;
	gchar* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	gchar* _tmp6_;
	gchar* _tmp7_;
	gchar* _tmp8_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = g_strdup ("");
	uri = _tmp0_;
	_tmp1_ = uri;
	_tmp2_ = objects_base_object_get_name ((ObjectsBaseObject*) self);
	_tmp3_ = _tmp2_;
	_tmp4_ = objects_project_to_markdown (self);
	_tmp5_ = _tmp4_;
	_tmp6_ = g_strdup_printf ("mailto:?subject=%s&body=%s", _tmp3_, _tmp5_);
	_tmp7_ = _tmp6_;
	_tmp8_ = g_strconcat (_tmp1_, _tmp7_, NULL);
	_g_free0 (uri);
	uri = _tmp8_;
	_g_free0 (_tmp7_);
	_g_free0 (_tmp5_);
	{
		const gchar* _tmp9_;
		_tmp9_ = uri;
		g_app_info_launch_default_for_uri (_tmp9_, NULL, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp10_;
		const gchar* _tmp11_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp10_ = e;
		_tmp11_ = _tmp10_->message;
		g_warning ("Project.vala:851: %s\n", _tmp11_);
		_g_error_free0 (e);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		_g_free0 (uri);
		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;
	}
	_g_free0 (uri);
}

static gchar*
objects_project_to_markdown (ObjectsProject* self)
{
	gchar* text = NULL;
	gchar* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	gchar* _tmp6_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = g_strdup ("");
	text = _tmp0_;
	_tmp1_ = text;
	_tmp2_ = objects_base_object_get_name ((ObjectsBaseObject*) self);
	_tmp3_ = _tmp2_;
	_tmp4_ = g_strdup_printf ("## %s\n", _tmp3_);
	_tmp5_ = _tmp4_;
	_tmp6_ = g_strconcat (_tmp1_, _tmp5_, NULL);
	_g_free0 (text);
	text = _tmp6_;
	_g_free0 (_tmp5_);
	{
		GeeArrayList* _item_list = NULL;
		GeeArrayList* _tmp7_;
		GeeArrayList* _tmp8_;
		gint _item_size = 0;
		GeeArrayList* _tmp9_;
		gint _tmp10_;
		gint _tmp11_;
		gint _item_index = 0;
		_tmp7_ = objects_project_get_items (self);
		_tmp8_ = _tmp7_;
		_item_list = _tmp8_;
		_tmp9_ = _item_list;
		_tmp10_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp9_);
		_tmp11_ = _tmp10_;
		_item_size = _tmp11_;
		_item_index = -1;
		while (TRUE) {
			gint _tmp12_;
			gint _tmp13_;
			ObjectsItem* item = NULL;
			GeeArrayList* _tmp14_;
			gpointer _tmp15_;
			const gchar* _tmp16_;
			ObjectsItem* _tmp17_;
			gchar* _tmp18_;
			gchar* _tmp19_;
			gchar* _tmp20_;
			_item_index = _item_index + 1;
			_tmp12_ = _item_index;
			_tmp13_ = _item_size;
			if (!(_tmp12_ < _tmp13_)) {
				break;
			}
			_tmp14_ = _item_list;
			_tmp15_ = gee_abstract_list_get ((GeeAbstractList*) _tmp14_, _item_index);
			item = (ObjectsItem*) _tmp15_;
			_tmp16_ = text;
			_tmp17_ = item;
			_tmp18_ = objects_item_to_markdown (_tmp17_, 0);
			_tmp19_ = _tmp18_;
			_tmp20_ = g_strconcat (_tmp16_, _tmp19_, NULL);
			_g_free0 (text);
			text = _tmp20_;
			_g_free0 (_tmp19_);
			_g_object_unref0 (item);
		}
	}
	{
		GeeArrayList* _section_list = NULL;
		GeeArrayList* _tmp21_;
		GeeArrayList* _tmp22_;
		gint _section_size = 0;
		GeeArrayList* _tmp23_;
		gint _tmp24_;
		gint _tmp25_;
		gint _section_index = 0;
		_tmp21_ = objects_project_get_sections (self);
		_tmp22_ = _tmp21_;
		_section_list = _tmp22_;
		_tmp23_ = _section_list;
		_tmp24_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp23_);
		_tmp25_ = _tmp24_;
		_section_size = _tmp25_;
		_section_index = -1;
		while (TRUE) {
			gint _tmp26_;
			gint _tmp27_;
			ObjectsSection* section = NULL;
			GeeArrayList* _tmp28_;
			gpointer _tmp29_;
			const gchar* _tmp30_;
			gchar* _tmp31_;
			const gchar* _tmp32_;
			ObjectsSection* _tmp33_;
			const gchar* _tmp34_;
			const gchar* _tmp35_;
			gchar* _tmp36_;
			gchar* _tmp37_;
			gchar* _tmp38_;
			_section_index = _section_index + 1;
			_tmp26_ = _section_index;
			_tmp27_ = _section_size;
			if (!(_tmp26_ < _tmp27_)) {
				break;
			}
			_tmp28_ = _section_list;
			_tmp29_ = gee_abstract_list_get ((GeeAbstractList*) _tmp28_, _section_index);
			section = (ObjectsSection*) _tmp29_;
			_tmp30_ = text;
			_tmp31_ = g_strconcat (_tmp30_, "\n", NULL);
			_g_free0 (text);
			text = _tmp31_;
			_tmp32_ = text;
			_tmp33_ = section;
			_tmp34_ = objects_base_object_get_name ((ObjectsBaseObject*) _tmp33_);
			_tmp35_ = _tmp34_;
			_tmp36_ = g_strdup_printf ("### %s\n", _tmp35_);
			_tmp37_ = _tmp36_;
			_tmp38_ = g_strconcat (_tmp32_, _tmp37_, NULL);
			_g_free0 (text);
			text = _tmp38_;
			_g_free0 (_tmp37_);
			{
				GeeArrayList* _item_list = NULL;
				ObjectsSection* _tmp39_;
				GeeArrayList* _tmp40_;
				GeeArrayList* _tmp41_;
				gint _item_size = 0;
				GeeArrayList* _tmp42_;
				gint _tmp43_;
				gint _tmp44_;
				gint _item_index = 0;
				_tmp39_ = section;
				_tmp40_ = objects_section_get_items (_tmp39_);
				_tmp41_ = _tmp40_;
				_item_list = _tmp41_;
				_tmp42_ = _item_list;
				_tmp43_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp42_);
				_tmp44_ = _tmp43_;
				_item_size = _tmp44_;
				_item_index = -1;
				while (TRUE) {
					gint _tmp45_;
					gint _tmp46_;
					ObjectsItem* item = NULL;
					GeeArrayList* _tmp47_;
					gpointer _tmp48_;
					const gchar* _tmp49_;
					ObjectsItem* _tmp50_;
					gchar* _tmp51_;
					gchar* _tmp52_;
					gchar* _tmp53_;
					_item_index = _item_index + 1;
					_tmp45_ = _item_index;
					_tmp46_ = _item_size;
					if (!(_tmp45_ < _tmp46_)) {
						break;
					}
					_tmp47_ = _item_list;
					_tmp48_ = gee_abstract_list_get ((GeeAbstractList*) _tmp47_, _item_index);
					item = (ObjectsItem*) _tmp48_;
					_tmp49_ = text;
					_tmp50_ = item;
					_tmp51_ = objects_item_to_markdown (_tmp50_, 0);
					_tmp52_ = _tmp51_;
					_tmp53_ = g_strconcat (_tmp49_, _tmp52_, NULL);
					_g_free0 (text);
					text = _tmp53_;
					_g_free0 (_tmp52_);
					_g_object_unref0 (item);
				}
			}
			_g_object_unref0 (section);
		}
	}
	result = text;
	return result;
}

static void
__lambda61_ (ObjectsProject* self,
             const gchar* response)
{
	g_return_if_fail (response != NULL);
	if (g_strcmp0 (response, "delete") == 0) {
		objects_project_handle_project_deletion (self);
	}
}

static void
___lambda61__adw_alert_dialog_response (AdwAlertDialog* _sender,
                                        const gchar* response,
                                        gpointer self)
{
	__lambda61_ ((ObjectsProject*) self, response);
}

void
objects_project_delete_project (ObjectsProject* 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 Project %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_close_response (dialog, "cancel");
	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) ___lambda61__adw_alert_dialog_response, self, 0);
	_g_object_unref0 (dialog);
}

static void
objects_project_handle_project_deletion (ObjectsProject* self)
{
	SourceType _tmp0_;
	SourceType _tmp1_;
	SourceType _tmp3_;
	SourceType _tmp4_;
	g_return_if_fail (self != NULL);
	objects_base_object_set_loading ((ObjectsBaseObject*) self, TRUE);
	_tmp0_ = objects_project_get_source_type (self);
	_tmp1_ = _tmp0_;
	if (_tmp1_ == SOURCE_TYPE_LOCAL) {
		ServicesStore* _tmp2_;
		_tmp2_ = services_store_instance ();
		services_store_delete_project (_tmp2_, self, NULL, NULL);
		return;
	}
	_tmp3_ = objects_project_get_source_type (self);
	_tmp4_ = _tmp3_;
	if (_tmp4_ == SOURCE_TYPE_TODOIST) {
		objects_project_delete_from_todoist (self);
	} else {
		SourceType _tmp5_;
		SourceType _tmp6_;
		_tmp5_ = objects_project_get_source_type (self);
		_tmp6_ = _tmp5_;
		if (_tmp6_ == SOURCE_TYPE_CALDAV) {
			objects_project_delete_from_caldav (self);
		}
	}
}

static void
__lambda62_ (ObjectsProject* 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_delete_finish (_tmp1_, res);
	_tmp3_ = _tmp2_;
	objects_project_handle_remote_delete_response (self, _tmp3_);
	_http_response_unref0 (_tmp3_);
	_g_object_unref0 (_tmp1_);
}

static void
___lambda62__gasync_ready_callback (GObject* source_object,
                                    GAsyncResult* res,
                                    gpointer self)
{
	__lambda62_ ((ObjectsProject*) self, source_object, res);
	g_object_unref (self);
}

static void
objects_project_delete_from_todoist (ObjectsProject* self)
{
	ServicesTodoist* _tmp0_;
	ServicesTodoist* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = services_todoist_get_default ();
	_tmp1_ = _tmp0_;
	services_todoist_delete (_tmp1_, (ObjectsBaseObject*) self, ___lambda62__gasync_ready_callback, g_object_ref (self));
	_g_object_unref0 (_tmp1_);
}

static Block60Data*
block60_data_ref (Block60Data* _data60_)
{
	g_atomic_int_inc (&_data60_->_ref_count_);
	return _data60_;
}

static void
block60_data_unref (void * _userdata_)
{
	Block60Data* _data60_;
	_data60_ = (Block60Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data60_->_ref_count_)) {
		ObjectsProject* self;
		self = _data60_->self;
		_g_object_unref0 (_data60_->caldav_client);
		_g_object_unref0 (self);
		g_slice_free (Block60Data, _data60_);
	}
}

static void
__lambda63_ (Block60Data* _data60_,
             GObject* obj,
             GAsyncResult* res)
{
	ObjectsProject* self;
	HttpResponse* _tmp0_;
	HttpResponse* _tmp1_;
	self = _data60_->self;
	g_return_if_fail (res != NULL);
	_tmp0_ = services_cal_dav_cal_dav_client_delete_project_finish (_data60_->caldav_client, res);
	_tmp1_ = _tmp0_;
	objects_project_handle_remote_delete_response (self, _tmp1_);
	_http_response_unref0 (_tmp1_);
}

static void
___lambda63__gasync_ready_callback (GObject* source_object,
                                    GAsyncResult* res,
                                    gpointer self)
{
	__lambda63_ (self, source_object, res);
	block60_data_unref (self);
}

static void
objects_project_delete_from_caldav (ObjectsProject* self)
{
	Block60Data* _data60_;
	ServicesCalDAVCore* _tmp0_;
	ServicesCalDAVCore* _tmp1_;
	ObjectsSource* _tmp2_;
	ObjectsSource* _tmp3_;
	ServicesCalDAVCalDAVClient* _tmp4_;
	ServicesCalDAVCalDAVClient* _tmp5_;
	g_return_if_fail (self != NULL);
	_data60_ = g_slice_new0 (Block60Data);
	_data60_->_ref_count_ = 1;
	_data60_->self = g_object_ref (self);
	_tmp0_ = services_cal_dav_core_get_default ();
	_tmp1_ = _tmp0_;
	_tmp2_ = objects_project_get_source (self);
	_tmp3_ = _tmp2_;
	_tmp4_ = services_cal_dav_core_get_client (_tmp1_, _tmp3_);
	_tmp5_ = _tmp4_;
	_g_object_unref0 (_tmp1_);
	_data60_->caldav_client = _tmp5_;
	services_cal_dav_cal_dav_client_delete_project (_data60_->caldav_client, self, ___lambda63__gasync_ready_callback, block60_data_ref (_data60_));
	block60_data_unref (_data60_);
	_data60_ = NULL;
}

static void
objects_project_handle_remote_delete_response (ObjectsProject* self,
                                               HttpResponse* response)
{
	gboolean _tmp0_;
	gboolean _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (response != NULL);
	objects_base_object_set_loading ((ObjectsBaseObject*) self, FALSE);
	_tmp0_ = http_response_get_status (response);
	_tmp1_ = _tmp0_;
	if (_tmp1_) {
		ServicesStore* _tmp2_;
		_tmp2_ = services_store_instance ();
		services_store_delete_project (_tmp2_, self, NULL, NULL);
	} else {
		ServicesEventBus* _tmp3_;
		ServicesEventBus* _tmp4_;
		gint _tmp5_;
		gint _tmp6_;
		const gchar* _tmp7_;
		const gchar* _tmp8_;
		_tmp3_ = services_event_bus_get_default ();
		_tmp4_ = _tmp3_;
		_tmp5_ = http_response_get_error_code (response);
		_tmp6_ = _tmp5_;
		_tmp7_ = http_response_get_error (response);
		_tmp8_ = _tmp7_;
		g_signal_emit_by_name (_tmp4_, "send-error-toast", _tmp6_, _tmp8_);
		_g_object_unref0 (_tmp4_);
	}
}

static void
__lambda64_ (ObjectsProject* self,
             const gchar* response)
{
	g_return_if_fail (response != NULL);
	if (g_strcmp0 (response, "archive") == 0) {
		ServicesStore* _tmp0_;
		objects_project_set_is_archived (self, TRUE);
		_tmp0_ = services_store_instance ();
		services_store_archive_project (_tmp0_, self);
	}
}

static void
___lambda64__adw_alert_dialog_response (AdwAlertDialog* _sender,
                                        const gchar* response,
                                        gpointer self)
{
	__lambda64_ ((ObjectsProject*) self, response);
}

void
objects_project_archive_project (ObjectsProject* 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) ___lambda64__adw_alert_dialog_response, self, 0);
	_g_object_unref0 (dialog);
}

void
objects_project_unarchive_project (ObjectsProject* self)
{
	ServicesStore* _tmp0_;
	g_return_if_fail (self != NULL);
	objects_project_set_is_archived (self, FALSE);
	_tmp0_ = services_store_instance ();
	services_store_archive_project (_tmp0_, self);
}

ObjectsProject*
objects_project_duplicate (ObjectsProject* self)
{
	ObjectsProject* new_project = NULL;
	ObjectsProject* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	const gchar* _tmp4_;
	const gchar* _tmp5_;
	const gchar* _tmp6_;
	const gchar* _tmp7_;
	ProjectIconStyle _tmp8_;
	SourceType _tmp9_;
	const gchar* _tmp10_;
	ObjectsProject* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = objects_project_new ();
	new_project = _tmp0_;
	_tmp1_ = objects_base_object_get_name ((ObjectsBaseObject*) self);
	_tmp2_ = _tmp1_;
	objects_base_object_set_name ((ObjectsBaseObject*) new_project, _tmp2_);
	_tmp3_ = self->priv->_due_date;
	objects_project_set_due_date (new_project, _tmp3_);
	_tmp4_ = objects_base_object_get_color ((ObjectsBaseObject*) self);
	_tmp5_ = _tmp4_;
	objects_base_object_set_color ((ObjectsBaseObject*) new_project, _tmp5_);
	_tmp6_ = self->priv->_emoji;
	objects_project_set_emoji (new_project, _tmp6_);
	_tmp7_ = self->priv->_description;
	objects_project_set_description (new_project, _tmp7_);
	_tmp8_ = self->priv->_icon_style;
	objects_project_set_icon_style (new_project, _tmp8_);
	_tmp9_ = self->priv->_backend_type;
	objects_project_set_backend_type (new_project, _tmp9_);
	_tmp10_ = self->priv->_source_id;
	objects_project_set_source_id (new_project, _tmp10_);
	result = new_project;
	return result;
}

ObjectsProject*
objects_project_construct (GType object_type)
{
	ObjectsProject * self = NULL;
	self = (ObjectsProject*) objects_base_object_construct (object_type);
	return self;
}

ObjectsProject*
objects_project_new (void)
{
	return objects_project_construct (OBJECTS_TYPE_PROJECT);
}

gboolean
objects_project_get_freeze_update (ObjectsProject* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_freeze_update;
	return result;
}

void
objects_project_set_freeze_update (ObjectsProject* self,
                                   gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = objects_project_get_freeze_update (self);
	if (old_value != value) {
		self->priv->_freeze_update = value;
		g_object_notify_by_pspec ((GObject *) self, objects_project_properties[OBJECTS_PROJECT_FREEZE_UPDATE_PROPERTY]);
	}
}

const gchar*
objects_project_get_parent_id (ObjectsProject* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_parent_id;
	result = _tmp0_;
	return result;
}

void
objects_project_set_parent_id (ObjectsProject* self,
                               const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = objects_project_get_parent_id (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_parent_id);
		self->priv->_parent_id = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, objects_project_properties[OBJECTS_PROJECT_PARENT_ID_PROPERTY]);
	}
}

const gchar*
objects_project_get_due_date (ObjectsProject* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_due_date;
	result = _tmp0_;
	return result;
}

void
objects_project_set_due_date (ObjectsProject* self,
                              const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = objects_project_get_due_date (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_due_date);
		self->priv->_due_date = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, objects_project_properties[OBJECTS_PROJECT_DUE_DATE_PROPERTY]);
	}
}

const gchar*
objects_project_get_emoji (ObjectsProject* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_emoji;
	result = _tmp0_;
	return result;
}

void
objects_project_set_emoji (ObjectsProject* self,
                           const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = objects_project_get_emoji (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_emoji);
		self->priv->_emoji = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, objects_project_properties[OBJECTS_PROJECT_EMOJI_PROPERTY]);
	}
}

const gchar*
objects_project_get_description (ObjectsProject* 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_project_set_description (ObjectsProject* self,
                                 const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = objects_project_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_project_properties[OBJECTS_PROJECT_DESCRIPTION_PROPERTY]);
	}
}

ProjectIconStyle
objects_project_get_icon_style (ObjectsProject* self)
{
	ProjectIconStyle result;
	g_return_val_if_fail (self != NULL, 0);
	result = self->priv->_icon_style;
	return result;
}

void
objects_project_set_icon_style (ObjectsProject* self,
                                ProjectIconStyle value)
{
	ProjectIconStyle old_value;
	g_return_if_fail (self != NULL);
	old_value = objects_project_get_icon_style (self);
	if (old_value != value) {
		self->priv->_icon_style = value;
		g_object_notify_by_pspec ((GObject *) self, objects_project_properties[OBJECTS_PROJECT_ICON_STYLE_PROPERTY]);
	}
}

SourceType
objects_project_get_backend_type (ObjectsProject* self)
{
	SourceType result;
	g_return_val_if_fail (self != NULL, 0);
	result = self->priv->_backend_type;
	return result;
}

void
objects_project_set_backend_type (ObjectsProject* self,
                                  SourceType value)
{
	SourceType old_value;
	g_return_if_fail (self != NULL);
	old_value = objects_project_get_backend_type (self);
	if (old_value != value) {
		self->priv->_backend_type = value;
		g_object_notify_by_pspec ((GObject *) self, objects_project_properties[OBJECTS_PROJECT_BACKEND_TYPE_PROPERTY]);
	}
}

gboolean
objects_project_get_inbox_project (ObjectsProject* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_inbox_project;
	return result;
}

void
objects_project_set_inbox_project (ObjectsProject* self,
                                   gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = objects_project_get_inbox_project (self);
	if (old_value != value) {
		self->priv->_inbox_project = value;
		g_object_notify_by_pspec ((GObject *) self, objects_project_properties[OBJECTS_PROJECT_INBOX_PROJECT_PROPERTY]);
	}
}

gboolean
objects_project_get_team_inbox (ObjectsProject* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_team_inbox;
	return result;
}

void
objects_project_set_team_inbox (ObjectsProject* self,
                                gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = objects_project_get_team_inbox (self);
	if (old_value != value) {
		self->priv->_team_inbox = value;
		g_object_notify_by_pspec ((GObject *) self, objects_project_properties[OBJECTS_PROJECT_TEAM_INBOX_PROPERTY]);
	}
}

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

void
objects_project_set_is_deleted (ObjectsProject* self,
                                gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = objects_project_get_is_deleted (self);
	if (old_value != value) {
		self->priv->_is_deleted = value;
		g_object_notify_by_pspec ((GObject *) self, objects_project_properties[OBJECTS_PROJECT_IS_DELETED_PROPERTY]);
	}
}

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

void
objects_project_set_is_archived (ObjectsProject* self,
                                 gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = objects_project_get_is_archived (self);
	if (old_value != value) {
		self->priv->_is_archived = value;
		g_object_notify_by_pspec ((GObject *) self, objects_project_properties[OBJECTS_PROJECT_IS_ARCHIVED_PROPERTY]);
	}
}

gboolean
objects_project_get_is_favorite (ObjectsProject* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_is_favorite;
	return result;
}

void
objects_project_set_is_favorite (ObjectsProject* self,
                                 gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = objects_project_get_is_favorite (self);
	if (old_value != value) {
		self->priv->_is_favorite = value;
		g_object_notify_by_pspec ((GObject *) self, objects_project_properties[OBJECTS_PROJECT_IS_FAVORITE_PROPERTY]);
	}
}

gboolean
objects_project_get_shared (ObjectsProject* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_shared;
	return result;
}

void
objects_project_set_shared (ObjectsProject* self,
                            gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = objects_project_get_shared (self);
	if (old_value != value) {
		self->priv->_shared = value;
		g_object_notify_by_pspec ((GObject *) self, objects_project_properties[OBJECTS_PROJECT_SHARED_PROPERTY]);
	}
}

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

void
objects_project_set_collapsed (ObjectsProject* self,
                               gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = objects_project_get_collapsed (self);
	if (old_value != value) {
		self->priv->_collapsed = value;
		g_object_notify_by_pspec ((GObject *) self, objects_project_properties[OBJECTS_PROJECT_COLLAPSED_PROPERTY]);
	}
}

gboolean
objects_project_get_inbox_section_hidded (ObjectsProject* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_inbox_section_hidded;
	return result;
}

void
objects_project_set_inbox_section_hidded (ObjectsProject* self,
                                          gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = objects_project_get_inbox_section_hidded (self);
	if (old_value != value) {
		self->priv->_inbox_section_hidded = value;
		g_object_notify_by_pspec ((GObject *) self, objects_project_properties[OBJECTS_PROJECT_INBOX_SECTION_HIDDED_PROPERTY]);
	}
}

const gchar*
objects_project_get_sync_id (ObjectsProject* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_sync_id;
	result = _tmp0_;
	return result;
}

void
objects_project_set_sync_id (ObjectsProject* self,
                             const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = objects_project_get_sync_id (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_sync_id);
		self->priv->_sync_id = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, objects_project_properties[OBJECTS_PROJECT_SYNC_ID_PROPERTY]);
	}
}

const gchar*
objects_project_get_source_id (ObjectsProject* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_source_id;
	result = _tmp0_;
	return result;
}

void
objects_project_set_source_id (ObjectsProject* self,
                               const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = objects_project_get_source_id (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_source_id);
		self->priv->_source_id = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, objects_project_properties[OBJECTS_PROJECT_SOURCE_ID_PROPERTY]);
	}
}

const gchar*
objects_project_get_calendar_url (ObjectsProject* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_calendar_url;
	result = _tmp0_;
	return result;
}

void
objects_project_set_calendar_url (ObjectsProject* self,
                                  const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = objects_project_get_calendar_url (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_calendar_url);
		self->priv->_calendar_url = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, objects_project_properties[OBJECTS_PROJECT_CALENDAR_URL_PROPERTY]);
	}
}

const gchar*
objects_project_get_calendar_source_uid (ObjectsProject* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_calendar_source_uid;
	result = _tmp0_;
	return result;
}

void
objects_project_set_calendar_source_uid (ObjectsProject* self,
                                         const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = objects_project_get_calendar_source_uid (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_calendar_source_uid);
		self->priv->_calendar_source_uid = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, objects_project_properties[OBJECTS_PROJECT_CALENDAR_SOURCE_UID_PROPERTY]);
	}
}

MarkdownSetting
objects_project_get_markdown_setting (ObjectsProject* self)
{
	MarkdownSetting result;
	g_return_val_if_fail (self != NULL, 0);
	result = self->priv->_markdown_setting;
	return result;
}

void
objects_project_set_markdown_setting (ObjectsProject* self,
                                      MarkdownSetting value)
{
	MarkdownSetting old_value;
	g_return_if_fail (self != NULL);
	old_value = objects_project_get_markdown_setting (self);
	if (old_value != value) {
		self->priv->_markdown_setting = value;
		g_object_notify_by_pspec ((GObject *) self, objects_project_properties[OBJECTS_PROJECT_MARKDOWN_SETTING_PROPERTY]);
	}
}

gboolean
objects_project_get_is_markdown_enabled (ObjectsProject* self)
{
	gboolean result;
	MarkdownSetting _tmp0_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->_markdown_setting;
	switch (_tmp0_) {
		case MARKDOWN_SETTING_ENABLED:
		{
			result = TRUE;
			return result;
		}
		case MARKDOWN_SETTING_DISABLED:
		{
			result = FALSE;
			return result;
		}
		default:
		{
			ServicesSettings* _tmp1_;
			ServicesSettings* _tmp2_;
			GSettings* _tmp3_;
			gboolean _tmp4_;
			_tmp1_ = services_settings_get_default ();
			_tmp2_ = _tmp1_;
			_tmp3_ = _tmp2_->settings;
			_tmp4_ = g_settings_get_boolean (_tmp3_, "enable-markdown-formatting");
			_g_object_unref0 (_tmp2_);
			result = _tmp4_;
			return result;
		}
	}
}

gboolean
objects_project_get_show_completed (ObjectsProject* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_show_completed;
	return result;
}

void
objects_project_set_show_completed (ObjectsProject* self,
                                    gboolean value)
{
	g_return_if_fail (self != NULL);
	self->priv->_show_completed = value;
	g_signal_emit (self, objects_project_signals[OBJECTS_PROJECT_SHOW_COMPLETED_CHANGED_SIGNAL], 0);
	g_object_notify_by_pspec ((GObject *) self, objects_project_properties[OBJECTS_PROJECT_SHOW_COMPLETED_PROPERTY]);
}

ProjectViewStyle
objects_project_get_view_style (ObjectsProject* self)
{
	ProjectViewStyle result;
	g_return_val_if_fail (self != NULL, 0);
	result = self->priv->_view_style;
	return result;
}

void
objects_project_set_view_style (ObjectsProject* self,
                                ProjectViewStyle value)
{
	g_return_if_fail (self != NULL);
	self->priv->_view_style = value;
	g_signal_emit (self, objects_project_signals[OBJECTS_PROJECT_VIEW_STYLE_CHANGED_SIGNAL], 0);
	g_object_notify_by_pspec ((GObject *) self, objects_project_properties[OBJECTS_PROJECT_VIEW_STYLE_PROPERTY]);
}

SortedByType
objects_project_get_sorted_by (ObjectsProject* self)
{
	SortedByType result;
	g_return_val_if_fail (self != NULL, 0);
	result = self->priv->_sorted_by;
	return result;
}

void
objects_project_set_sorted_by (ObjectsProject* self,
                               SortedByType value)
{
	g_return_if_fail (self != NULL);
	self->priv->_sorted_by = value;
	g_signal_emit (self, objects_project_signals[OBJECTS_PROJECT_SORTED_BY_CHANGED_SIGNAL], 0);
	g_object_notify_by_pspec ((GObject *) self, objects_project_properties[OBJECTS_PROJECT_SORTED_BY_PROPERTY]);
}

SortOrderType
objects_project_get_sort_order (ObjectsProject* self)
{
	SortOrderType result;
	g_return_val_if_fail (self != NULL, 0);
	result = self->priv->_sort_order;
	return result;
}

void
objects_project_set_sort_order (ObjectsProject* self,
                                SortOrderType value)
{
	g_return_if_fail (self != NULL);
	self->priv->_sort_order = value;
	g_signal_emit (self, objects_project_signals[OBJECTS_PROJECT_SORT_ORDER_CHANGED_SIGNAL], 0);
	g_object_notify_by_pspec ((GObject *) self, objects_project_properties[OBJECTS_PROJECT_SORT_ORDER_PROPERTY]);
}

SourceType
objects_project_get_source_type (ObjectsProject* self)
{
	SourceType result;
	ObjectsSource* _tmp0_;
	ObjectsSource* _tmp1_;
	SourceType _tmp2_;
	SourceType _tmp3_;
	g_return_val_if_fail (self != NULL, 0);
	_tmp0_ = objects_project_get_source (self);
	_tmp1_ = _tmp0_;
	_tmp2_ = objects_source_get_source_type (_tmp1_);
	_tmp3_ = _tmp2_;
	result = _tmp3_;
	return result;
}

ObjectsSource*
objects_project_get_source (ObjectsProject* self)
{
	ObjectsSource* result;
	ServicesStore* _tmp0_;
	const gchar* _tmp1_;
	ObjectsSource* _tmp2_;
	ObjectsSource* _tmp3_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = services_store_instance ();
	_tmp1_ = self->priv->_source_id;
	_tmp2_ = services_store_get_source (_tmp0_, _tmp1_);
	_g_object_unref0 (self->priv->_source);
	self->priv->_source = _tmp2_;
	_tmp3_ = self->priv->_source;
	result = _tmp3_;
	return result;
}

const gchar*
objects_project_get_color_hex (ObjectsProject* 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_color ((ObjectsBaseObject*) self);
	_tmp3_ = _tmp2_;
	_tmp4_ = util_get_color (_tmp1_, _tmp3_);
	_g_free0 (self->priv->_color_hex);
	self->priv->_color_hex = _tmp4_;
	_g_object_unref0 (_tmp1_);
	_tmp5_ = self->priv->_color_hex;
	result = _tmp5_;
	return result;
}

gint
objects_project_get_child_order (ObjectsProject* self)
{
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	result = self->priv->_child_order;
	return result;
}

void
objects_project_set_child_order (ObjectsProject* self,
                                 gint value)
{
	gint old_value;
	g_return_if_fail (self != NULL);
	old_value = objects_project_get_child_order (self);
	if (old_value != value) {
		self->priv->_child_order = value;
		g_object_notify_by_pspec ((GObject *) self, objects_project_properties[OBJECTS_PROJECT_CHILD_ORDER_PROPERTY]);
	}
}

const gchar*
objects_project_get_view_id (ObjectsProject* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	const gchar* _tmp3_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = objects_base_object_get_id_string ((ObjectsBaseObject*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = g_strdup_printf ("project-%s", _tmp1_);
	_g_free0 (self->priv->_view_id);
	self->priv->_view_id = _tmp2_;
	_tmp3_ = self->priv->_view_id;
	result = _tmp3_;
	return result;
}

const gchar*
objects_project_get_parent_id_string (ObjectsProject* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	const gchar* _tmp3_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_parent_id;
	_tmp1_ = string_to_string (_tmp0_);
	_tmp2_ = g_strdup (_tmp1_);
	_g_free0 (self->priv->_parent_id_string);
	self->priv->_parent_id_string = _tmp2_;
	_tmp3_ = self->priv->_parent_id_string;
	result = _tmp3_;
	return result;
}

const gchar*
objects_project_get_short_name (ObjectsProject* 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;
}

gboolean
objects_project_get_is_inbox_project (ObjectsProject* self)
{
	gboolean result;
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	ServicesSettings* _tmp2_;
	ServicesSettings* _tmp3_;
	GSettings* _tmp4_;
	gchar* _tmp5_;
	gchar* _tmp6_;
	gboolean _tmp7_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = objects_base_object_get_id ((ObjectsBaseObject*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = services_settings_get_default ();
	_tmp3_ = _tmp2_;
	_tmp4_ = _tmp3_->settings;
	_tmp5_ = g_settings_get_string (_tmp4_, "local-inbox-project-id");
	_tmp6_ = _tmp5_;
	_tmp7_ = g_strcmp0 (_tmp1_, _tmp6_) == 0;
	_g_free0 (_tmp6_);
	_g_object_unref0 (_tmp3_);
	result = _tmp7_;
	return result;
}

GeeArrayList*
objects_project_get_sections (ObjectsProject* self)
{
	GeeArrayList* result;
	GeeArrayList* _tmp0_;
	GeeArrayList* _tmp3_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_sections;
	if (_tmp0_ == NULL) {
		ServicesStore* _tmp1_;
		GeeArrayList* _tmp2_;
		_tmp1_ = services_store_instance ();
		_tmp2_ = services_store_get_sections_by_project (_tmp1_, self);
		_g_object_unref0 (self->priv->_sections);
		self->priv->_sections = _tmp2_;
	}
	_tmp3_ = self->priv->_sections;
	result = _tmp3_;
	return result;
}

GeeArrayList*
objects_project_get_sections_archived (ObjectsProject* self)
{
	GeeArrayList* result;
	ServicesStore* _tmp0_;
	GeeArrayList* _tmp1_;
	GeeArrayList* _tmp2_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = services_store_instance ();
	_tmp1_ = services_store_get_sections_archived_by_project (_tmp0_, self);
	_g_object_unref0 (self->priv->_sections_archived);
	self->priv->_sections_archived = _tmp1_;
	_tmp2_ = self->priv->_sections_archived;
	result = _tmp2_;
	return result;
}

static gint
_objects_project_items___lambda27_ (ObjectsProject* self,
                                    ObjectsItem* a,
                                    ObjectsItem* b)
{
	gint comparison = 0;
	gint _tmp0_;
	gint _tmp1_;
	gint _tmp2_;
	gint _tmp3_;
	gint _tmp4_ = 0;
	SortOrderType _tmp5_;
	SortOrderType _tmp6_;
	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_;
	comparison = _tmp1_ - _tmp3_;
	_tmp5_ = objects_project_get_sort_order (self);
	_tmp6_ = _tmp5_;
	if (_tmp6_ == SORT_ORDER_TYPE_ASC) {
		_tmp4_ = comparison;
	} else {
		_tmp4_ = -comparison;
	}
	result = _tmp4_;
	return result;
}

static gint
__objects_project_items___lambda27__gcompare_data_func (gconstpointer a,
                                                        gconstpointer b,
                                                        gpointer self)
{
	gint result;
	result = _objects_project_items___lambda27_ ((ObjectsProject*) self, (ObjectsItem*) a, (ObjectsItem*) b);
	return result;
}

GeeArrayList*
objects_project_get_items (ObjectsProject* 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_project_items___lambda27__gcompare_data_func, g_object_ref (self), g_object_unref);
	_tmp3_ = self->priv->_items;
	result = _tmp3_;
	return result;
}

GeeArrayList*
objects_project_get_items_checked (ObjectsProject* self)
{
	GeeArrayList* result;
	ServicesStore* _tmp0_;
	GeeArrayList* _tmp1_;
	GeeArrayList* _tmp2_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = services_store_instance ();
	_tmp1_ = services_store_get_items_checked_by_project (_tmp0_, self);
	_g_object_unref0 (self->priv->_items_checked);
	self->priv->_items_checked = _tmp1_;
	_tmp2_ = self->priv->_items_checked;
	result = _tmp2_;
	return result;
}

GeeArrayList*
objects_project_get_all_items (ObjectsProject* self)
{
	GeeArrayList* result;
	ServicesStore* _tmp0_;
	GeeArrayList* _tmp1_;
	GeeArrayList* _tmp2_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = services_store_instance ();
	_tmp1_ = services_store_get_items_by_project (_tmp0_, self);
	_g_object_unref0 (self->priv->_all_items);
	self->priv->_all_items = _tmp1_;
	_tmp2_ = self->priv->_all_items;
	result = _tmp2_;
	return result;
}

GeeArrayList*
objects_project_get_items_pinned (ObjectsProject* self)
{
	GeeArrayList* result;
	ServicesStore* _tmp0_;
	GeeArrayList* _tmp1_;
	GeeArrayList* _tmp2_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = services_store_instance ();
	_tmp1_ = services_store_get_items_by_project_pinned (_tmp0_, self);
	_g_object_unref0 (self->priv->_items_pinned);
	self->priv->_items_pinned = _tmp1_;
	_tmp2_ = self->priv->_items_pinned;
	result = _tmp2_;
	return result;
}

GeeArrayList*
objects_project_get_subprojects (ObjectsProject* self)
{
	GeeArrayList* result;
	ServicesStore* _tmp0_;
	GeeArrayList* _tmp1_;
	GeeArrayList* _tmp2_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = services_store_instance ();
	_tmp1_ = services_store_get_subprojects (_tmp0_, self);
	_g_object_unref0 (self->priv->_subprojects);
	self->priv->_subprojects = _tmp1_;
	_tmp2_ = self->priv->_subprojects;
	result = _tmp2_;
	return result;
}

ObjectsProject*
objects_project_get_parent (ObjectsProject* 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->_parent_id;
	_tmp2_ = services_store_get_project (_tmp0_, _tmp1_);
	_g_object_unref0 (self->priv->_parent);
	self->priv->_parent = _tmp2_;
	_tmp3_ = self->priv->_parent;
	result = _tmp3_;
	return result;
}

gboolean
objects_project_get_show_multi_select (ObjectsProject* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_show_multi_select;
	return result;
}

void
objects_project_set_show_multi_select (ObjectsProject* self,
                                       gboolean value)
{
	g_return_if_fail (self != NULL);
	self->priv->_show_multi_select = value;
	g_signal_emit (self, objects_project_signals[OBJECTS_PROJECT_SHOW_MULTI_SELECT_CHANGE_SIGNAL], 0);
	g_object_notify_by_pspec ((GObject *) self, objects_project_properties[OBJECTS_PROJECT_SHOW_MULTI_SELECT_PROPERTY]);
}

static gboolean
string_contains (const gchar* self,
                 const gchar* needle)
{
	gchar* _tmp0_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (needle != NULL, FALSE);
	_tmp0_ = strstr ((gchar*) self, (gchar*) needle);
	result = _tmp0_ != NULL;
	return result;
}

gboolean
objects_project_get_is_deck (ObjectsProject* self)
{
	gboolean result;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gboolean _tmp3_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->_calendar_url;
	_tmp1_ = g_utf8_strdown (_tmp0_, (gssize) -1);
	_tmp2_ = _tmp1_;
	_tmp3_ = string_contains (_tmp2_, "deck--board");
	_g_free0 (_tmp2_);
	result = _tmp3_;
	return result;
}

static void
_objects_project___lambda65_ (ObjectsProject* 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_project_id (item);
	_tmp1_ = _tmp0_;
	_tmp2_ = objects_base_object_get_id ((ObjectsBaseObject*) self);
	_tmp3_ = _tmp2_;
	if (g_strcmp0 (_tmp1_, _tmp3_) == 0) {
		objects_base_object_count_update ((ObjectsBaseObject*) self);
	}
}

static void
__objects_project___lambda65__services_event_bus_checked_toggled (ServicesEventBus* _sender,
                                                                  ObjectsItem* item,
                                                                  gboolean old_checked,
                                                                  gpointer self)
{
	_objects_project___lambda65_ ((ObjectsProject*) self, item);
}

static void
_objects_project___lambda66_ (ObjectsProject* 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_project_id (item);
	_tmp1_ = _tmp0_;
	_tmp2_ = objects_base_object_get_id ((ObjectsBaseObject*) self);
	_tmp3_ = _tmp2_;
	if (g_strcmp0 (_tmp1_, _tmp3_) == 0) {
		objects_base_object_count_update ((ObjectsBaseObject*) self);
	}
}

static void
__objects_project___lambda66__services_store_item_deleted (ServicesStore* _sender,
                                                           ObjectsItem* item,
                                                           gpointer self)
{
	_objects_project___lambda66_ ((ObjectsProject*) self, item);
}

static void
_objects_project___lambda67_ (ObjectsProject* 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_project_id (item);
	_tmp1_ = _tmp0_;
	_tmp2_ = objects_base_object_get_id ((ObjectsBaseObject*) self);
	_tmp3_ = _tmp2_;
	if (g_strcmp0 (_tmp1_, _tmp3_) == 0) {
		objects_base_object_count_update ((ObjectsBaseObject*) self);
	}
}

static void
__objects_project___lambda67__services_store_item_added (ServicesStore* _sender,
                                                         ObjectsItem* item,
                                                         gboolean insert,
                                                         gpointer self)
{
	_objects_project___lambda67_ ((ObjectsProject*) self, item);
}

static void
_objects_project___lambda68_ (ObjectsProject* self,
                              ObjectsItem* item,
                              const gchar* old_project_id)
{
	gboolean _tmp0_ = FALSE;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	const gchar* _tmp4_;
	g_return_if_fail (item != NULL);
	g_return_if_fail (old_project_id != NULL);
	_tmp1_ = objects_item_get_project_id (item);
	_tmp2_ = _tmp1_;
	_tmp3_ = objects_base_object_get_id ((ObjectsBaseObject*) self);
	_tmp4_ = _tmp3_;
	if (g_strcmp0 (_tmp2_, _tmp4_) == 0) {
		_tmp0_ = TRUE;
	} else {
		const gchar* _tmp5_;
		const gchar* _tmp6_;
		_tmp5_ = objects_base_object_get_id ((ObjectsBaseObject*) self);
		_tmp6_ = _tmp5_;
		_tmp0_ = g_strcmp0 (old_project_id, _tmp6_) == 0;
	}
	if (_tmp0_) {
		objects_base_object_count_update ((ObjectsBaseObject*) self);
	}
}

static void
__objects_project___lambda68__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_project___lambda68_ ((ObjectsProject*) self, item, old_project_id);
}

static void
_objects_project___lambda69_ (ObjectsProject* self,
                              ObjectsSection* section,
                              const gchar* old_project_id)
{
	gboolean _tmp0_ = FALSE;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	const gchar* _tmp4_;
	g_return_if_fail (section != NULL);
	g_return_if_fail (old_project_id != NULL);
	_tmp1_ = objects_section_get_project_id (section);
	_tmp2_ = _tmp1_;
	_tmp3_ = objects_base_object_get_id ((ObjectsBaseObject*) self);
	_tmp4_ = _tmp3_;
	if (g_strcmp0 (_tmp2_, _tmp4_) == 0) {
		_tmp0_ = TRUE;
	} else {
		const gchar* _tmp5_;
		const gchar* _tmp6_;
		_tmp5_ = objects_base_object_get_id ((ObjectsBaseObject*) self);
		_tmp6_ = _tmp5_;
		_tmp0_ = g_strcmp0 (old_project_id, _tmp6_) == 0;
	}
	if (_tmp0_) {
		objects_base_object_count_update ((ObjectsBaseObject*) self);
	}
}

static void
__objects_project___lambda69__services_store_section_moved (ServicesStore* _sender,
                                                            ObjectsSection* section,
                                                            const gchar* old_project_id,
                                                            gpointer self)
{
	_objects_project___lambda69_ ((ObjectsProject*) self, section, old_project_id);
}

static void
_objects_project___lambda70_ (ObjectsProject* 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_project_id (item);
	_tmp1_ = _tmp0_;
	_tmp2_ = objects_base_object_get_id ((ObjectsBaseObject*) self);
	_tmp3_ = _tmp2_;
	if (g_strcmp0 (_tmp1_, _tmp3_) == 0) {
		objects_base_object_count_update ((ObjectsBaseObject*) self);
	}
}

static void
__objects_project___lambda70__services_store_item_archived (ServicesStore* _sender,
                                                            ObjectsItem* item,
                                                            gpointer self)
{
	_objects_project___lambda70_ ((ObjectsProject*) self, item);
}

static void
_objects_project___lambda71_ (ObjectsProject* 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_project_id (item);
	_tmp1_ = _tmp0_;
	_tmp2_ = objects_base_object_get_id ((ObjectsBaseObject*) self);
	_tmp3_ = _tmp2_;
	if (g_strcmp0 (_tmp1_, _tmp3_) == 0) {
		objects_base_object_count_update ((ObjectsBaseObject*) self);
	}
}

static void
__objects_project___lambda71__services_store_item_unarchived (ServicesStore* _sender,
                                                              ObjectsItem* item,
                                                              gpointer self)
{
	_objects_project___lambda71_ ((ObjectsProject*) self, item);
}

static GObject *
objects_project_constructor (GType type,
                             guint n_construct_properties,
                             GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	ObjectsProject * self;
	ServicesEventBus* _tmp0_;
	ServicesEventBus* _tmp1_;
	ServicesStore* _tmp2_;
	ServicesStore* _tmp3_;
	ServicesEventBus* _tmp4_;
	ServicesEventBus* _tmp5_;
	ServicesStore* _tmp6_;
	ServicesStore* _tmp7_;
	ServicesStore* _tmp8_;
	parent_class = G_OBJECT_CLASS (objects_project_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, OBJECTS_TYPE_PROJECT, ObjectsProject);
	_tmp0_ = services_event_bus_get_default ();
	_tmp1_ = _tmp0_;
	g_signal_connect_object (_tmp1_, "checked-toggled", (GCallback) __objects_project___lambda65__services_event_bus_checked_toggled, self, 0);
	_g_object_unref0 (_tmp1_);
	_tmp2_ = services_store_instance ();
	g_signal_connect_object (_tmp2_, "item-deleted", (GCallback) __objects_project___lambda66__services_store_item_deleted, self, 0);
	_tmp3_ = services_store_instance ();
	g_signal_connect_object (_tmp3_, "item-added", (GCallback) __objects_project___lambda67__services_store_item_added, self, 0);
	_tmp4_ = services_event_bus_get_default ();
	_tmp5_ = _tmp4_;
	g_signal_connect_object (_tmp5_, "item-moved", (GCallback) __objects_project___lambda68__services_event_bus_item_moved, self, 0);
	_g_object_unref0 (_tmp5_);
	_tmp6_ = services_store_instance ();
	g_signal_connect_object (_tmp6_, "section-moved", (GCallback) __objects_project___lambda69__services_store_section_moved, self, 0);
	_tmp7_ = services_store_instance ();
	g_signal_connect_object (_tmp7_, "item-archived", (GCallback) __objects_project___lambda70__services_store_item_archived, self, 0);
	_tmp8_ = services_store_instance ();
	g_signal_connect_object (_tmp8_, "item-unarchived", (GCallback) __objects_project___lambda71__services_store_item_unarchived, self, 0);
	return obj;
}

static void
objects_project_class_init (ObjectsProjectClass * klass,
                            gpointer klass_data)
{
	objects_project_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ObjectsProject_private_offset);
	((ObjectsBaseObjectClass *) klass)->get_add_json = (gchar* (*) (ObjectsBaseObject*, const gchar*, const gchar*)) objects_project_real_get_add_json;
	((ObjectsBaseObjectClass *) klass)->get_update_json = (gchar* (*) (ObjectsBaseObject*, const gchar*, const gchar*)) objects_project_real_get_update_json;
	((ObjectsBaseObjectClass *) klass)->to_json = (gchar* (*) (ObjectsBaseObject*)) objects_project_real_to_json;
	((ObjectsBaseObjectClass *) klass)->get_move_json = (gchar* (*) (ObjectsBaseObject*, const gchar*, const gchar*)) objects_project_real_get_move_json;
	((ObjectsBaseObjectClass *) klass)->count_update = (void (*) (ObjectsBaseObject*)) objects_project_real_count_update;
	((ObjectsBaseObjectClass *) klass)->update_count = (gint (*) (ObjectsBaseObject*)) objects_project_real_update_count;
	((ObjectsBaseObjectClass *) klass)->update_percentage = (gdouble (*) (ObjectsBaseObject*)) objects_project_real_update_percentage;
	G_OBJECT_CLASS (klass)->get_property = _vala_objects_project_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_objects_project_set_property;
	G_OBJECT_CLASS (klass)->constructor = objects_project_constructor;
	G_OBJECT_CLASS (klass)->finalize = objects_project_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), OBJECTS_PROJECT_FREEZE_UPDATE_PROPERTY, objects_project_properties[OBJECTS_PROJECT_FREEZE_UPDATE_PROPERTY] = g_param_spec_boolean ("freeze-update", "freeze-update", "freeze-update", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), OBJECTS_PROJECT_PARENT_ID_PROPERTY, objects_project_properties[OBJECTS_PROJECT_PARENT_ID_PROPERTY] = g_param_spec_string ("parent-id", "parent-id", "parent-id", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), OBJECTS_PROJECT_DUE_DATE_PROPERTY, objects_project_properties[OBJECTS_PROJECT_DUE_DATE_PROPERTY] = g_param_spec_string ("due-date", "due-date", "due-date", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), OBJECTS_PROJECT_EMOJI_PROPERTY, objects_project_properties[OBJECTS_PROJECT_EMOJI_PROPERTY] = g_param_spec_string ("emoji", "emoji", "emoji", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), OBJECTS_PROJECT_DESCRIPTION_PROPERTY, objects_project_properties[OBJECTS_PROJECT_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_PROJECT_ICON_STYLE_PROPERTY, objects_project_properties[OBJECTS_PROJECT_ICON_STYLE_PROPERTY] = g_param_spec_enum ("icon-style", "icon-style", "icon-style", TYPE_PROJECT_ICON_STYLE, PROJECT_ICON_STYLE_PROGRESS, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), OBJECTS_PROJECT_BACKEND_TYPE_PROPERTY, objects_project_properties[OBJECTS_PROJECT_BACKEND_TYPE_PROPERTY] = g_param_spec_enum ("backend-type", "backend-type", "backend-type", TYPE_SOURCE_TYPE, SOURCE_TYPE_NONE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), OBJECTS_PROJECT_INBOX_PROJECT_PROPERTY, objects_project_properties[OBJECTS_PROJECT_INBOX_PROJECT_PROPERTY] = g_param_spec_boolean ("inbox-project", "inbox-project", "inbox-project", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), OBJECTS_PROJECT_TEAM_INBOX_PROPERTY, objects_project_properties[OBJECTS_PROJECT_TEAM_INBOX_PROPERTY] = g_param_spec_boolean ("team-inbox", "team-inbox", "team-inbox", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), OBJECTS_PROJECT_IS_DELETED_PROPERTY, objects_project_properties[OBJECTS_PROJECT_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_PROJECT_IS_ARCHIVED_PROPERTY, objects_project_properties[OBJECTS_PROJECT_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_PROJECT_IS_FAVORITE_PROPERTY, objects_project_properties[OBJECTS_PROJECT_IS_FAVORITE_PROPERTY] = g_param_spec_boolean ("is-favorite", "is-favorite", "is-favorite", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), OBJECTS_PROJECT_SHARED_PROPERTY, objects_project_properties[OBJECTS_PROJECT_SHARED_PROPERTY] = g_param_spec_boolean ("shared", "shared", "shared", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), OBJECTS_PROJECT_COLLAPSED_PROPERTY, objects_project_properties[OBJECTS_PROJECT_COLLAPSED_PROPERTY] = g_param_spec_boolean ("collapsed", "collapsed", "collapsed", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), OBJECTS_PROJECT_INBOX_SECTION_HIDDED_PROPERTY, objects_project_properties[OBJECTS_PROJECT_INBOX_SECTION_HIDDED_PROPERTY] = g_param_spec_boolean ("inbox-section-hidded", "inbox-section-hidded", "inbox-section-hidded", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), OBJECTS_PROJECT_SYNC_ID_PROPERTY, objects_project_properties[OBJECTS_PROJECT_SYNC_ID_PROPERTY] = g_param_spec_string ("sync-id", "sync-id", "sync-id", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), OBJECTS_PROJECT_SOURCE_ID_PROPERTY, objects_project_properties[OBJECTS_PROJECT_SOURCE_ID_PROPERTY] = g_param_spec_string ("source-id", "source-id", "source-id", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), OBJECTS_PROJECT_CALENDAR_URL_PROPERTY, objects_project_properties[OBJECTS_PROJECT_CALENDAR_URL_PROPERTY] = g_param_spec_string ("calendar-url", "calendar-url", "calendar-url", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), OBJECTS_PROJECT_CALENDAR_SOURCE_UID_PROPERTY, objects_project_properties[OBJECTS_PROJECT_CALENDAR_SOURCE_UID_PROPERTY] = g_param_spec_string ("calendar-source-uid", "calendar-source-uid", "calendar-source-uid", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), OBJECTS_PROJECT_MARKDOWN_SETTING_PROPERTY, objects_project_properties[OBJECTS_PROJECT_MARKDOWN_SETTING_PROPERTY] = g_param_spec_enum ("markdown-setting", "markdown-setting", "markdown-setting", TYPE_MARKDOWN_SETTING, MARKDOWN_SETTING_GLOBAL_DEFAULT, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), OBJECTS_PROJECT_IS_MARKDOWN_ENABLED_PROPERTY, objects_project_properties[OBJECTS_PROJECT_IS_MARKDOWN_ENABLED_PROPERTY] = g_param_spec_boolean ("is-markdown-enabled", "is-markdown-enabled", "is-markdown-enabled", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), OBJECTS_PROJECT_SHOW_COMPLETED_PROPERTY, objects_project_properties[OBJECTS_PROJECT_SHOW_COMPLETED_PROPERTY] = g_param_spec_boolean ("show-completed", "show-completed", "show-completed", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), OBJECTS_PROJECT_VIEW_STYLE_PROPERTY, objects_project_properties[OBJECTS_PROJECT_VIEW_STYLE_PROPERTY] = g_param_spec_enum ("view-style", "view-style", "view-style", TYPE_PROJECT_VIEW_STYLE, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), OBJECTS_PROJECT_SORTED_BY_PROPERTY, objects_project_properties[OBJECTS_PROJECT_SORTED_BY_PROPERTY] = g_param_spec_enum ("sorted-by", "sorted-by", "sorted-by", TYPE_SORTED_BY_TYPE, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), OBJECTS_PROJECT_SORT_ORDER_PROPERTY, objects_project_properties[OBJECTS_PROJECT_SORT_ORDER_PROPERTY] = g_param_spec_enum ("sort-order", "sort-order", "sort-order", TYPE_SORT_ORDER_TYPE, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), OBJECTS_PROJECT_SOURCE_TYPE_PROPERTY, objects_project_properties[OBJECTS_PROJECT_SOURCE_TYPE_PROPERTY] = g_param_spec_enum ("source-type", "source-type", "source-type", TYPE_SOURCE_TYPE, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), OBJECTS_PROJECT_SOURCE_PROPERTY, objects_project_properties[OBJECTS_PROJECT_SOURCE_PROPERTY] = g_param_spec_object ("source", "source", "source", OBJECTS_TYPE_SOURCE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), OBJECTS_PROJECT_COLOR_HEX_PROPERTY, objects_project_properties[OBJECTS_PROJECT_COLOR_HEX_PROPERTY] = g_param_spec_string ("color-hex", "color-hex", "color-hex", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), OBJECTS_PROJECT_CHILD_ORDER_PROPERTY, objects_project_properties[OBJECTS_PROJECT_CHILD_ORDER_PROPERTY] = g_param_spec_int ("child-order", "child-order", "child-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_PROJECT_VIEW_ID_PROPERTY, objects_project_properties[OBJECTS_PROJECT_VIEW_ID_PROPERTY] = g_param_spec_string ("view-id", "view-id", "view-id", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), OBJECTS_PROJECT_PARENT_ID_STRING_PROPERTY, objects_project_properties[OBJECTS_PROJECT_PARENT_ID_STRING_PROPERTY] = g_param_spec_string ("parent-id-string", "parent-id-string", "parent-id-string", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), OBJECTS_PROJECT_SHORT_NAME_PROPERTY, objects_project_properties[OBJECTS_PROJECT_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_PROJECT_IS_INBOX_PROJECT_PROPERTY, objects_project_properties[OBJECTS_PROJECT_IS_INBOX_PROJECT_PROPERTY] = g_param_spec_boolean ("is-inbox-project", "is-inbox-project", "is-inbox-project", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), OBJECTS_PROJECT_SECTIONS_PROPERTY, objects_project_properties[OBJECTS_PROJECT_SECTIONS_PROPERTY] = g_param_spec_object ("sections", "sections", "sections", GEE_TYPE_ARRAY_LIST, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), OBJECTS_PROJECT_SECTIONS_ARCHIVED_PROPERTY, objects_project_properties[OBJECTS_PROJECT_SECTIONS_ARCHIVED_PROPERTY] = g_param_spec_object ("sections-archived", "sections-archived", "sections-archived", GEE_TYPE_ARRAY_LIST, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), OBJECTS_PROJECT_ITEMS_PROPERTY, objects_project_properties[OBJECTS_PROJECT_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_PROJECT_ITEMS_CHECKED_PROPERTY, objects_project_properties[OBJECTS_PROJECT_ITEMS_CHECKED_PROPERTY] = g_param_spec_object ("items-checked", "items-checked", "items-checked", GEE_TYPE_ARRAY_LIST, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), OBJECTS_PROJECT_ALL_ITEMS_PROPERTY, objects_project_properties[OBJECTS_PROJECT_ALL_ITEMS_PROPERTY] = g_param_spec_object ("all-items", "all-items", "all-items", GEE_TYPE_ARRAY_LIST, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), OBJECTS_PROJECT_ITEMS_PINNED_PROPERTY, objects_project_properties[OBJECTS_PROJECT_ITEMS_PINNED_PROPERTY] = g_param_spec_object ("items-pinned", "items-pinned", "items-pinned", GEE_TYPE_ARRAY_LIST, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), OBJECTS_PROJECT_SUBPROJECTS_PROPERTY, objects_project_properties[OBJECTS_PROJECT_SUBPROJECTS_PROPERTY] = g_param_spec_object ("subprojects", "subprojects", "subprojects", GEE_TYPE_ARRAY_LIST, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), OBJECTS_PROJECT_PARENT_PROPERTY, objects_project_properties[OBJECTS_PROJECT_PARENT_PROPERTY] = g_param_spec_object ("parent", "parent", "parent", OBJECTS_TYPE_PROJECT, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), OBJECTS_PROJECT_SHOW_MULTI_SELECT_PROPERTY, objects_project_properties[OBJECTS_PROJECT_SHOW_MULTI_SELECT_PROPERTY] = g_param_spec_boolean ("show-multi-select", "show-multi-select", "show-multi-select", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), OBJECTS_PROJECT_IS_DECK_PROPERTY, objects_project_properties[OBJECTS_PROJECT_IS_DECK_PROPERTY] = g_param_spec_boolean ("is-deck", "is-deck", "is-deck", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	objects_project_signals[OBJECTS_PROJECT_SECTION_ADDED_SIGNAL] = g_signal_new ("section-added", OBJECTS_TYPE_PROJECT, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, OBJECTS_TYPE_SECTION);
	objects_project_signals[OBJECTS_PROJECT_SUBPROJECT_ADDED_SIGNAL] = g_signal_new ("subproject-added", OBJECTS_TYPE_PROJECT, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, OBJECTS_TYPE_PROJECT);
	objects_project_signals[OBJECTS_PROJECT_ITEM_ADDED_SIGNAL] = g_signal_new ("item-added", OBJECTS_TYPE_PROJECT, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, OBJECTS_TYPE_ITEM);
	objects_project_signals[OBJECTS_PROJECT_ITEM_DELETED_SIGNAL] = g_signal_new ("item-deleted", OBJECTS_TYPE_PROJECT, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, OBJECTS_TYPE_ITEM);
	objects_project_signals[OBJECTS_PROJECT_SHOW_COMPLETED_CHANGED_SIGNAL] = g_signal_new ("show-completed-changed", OBJECTS_TYPE_PROJECT, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	objects_project_signals[OBJECTS_PROJECT_SORT_ORDER_CHANGED_SIGNAL] = g_signal_new ("sort-order-changed", OBJECTS_TYPE_PROJECT, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	objects_project_signals[OBJECTS_PROJECT_SORTED_BY_CHANGED_SIGNAL] = g_signal_new ("sorted-by-changed", OBJECTS_TYPE_PROJECT, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	objects_project_signals[OBJECTS_PROJECT_SECTION_SORT_ORDER_CHANGED_SIGNAL] = g_signal_new ("section-sort-order-changed", OBJECTS_TYPE_PROJECT, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	objects_project_signals[OBJECTS_PROJECT_VIEW_STYLE_CHANGED_SIGNAL] = g_signal_new ("view-style-changed", OBJECTS_TYPE_PROJECT, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	objects_project_signals[OBJECTS_PROJECT_SYNC_STARTED_SIGNAL] = g_signal_new ("sync-started", OBJECTS_TYPE_PROJECT, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	objects_project_signals[OBJECTS_PROJECT_SYNC_FINISHED_SIGNAL] = g_signal_new ("sync-finished", OBJECTS_TYPE_PROJECT, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	objects_project_signals[OBJECTS_PROJECT_LOADING_CHANGED_SIGNAL] = g_signal_new ("loading-changed", OBJECTS_TYPE_PROJECT, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__BOOLEAN, G_TYPE_NONE, 1, G_TYPE_BOOLEAN);
	objects_project_signals[OBJECTS_PROJECT_SHOW_MULTI_SELECT_CHANGE_SIGNAL] = g_signal_new ("show-multi-select-change", OBJECTS_TYPE_PROJECT, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
}

static void
objects_project_instance_init (ObjectsProject * self,
                               gpointer klass)
{
	gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	gchar* _tmp6_;
	gchar* _tmp7_;
	self->priv = objects_project_get_instance_private (self);
	self->priv->_freeze_update = FALSE;
	_tmp0_ = g_strdup ("");
	self->priv->_parent_id = _tmp0_;
	_tmp1_ = g_strdup ("");
	self->priv->_due_date = _tmp1_;
	_tmp2_ = g_strdup ("");
	self->priv->_emoji = _tmp2_;
	_tmp3_ = g_strdup ("");
	self->priv->_description = _tmp3_;
	self->priv->_icon_style = PROJECT_ICON_STYLE_PROGRESS;
	self->priv->_backend_type = SOURCE_TYPE_NONE;
	self->priv->_inbox_project = FALSE;
	self->priv->_team_inbox = FALSE;
	self->priv->_is_deleted = FALSE;
	self->priv->_is_archived = FALSE;
	self->priv->_is_favorite = FALSE;
	self->priv->_shared = FALSE;
	self->priv->_collapsed = FALSE;
	self->priv->_inbox_section_hidded = FALSE;
	_tmp4_ = g_strdup ("");
	self->priv->_sync_id = _tmp4_;
	_tmp5_ = source_type_to_string (SOURCE_TYPE_LOCAL);
	self->priv->_source_id = _tmp5_;
	_tmp6_ = g_strdup ("");
	self->priv->_calendar_url = _tmp6_;
	_tmp7_ = g_strdup ("");
	self->priv->_calendar_source_uid = _tmp7_;
	self->priv->_markdown_setting = MARKDOWN_SETTING_GLOBAL_DEFAULT;
	self->priv->_show_completed = FALSE;
	self->priv->_view_style = PROJECT_VIEW_STYLE_LIST;
	self->priv->_sorted_by = SORTED_BY_TYPE_MANUAL;
	self->priv->_sort_order = SORT_ORDER_TYPE_ASC;
	self->priv->_child_order = 0;
	g_rec_mutex_init (&self->priv->__lock__sections);
	self->priv->_sections = NULL;
	g_rec_mutex_init (&self->priv->__lock__items);
	g_rec_mutex_init (&self->priv->__lock__subprojects);
	self->priv->_show_multi_select = FALSE;
	g_rec_mutex_init (&self->priv->__lock_subprojects);
}

static void
objects_project_finalize (GObject * obj)
{
	ObjectsProject * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, OBJECTS_TYPE_PROJECT, ObjectsProject);
	_g_free0 (self->priv->_parent_id);
	_g_free0 (self->priv->_due_date);
	_g_free0 (self->priv->_emoji);
	_g_free0 (self->priv->_description);
	_g_free0 (self->priv->_sync_id);
	_g_free0 (self->priv->_source_id);
	_g_free0 (self->priv->_calendar_url);
	_g_free0 (self->priv->_calendar_source_uid);
	_g_object_unref0 (self->priv->_source);
	_g_free0 (self->priv->_color_hex);
	_g_free0 (self->priv->_view_id);
	_g_free0 (self->priv->_parent_id_string);
	_g_free0 (self->priv->_short_name);
	g_rec_mutex_clear (&self->priv->__lock__sections);
	_g_object_unref0 (self->priv->_sections);
	_g_object_unref0 (self->priv->_sections_archived);
	g_rec_mutex_clear (&self->priv->__lock__items);
	_g_object_unref0 (self->priv->_items);
	_g_object_unref0 (self->priv->_items_checked);
	_g_object_unref0 (self->priv->_all_items);
	_g_object_unref0 (self->priv->_items_pinned);
	g_rec_mutex_clear (&self->priv->__lock__subprojects);
	_g_object_unref0 (self->priv->_subprojects);
	_g_object_unref0 (self->priv->_parent);
	g_rec_mutex_clear (&self->priv->__lock_subprojects);
	G_OBJECT_CLASS (objects_project_parent_class)->finalize (obj);
}

static GType
objects_project_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ObjectsProjectClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) objects_project_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ObjectsProject), 0, (GInstanceInitFunc) objects_project_instance_init, NULL };
	GType objects_project_type_id;
	objects_project_type_id = g_type_register_static (OBJECTS_TYPE_BASE_OBJECT, "ObjectsProject", &g_define_type_info, 0);
	ObjectsProject_private_offset = g_type_add_instance_private (objects_project_type_id, sizeof (ObjectsProjectPrivate));
	return objects_project_type_id;
}

GType
objects_project_get_type (void)
{
	static volatile gsize objects_project_type_id__once = 0;
	if (g_once_init_enter (&objects_project_type_id__once)) {
		GType objects_project_type_id;
		objects_project_type_id = objects_project_get_type_once ();
		g_once_init_leave (&objects_project_type_id__once, objects_project_type_id);
	}
	return objects_project_type_id__once;
}

static void
_vala_objects_project_get_property (GObject * object,
                                    guint property_id,
                                    GValue * value,
                                    GParamSpec * pspec)
{
	ObjectsProject * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, OBJECTS_TYPE_PROJECT, ObjectsProject);
	switch (property_id) {
		case OBJECTS_PROJECT_FREEZE_UPDATE_PROPERTY:
		g_value_set_boolean (value, objects_project_get_freeze_update (self));
		break;
		case OBJECTS_PROJECT_PARENT_ID_PROPERTY:
		g_value_set_string (value, objects_project_get_parent_id (self));
		break;
		case OBJECTS_PROJECT_DUE_DATE_PROPERTY:
		g_value_set_string (value, objects_project_get_due_date (self));
		break;
		case OBJECTS_PROJECT_EMOJI_PROPERTY:
		g_value_set_string (value, objects_project_get_emoji (self));
		break;
		case OBJECTS_PROJECT_DESCRIPTION_PROPERTY:
		g_value_set_string (value, objects_project_get_description (self));
		break;
		case OBJECTS_PROJECT_ICON_STYLE_PROPERTY:
		g_value_set_enum (value, objects_project_get_icon_style (self));
		break;
		case OBJECTS_PROJECT_BACKEND_TYPE_PROPERTY:
		g_value_set_enum (value, objects_project_get_backend_type (self));
		break;
		case OBJECTS_PROJECT_INBOX_PROJECT_PROPERTY:
		g_value_set_boolean (value, objects_project_get_inbox_project (self));
		break;
		case OBJECTS_PROJECT_TEAM_INBOX_PROPERTY:
		g_value_set_boolean (value, objects_project_get_team_inbox (self));
		break;
		case OBJECTS_PROJECT_IS_DELETED_PROPERTY:
		g_value_set_boolean (value, objects_project_get_is_deleted (self));
		break;
		case OBJECTS_PROJECT_IS_ARCHIVED_PROPERTY:
		g_value_set_boolean (value, objects_project_get_is_archived (self));
		break;
		case OBJECTS_PROJECT_IS_FAVORITE_PROPERTY:
		g_value_set_boolean (value, objects_project_get_is_favorite (self));
		break;
		case OBJECTS_PROJECT_SHARED_PROPERTY:
		g_value_set_boolean (value, objects_project_get_shared (self));
		break;
		case OBJECTS_PROJECT_COLLAPSED_PROPERTY:
		g_value_set_boolean (value, objects_project_get_collapsed (self));
		break;
		case OBJECTS_PROJECT_INBOX_SECTION_HIDDED_PROPERTY:
		g_value_set_boolean (value, objects_project_get_inbox_section_hidded (self));
		break;
		case OBJECTS_PROJECT_SYNC_ID_PROPERTY:
		g_value_set_string (value, objects_project_get_sync_id (self));
		break;
		case OBJECTS_PROJECT_SOURCE_ID_PROPERTY:
		g_value_set_string (value, objects_project_get_source_id (self));
		break;
		case OBJECTS_PROJECT_CALENDAR_URL_PROPERTY:
		g_value_set_string (value, objects_project_get_calendar_url (self));
		break;
		case OBJECTS_PROJECT_CALENDAR_SOURCE_UID_PROPERTY:
		g_value_set_string (value, objects_project_get_calendar_source_uid (self));
		break;
		case OBJECTS_PROJECT_MARKDOWN_SETTING_PROPERTY:
		g_value_set_enum (value, objects_project_get_markdown_setting (self));
		break;
		case OBJECTS_PROJECT_IS_MARKDOWN_ENABLED_PROPERTY:
		g_value_set_boolean (value, objects_project_get_is_markdown_enabled (self));
		break;
		case OBJECTS_PROJECT_SHOW_COMPLETED_PROPERTY:
		g_value_set_boolean (value, objects_project_get_show_completed (self));
		break;
		case OBJECTS_PROJECT_VIEW_STYLE_PROPERTY:
		g_value_set_enum (value, objects_project_get_view_style (self));
		break;
		case OBJECTS_PROJECT_SORTED_BY_PROPERTY:
		g_value_set_enum (value, objects_project_get_sorted_by (self));
		break;
		case OBJECTS_PROJECT_SORT_ORDER_PROPERTY:
		g_value_set_enum (value, objects_project_get_sort_order (self));
		break;
		case OBJECTS_PROJECT_SOURCE_TYPE_PROPERTY:
		g_value_set_enum (value, objects_project_get_source_type (self));
		break;
		case OBJECTS_PROJECT_SOURCE_PROPERTY:
		g_value_set_object (value, objects_project_get_source (self));
		break;
		case OBJECTS_PROJECT_COLOR_HEX_PROPERTY:
		g_value_set_string (value, objects_project_get_color_hex (self));
		break;
		case OBJECTS_PROJECT_CHILD_ORDER_PROPERTY:
		g_value_set_int (value, objects_project_get_child_order (self));
		break;
		case OBJECTS_PROJECT_VIEW_ID_PROPERTY:
		g_value_set_string (value, objects_project_get_view_id (self));
		break;
		case OBJECTS_PROJECT_PARENT_ID_STRING_PROPERTY:
		g_value_set_string (value, objects_project_get_parent_id_string (self));
		break;
		case OBJECTS_PROJECT_SHORT_NAME_PROPERTY:
		g_value_set_string (value, objects_project_get_short_name (self));
		break;
		case OBJECTS_PROJECT_IS_INBOX_PROJECT_PROPERTY:
		g_value_set_boolean (value, objects_project_get_is_inbox_project (self));
		break;
		case OBJECTS_PROJECT_SECTIONS_PROPERTY:
		g_value_set_object (value, objects_project_get_sections (self));
		break;
		case OBJECTS_PROJECT_SECTIONS_ARCHIVED_PROPERTY:
		g_value_set_object (value, objects_project_get_sections_archived (self));
		break;
		case OBJECTS_PROJECT_ITEMS_PROPERTY:
		g_value_set_object (value, objects_project_get_items (self));
		break;
		case OBJECTS_PROJECT_ITEMS_CHECKED_PROPERTY:
		g_value_set_object (value, objects_project_get_items_checked (self));
		break;
		case OBJECTS_PROJECT_ALL_ITEMS_PROPERTY:
		g_value_set_object (value, objects_project_get_all_items (self));
		break;
		case OBJECTS_PROJECT_ITEMS_PINNED_PROPERTY:
		g_value_set_object (value, objects_project_get_items_pinned (self));
		break;
		case OBJECTS_PROJECT_SUBPROJECTS_PROPERTY:
		g_value_set_object (value, objects_project_get_subprojects (self));
		break;
		case OBJECTS_PROJECT_PARENT_PROPERTY:
		g_value_set_object (value, objects_project_get_parent (self));
		break;
		case OBJECTS_PROJECT_SHOW_MULTI_SELECT_PROPERTY:
		g_value_set_boolean (value, objects_project_get_show_multi_select (self));
		break;
		case OBJECTS_PROJECT_IS_DECK_PROPERTY:
		g_value_set_boolean (value, objects_project_get_is_deck (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_objects_project_set_property (GObject * object,
                                    guint property_id,
                                    const GValue * value,
                                    GParamSpec * pspec)
{
	ObjectsProject * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, OBJECTS_TYPE_PROJECT, ObjectsProject);
	switch (property_id) {
		case OBJECTS_PROJECT_FREEZE_UPDATE_PROPERTY:
		objects_project_set_freeze_update (self, g_value_get_boolean (value));
		break;
		case OBJECTS_PROJECT_PARENT_ID_PROPERTY:
		objects_project_set_parent_id (self, g_value_get_string (value));
		break;
		case OBJECTS_PROJECT_DUE_DATE_PROPERTY:
		objects_project_set_due_date (self, g_value_get_string (value));
		break;
		case OBJECTS_PROJECT_EMOJI_PROPERTY:
		objects_project_set_emoji (self, g_value_get_string (value));
		break;
		case OBJECTS_PROJECT_DESCRIPTION_PROPERTY:
		objects_project_set_description (self, g_value_get_string (value));
		break;
		case OBJECTS_PROJECT_ICON_STYLE_PROPERTY:
		objects_project_set_icon_style (self, g_value_get_enum (value));
		break;
		case OBJECTS_PROJECT_BACKEND_TYPE_PROPERTY:
		objects_project_set_backend_type (self, g_value_get_enum (value));
		break;
		case OBJECTS_PROJECT_INBOX_PROJECT_PROPERTY:
		objects_project_set_inbox_project (self, g_value_get_boolean (value));
		break;
		case OBJECTS_PROJECT_TEAM_INBOX_PROPERTY:
		objects_project_set_team_inbox (self, g_value_get_boolean (value));
		break;
		case OBJECTS_PROJECT_IS_DELETED_PROPERTY:
		objects_project_set_is_deleted (self, g_value_get_boolean (value));
		break;
		case OBJECTS_PROJECT_IS_ARCHIVED_PROPERTY:
		objects_project_set_is_archived (self, g_value_get_boolean (value));
		break;
		case OBJECTS_PROJECT_IS_FAVORITE_PROPERTY:
		objects_project_set_is_favorite (self, g_value_get_boolean (value));
		break;
		case OBJECTS_PROJECT_SHARED_PROPERTY:
		objects_project_set_shared (self, g_value_get_boolean (value));
		break;
		case OBJECTS_PROJECT_COLLAPSED_PROPERTY:
		objects_project_set_collapsed (self, g_value_get_boolean (value));
		break;
		case OBJECTS_PROJECT_INBOX_SECTION_HIDDED_PROPERTY:
		objects_project_set_inbox_section_hidded (self, g_value_get_boolean (value));
		break;
		case OBJECTS_PROJECT_SYNC_ID_PROPERTY:
		objects_project_set_sync_id (self, g_value_get_string (value));
		break;
		case OBJECTS_PROJECT_SOURCE_ID_PROPERTY:
		objects_project_set_source_id (self, g_value_get_string (value));
		break;
		case OBJECTS_PROJECT_CALENDAR_URL_PROPERTY:
		objects_project_set_calendar_url (self, g_value_get_string (value));
		break;
		case OBJECTS_PROJECT_CALENDAR_SOURCE_UID_PROPERTY:
		objects_project_set_calendar_source_uid (self, g_value_get_string (value));
		break;
		case OBJECTS_PROJECT_MARKDOWN_SETTING_PROPERTY:
		objects_project_set_markdown_setting (self, g_value_get_enum (value));
		break;
		case OBJECTS_PROJECT_SHOW_COMPLETED_PROPERTY:
		objects_project_set_show_completed (self, g_value_get_boolean (value));
		break;
		case OBJECTS_PROJECT_VIEW_STYLE_PROPERTY:
		objects_project_set_view_style (self, g_value_get_enum (value));
		break;
		case OBJECTS_PROJECT_SORTED_BY_PROPERTY:
		objects_project_set_sorted_by (self, g_value_get_enum (value));
		break;
		case OBJECTS_PROJECT_SORT_ORDER_PROPERTY:
		objects_project_set_sort_order (self, g_value_get_enum (value));
		break;
		case OBJECTS_PROJECT_CHILD_ORDER_PROPERTY:
		objects_project_set_child_order (self, g_value_get_int (value));
		break;
		case OBJECTS_PROJECT_SHOW_MULTI_SELECT_PROPERTY:
		objects_project_set_show_multi_select (self, g_value_get_boolean (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_array_destroy (gpointer array,
                     gssize array_length,
                     GDestroyNotify destroy_func)
{
	if ((array != NULL) && (destroy_func != NULL)) {
		gssize i;
		for (i = 0; i < array_length; i = i + 1) {
			if (((gpointer*) array)[i] != NULL) {
				destroy_func (((gpointer*) array)[i]);
			}
		}
	}
}

static void
_vala_array_free (gpointer array,
                  gssize array_length,
                  GDestroyNotify destroy_func)
{
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}

static gssize
_vala_array_length (gpointer array)
{
	gssize length;
	length = 0;
	if (array) {
		while (((gpointer*) array)[length]) {
			length++;
		}
	}
	return length;
}

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;
}

