Exemplo n.º 1
0
gboolean yatla_layout_load_layout (YatlaLayout* self, YatlaSidebar* sidebar, const gchar* list_name) {
	gboolean result = FALSE;
	Block4Data* _data4_;
	YatlaSidebar* _tmp0_ = NULL;
	YatlaSidebar* _tmp1_ = NULL;
	const gchar* _tmp2_ = NULL;
	gchar* _tmp3_ = NULL;
	const gchar* _tmp4_ = NULL;
	gchar* _tmp5_ = NULL;
	GtkBox* _tmp6_ = NULL;
	const gchar* _tmp7_ = NULL;
	GtkLabel* _tmp8_ = NULL;
	GtkLabel* _tmp9_ = NULL;
	GtkLabel* _tmp10_ = NULL;
	GtkLabel* _tmp11_ = NULL;
	const gchar* _tmp12_ = NULL;
	gchar* _tmp13_ = NULL;
	gchar* _tmp14_ = NULL;
	GtkBox* _tmp15_ = NULL;
	GtkLabel* _tmp16_ = NULL;
	GtkBox* _tmp17_ = NULL;
	GtkEntry* _tmp18_ = NULL;
	GtkEntry* _tmp19_ = NULL;
	GtkEntry* _tmp20_ = NULL;
	GtkBox* _tmp21_ = NULL;
	GtkEntry* _tmp22_ = NULL;
	GtkBox* _tmp23_ = NULL;
	gint list_index = 0;
	YatlaSidebar* _tmp24_ = NULL;
	GList* _tmp25_ = NULL;
	gint task_index = 0;
	guint the_longest_task = 0U;
	GtkBox* _tmp122_ = NULL;
	GtkBox* _tmp123_ = NULL;
	GtkBox* _tmp124_ = NULL;
	guint _tmp125_ = 0U;
	GeeTreeMap* _tmp126_ = NULL;
	GeeCollection* _tmp127_ = NULL;
	GeeCollection* _tmp128_ = NULL;
	GeeCollection* _tmp129_ = NULL;
	gint _tmp130_ = 0;
	gint _tmp131_ = 0;
	GtkEntry* _tmp132_ = NULL;
	GeeMapIterator* map_iterator = NULL;
	GeeTreeMap* _tmp133_ = NULL;
	GeeMapIterator* _tmp134_ = NULL;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (sidebar != NULL, FALSE);
	g_return_val_if_fail (list_name != NULL, FALSE);
	_data4_ = g_slice_new0 (Block4Data);
	_data4_->_ref_count_ = 1;
	_data4_->self = g_object_ref (self);
	_tmp0_ = sidebar;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	_g_object_unref0 (_data4_->sidebar);
	_data4_->sidebar = _tmp1_;
	_tmp2_ = list_name;
	_tmp3_ = g_strdup (_tmp2_);
	_g_free0 (_data4_->list_name);
	_data4_->list_name = _tmp3_;
	_tmp4_ = _data4_->list_name;
	_tmp5_ = g_strdup (_tmp4_);
	_g_free0 (self->_name);
	self->_name = _tmp5_;
	_tmp6_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 10);
	g_object_ref_sink (_tmp6_);
	_g_object_unref0 (self->_top_box1);
	self->_top_box1 = _tmp6_;
	_tmp7_ = _data4_->list_name;
	_tmp8_ = (GtkLabel*) gtk_label_new (_tmp7_);
	g_object_ref_sink (_tmp8_);
	_g_object_unref0 (self->_list_name);
	self->_list_name = _tmp8_;
	_tmp9_ = self->_list_name;
	gtk_label_set_use_markup (_tmp9_, TRUE);
	_tmp10_ = self->_list_name;
	_tmp11_ = self->_list_name;
	_tmp12_ = gtk_label_get_text (_tmp11_);
	_tmp13_ = g_strdup_printf ("<span font='14'><b>%s</b></span>", _tmp12_);
	_tmp14_ = _tmp13_;
	gtk_label_set_markup (_tmp10_, _tmp14_);
	_g_free0 (_tmp14_);
	_tmp15_ = self->_top_box1;
	_tmp16_ = self->_list_name;
	gtk_box_pack_start (_tmp15_, (GtkWidget*) _tmp16_, TRUE, TRUE, (guint) 0);
	_tmp17_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 10);
	g_object_ref_sink (_tmp17_);
	_g_object_unref0 (self->_top_box2);
	self->_top_box2 = _tmp17_;
	_tmp18_ = (GtkEntry*) gtk_entry_new ();
	g_object_ref_sink (_tmp18_);
	_g_object_unref0 (self->new_task_entry);
	self->new_task_entry = _tmp18_;
	_tmp19_ = self->new_task_entry;
	gtk_entry_set_placeholder_text (_tmp19_, "Add new task");
	_tmp20_ = self->new_task_entry;
	gtk_entry_set_icon_from_stock (_tmp20_, GTK_ENTRY_ICON_SECONDARY, "gtk-edit");
	_tmp21_ = self->_top_box2;
	_tmp22_ = self->new_task_entry;
	gtk_box_pack_start (_tmp21_, (GtkWidget*) _tmp22_, TRUE, TRUE, (guint) 0);
	_tmp23_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 10);
	g_object_ref_sink (_tmp23_);
	_g_object_unref0 (self->_tasks_box);
	self->_tasks_box = _tmp23_;
	list_index = 0;
	_tmp24_ = _data4_->sidebar;
	_tmp25_ = _tmp24_->sidebar_list;
	{
		GList* list_collection = NULL;
		GList* list_it = NULL;
		list_collection = _tmp25_;
		for (list_it = list_collection; list_it != NULL; list_it = list_it->next) {
			YatlaList* _tmp26_ = NULL;
			YatlaList* list = NULL;
			_tmp26_ = _g_object_ref0 ((YatlaList*) list_it->data);
			list = _tmp26_;
			{
				YatlaList* _tmp27_ = NULL;
				const gchar* _tmp28_ = NULL;
				const gchar* _tmp29_ = NULL;
				const gchar* _tmp30_ = NULL;
				gint _tmp31_ = 0;
				_tmp27_ = list;
				_tmp28_ = yatla_list_get_name (_tmp27_);
				_tmp29_ = _tmp28_;
				_tmp30_ = _data4_->list_name;
				if (g_strcmp0 (_tmp29_, _tmp30_) == 0) {
					_g_object_unref0 (list);
					break;
				}
				_tmp31_ = list_index;
				list_index = _tmp31_ + 1;
				_g_object_unref0 (list);
			}
		}
	}
	task_index = 0;
	the_longest_task = (guint) 0;
	while (TRUE) {
		Block5Data* _data5_;
		gint _tmp32_ = 0;
		YatlaSidebar* _tmp33_ = NULL;
		GList* _tmp34_ = NULL;
		gint _tmp35_ = 0;
		gconstpointer _tmp36_ = NULL;
		guint _tmp37_ = 0U;
		guint _tmp38_ = 0U;
		gint task_id = 0;
		YatlaSidebar* _tmp39_ = NULL;
		GList* _tmp40_ = NULL;
		gint _tmp41_ = 0;
		gconstpointer _tmp42_ = NULL;
		GList* _tmp43_ = NULL;
		gint _tmp44_ = 0;
		gconstpointer _tmp45_ = NULL;
		gint _tmp46_ = 0;
		gint _tmp47_ = 0;
		gchar* task_name = NULL;
		YatlaSidebar* _tmp48_ = NULL;
		GList* _tmp49_ = NULL;
		gint _tmp50_ = 0;
		gconstpointer _tmp51_ = NULL;
		GList* _tmp52_ = NULL;
		gint _tmp53_ = 0;
		gconstpointer _tmp54_ = NULL;
		const gchar* _tmp55_ = NULL;
		const gchar* _tmp56_ = NULL;
		gchar* _tmp57_ = NULL;
		YatlaSidebar* _tmp58_ = NULL;
		GList* _tmp59_ = NULL;
		gint _tmp60_ = 0;
		gconstpointer _tmp61_ = NULL;
		GList* _tmp62_ = NULL;
		gint _tmp63_ = 0;
		gconstpointer _tmp64_ = NULL;
		const gchar* _tmp65_ = NULL;
		const gchar* _tmp66_ = NULL;
		gchar* _tmp67_ = NULL;
		GDateTime* task_date = NULL;
		YatlaSidebar* _tmp68_ = NULL;
		GList* _tmp69_ = NULL;
		gint _tmp70_ = 0;
		gconstpointer _tmp71_ = NULL;
		GList* _tmp72_ = NULL;
		gint _tmp73_ = 0;
		gconstpointer _tmp74_ = NULL;
		GDateTime* _tmp75_ = NULL;
		GDateTime* _tmp76_ = NULL;
		gboolean task_is_done = FALSE;
		YatlaSidebar* _tmp87_ = NULL;
		GList* _tmp88_ = NULL;
		gint _tmp89_ = 0;
		gconstpointer _tmp90_ = NULL;
		GList* _tmp91_ = NULL;
		gint _tmp92_ = 0;
		gconstpointer _tmp93_ = NULL;
		gboolean _tmp94_ = FALSE;
		gboolean _tmp95_ = FALSE;
		YatlaTask* task = NULL;
		const gchar* _tmp96_ = NULL;
		const gchar* _tmp97_ = NULL;
		GDateTime* _tmp98_ = NULL;
		gboolean _tmp99_ = FALSE;
		YatlaTask* _tmp100_ = NULL;
		YatlaTask* _tmp101_ = NULL;
		gint _tmp102_ = 0;
		const gchar* _tmp103_ = NULL;
		gint _tmp104_ = 0;
		gint _tmp105_ = 0;
		guint _tmp106_ = 0U;
		GtkCheckButton* checkBox = NULL;
		const gchar* _tmp110_ = NULL;
		GtkCheckButton* _tmp111_ = NULL;
		GtkCheckButton* _tmp112_ = NULL;
		gboolean _tmp113_ = FALSE;
		GtkCheckButton* _tmp114_ = NULL;
		GtkCheckButton* _tmp115_ = NULL;
		GeeTreeMap* _tmp116_ = NULL;
		YatlaTask* _tmp117_ = NULL;
		GtkCheckButton* _tmp118_ = NULL;
		GtkBox* _tmp119_ = NULL;
		GtkCheckButton* _tmp120_ = NULL;
		gint _tmp121_ = 0;
		_data5_ = g_slice_new0 (Block5Data);
		_data5_->_ref_count_ = 1;
		_data5_->_data4_ = block4_data_ref (_data4_);
		_tmp32_ = task_index;
		_tmp33_ = _data4_->sidebar;
		_tmp34_ = _tmp33_->sidebar_list;
		_tmp35_ = list_index;
		_tmp36_ = g_list_nth_data (_tmp34_, (guint) _tmp35_);
		_tmp37_ = yatla_list_get_size ((YatlaList*) _tmp36_);
		_tmp38_ = _tmp37_;
		if (!(((guint) _tmp32_) != _tmp38_)) {
			block5_data_unref (_data5_);
			_data5_ = NULL;
			break;
		}
		_tmp39_ = _data4_->sidebar;
		_tmp40_ = _tmp39_->sidebar_list;
		_tmp41_ = list_index;
		_tmp42_ = g_list_nth_data (_tmp40_, (guint) _tmp41_);
		_tmp43_ = ((YatlaList*) _tmp42_)->tasks;
		_tmp44_ = task_index;
		_tmp45_ = g_list_nth_data (_tmp43_, (guint) _tmp44_);
		_tmp46_ = yatla_task_get_id ((YatlaTask*) _tmp45_);
		_tmp47_ = _tmp46_;
		task_id = _tmp47_;
		_tmp48_ = _data4_->sidebar;
		_tmp49_ = _tmp48_->sidebar_list;
		_tmp50_ = list_index;
		_tmp51_ = g_list_nth_data (_tmp49_, (guint) _tmp50_);
		_tmp52_ = ((YatlaList*) _tmp51_)->tasks;
		_tmp53_ = task_index;
		_tmp54_ = g_list_nth_data (_tmp52_, (guint) _tmp53_);
		_tmp55_ = yatla_task_get_name ((YatlaTask*) _tmp54_);
		_tmp56_ = _tmp55_;
		_tmp57_ = g_strdup (_tmp56_);
		task_name = _tmp57_;
		_tmp58_ = _data4_->sidebar;
		_tmp59_ = _tmp58_->sidebar_list;
		_tmp60_ = list_index;
		_tmp61_ = g_list_nth_data (_tmp59_, (guint) _tmp60_);
		_tmp62_ = ((YatlaList*) _tmp61_)->tasks;
		_tmp63_ = task_index;
		_tmp64_ = g_list_nth_data (_tmp62_, (guint) _tmp63_);
		_tmp65_ = yatla_task_get_note ((YatlaTask*) _tmp64_);
		_tmp66_ = _tmp65_;
		_tmp67_ = g_strdup (_tmp66_);
		_data5_->task_note = _tmp67_;
		_tmp68_ = _data4_->sidebar;
		_tmp69_ = _tmp68_->sidebar_list;
		_tmp70_ = list_index;
		_tmp71_ = g_list_nth_data (_tmp69_, (guint) _tmp70_);
		_tmp72_ = ((YatlaList*) _tmp71_)->tasks;
		_tmp73_ = task_index;
		_tmp74_ = g_list_nth_data (_tmp72_, (guint) _tmp73_);
		_tmp75_ = yatla_task_get_date ((YatlaTask*) _tmp74_);
		_tmp76_ = _tmp75_;
		if (_tmp76_ != NULL) {
			YatlaSidebar* _tmp77_ = NULL;
			GList* _tmp78_ = NULL;
			gint _tmp79_ = 0;
			gconstpointer _tmp80_ = NULL;
			GList* _tmp81_ = NULL;
			gint _tmp82_ = 0;
			gconstpointer _tmp83_ = NULL;
			GDateTime* _tmp84_ = NULL;
			GDateTime* _tmp85_ = NULL;
			GDateTime* _tmp86_ = NULL;
			_tmp77_ = _data4_->sidebar;
			_tmp78_ = _tmp77_->sidebar_list;
			_tmp79_ = list_index;
			_tmp80_ = g_list_nth_data (_tmp78_, (guint) _tmp79_);
			_tmp81_ = ((YatlaList*) _tmp80_)->tasks;
			_tmp82_ = task_index;
			_tmp83_ = g_list_nth_data (_tmp81_, (guint) _tmp82_);
			_tmp84_ = yatla_task_get_date ((YatlaTask*) _tmp83_);
			_tmp85_ = _tmp84_;
			_tmp86_ = _g_date_time_ref0 (_tmp85_);
			_g_date_time_unref0 (task_date);
			task_date = _tmp86_;
		} else {
			_g_date_time_unref0 (task_date);
			task_date = NULL;
		}
		_tmp87_ = _data4_->sidebar;
		_tmp88_ = _tmp87_->sidebar_list;
		_tmp89_ = list_index;
		_tmp90_ = g_list_nth_data (_tmp88_, (guint) _tmp89_);
		_tmp91_ = ((YatlaList*) _tmp90_)->tasks;
		_tmp92_ = task_index;
		_tmp93_ = g_list_nth_data (_tmp91_, (guint) _tmp92_);
		_tmp94_ = yatla_task_get_is_done ((YatlaTask*) _tmp93_);
		_tmp95_ = _tmp94_;
		task_is_done = _tmp95_;
		_tmp96_ = task_name;
		_tmp97_ = _data5_->task_note;
		_tmp98_ = task_date;
		_tmp99_ = task_is_done;
		_tmp100_ = yatla_task_new (_tmp96_, _tmp97_, _tmp98_, _tmp99_);
		task = _tmp100_;
		_tmp101_ = task;
		_tmp102_ = task_id;
		yatla_task_set_id (_tmp101_, _tmp102_);
		_tmp103_ = task_name;
		_tmp104_ = strlen (_tmp103_);
		_tmp105_ = _tmp104_;
		_tmp106_ = the_longest_task;
		if (((guint) _tmp105_) > _tmp106_) {
			const gchar* _tmp107_ = NULL;
			gint _tmp108_ = 0;
			gint _tmp109_ = 0;
			_tmp107_ = task_name;
			_tmp108_ = strlen (_tmp107_);
			_tmp109_ = _tmp108_;
			the_longest_task = (guint) _tmp109_;
		}
		_tmp110_ = task_name;
		_tmp111_ = (GtkCheckButton*) gtk_check_button_new_with_label (_tmp110_);
		g_object_ref_sink (_tmp111_);
		checkBox = _tmp111_;
		_tmp112_ = checkBox;
		_tmp113_ = task_is_done;
		gtk_toggle_button_set_active ((GtkToggleButton*) _tmp112_, _tmp113_);
		_tmp114_ = checkBox;
		gtk_widget_set_has_tooltip ((GtkWidget*) _tmp114_, TRUE);
		_tmp115_ = checkBox;
		g_signal_connect_data ((GtkWidget*) _tmp115_, "query-tooltip", (GCallback) ____lambda4__gtk_widget_query_tooltip, block5_data_ref (_data5_), (GClosureNotify) block5_data_unref, 0);
		_tmp116_ = self->tasks;
		_tmp117_ = task;
		_tmp118_ = checkBox;
		gee_abstract_map_set ((GeeAbstractMap*) _tmp116_, _tmp117_, _tmp118_);
		_tmp119_ = self->_tasks_box;
		_tmp120_ = checkBox;
		gtk_box_pack_start (_tmp119_, (GtkWidget*) _tmp120_, TRUE, TRUE, (guint) 0);
		_tmp121_ = task_index;
		task_index = _tmp121_ + 1;
		_g_object_unref0 (checkBox);
		_g_object_unref0 (task);
		_g_date_time_unref0 (task_date);
		_g_free0 (task_name);
		block5_data_unref (_data5_);
		_data5_ = NULL;
	}
	_tmp122_ = self->_top_box1;
	gtk_layout_put ((GtkLayout*) self, (GtkWidget*) _tmp122_, 25, 20);
	_tmp123_ = self->_top_box2;
	gtk_layout_put ((GtkLayout*) self, (GtkWidget*) _tmp123_, 20, 40);
	_tmp124_ = self->_tasks_box;
	gtk_layout_put ((GtkLayout*) self, (GtkWidget*) _tmp124_, 20, 100);
	_tmp125_ = the_longest_task;
	g_object_set ((GtkLayout*) self, "width", 65 + (_tmp125_ * 7), NULL);
	_tmp126_ = self->tasks;
	_tmp127_ = gee_abstract_map_get_values ((GeeMap*) _tmp126_);
	_tmp128_ = _tmp127_;
	_tmp129_ = _tmp128_;
	_tmp130_ = gee_collection_get_size (_tmp129_);
	_tmp131_ = _tmp130_;
	g_object_set ((GtkLayout*) self, "height", (guint) (100 + (_tmp131_ * 30)), NULL);
	_g_object_unref0 (_tmp129_);
	gtk_widget_show_all ((GtkWidget*) self);
	_tmp132_ = self->new_task_entry;
	g_signal_connect_data (_tmp132_, "icon-press", (GCallback) ___lambda5__gtk_entry_icon_press, block4_data_ref (_data4_), (GClosureNotify) block4_data_unref, 0);
	_tmp133_ = self->tasks;
	_tmp134_ = gee_abstract_map_map_iterator ((GeeAbstractMap*) _tmp133_);
	map_iterator = _tmp134_;
	while (TRUE) {
		Block6Data* _data6_;
		GeeMapIterator* _tmp135_ = NULL;
		gboolean _tmp136_ = FALSE;
		GeeMapIterator* _tmp137_ = NULL;
		gpointer _tmp138_ = NULL;
		GeeMapIterator* _tmp139_ = NULL;
		gpointer _tmp140_ = NULL;
		GtkCheckButton* _tmp141_ = NULL;
		_data6_ = g_slice_new0 (Block6Data);
		_data6_->_ref_count_ = 1;
		_data6_->_data4_ = block4_data_ref (_data4_);
		_tmp135_ = map_iterator;
		_tmp136_ = gee_map_iterator_next (_tmp135_);
		if (!_tmp136_) {
			block6_data_unref (_data6_);
			_data6_ = NULL;
			break;
		}
		_tmp137_ = map_iterator;
		_tmp138_ = gee_map_iterator_get_value (_tmp137_);
		_data6_->checkBox = (GtkCheckButton*) _tmp138_;
		_tmp139_ = map_iterator;
		_tmp140_ = gee_map_iterator_get_key (_tmp139_);
		_data6_->task = (YatlaTask*) _tmp140_;
		_tmp141_ = _data6_->checkBox;
		g_signal_connect_data ((GObject*) _tmp141_, "notify::active", (GCallback) ____lambda11__g_object_notify, block6_data_ref (_data6_), (GClosureNotify) block6_data_unref, 0);
		block6_data_unref (_data6_);
		_data6_ = NULL;
	}
	result = TRUE;
	_g_object_unref0 (map_iterator);
	block4_data_unref (_data4_);
	_data4_ = NULL;
	return result;
}
void playlists_menuitem_update_individual_playlist (PlaylistsMenuitem* self, PlaylistDetails* new_detail) {
	DbusmenuMenuitem* _tmp19_;
	const gchar* _tmp20_ = NULL;
	PlaylistDetails _tmp21_;
	const char* _tmp22_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (new_detail != NULL);
	{
		GeeHashMap* _tmp0_;
		GeeCollection* _tmp1_;
		GeeCollection* _tmp2_;
		GeeCollection* _tmp3_;
		GeeIterator* _tmp4_ = NULL;
		GeeIterator* _tmp5_;
		GeeIterator* _item_it;
		_tmp0_ = self->priv->current_playlists;
		_tmp1_ = gee_abstract_map_get_values ((GeeMap*) _tmp0_);
		_tmp2_ = _tmp1_;
		_tmp3_ = _tmp2_;
		_tmp4_ = gee_iterable_iterator ((GeeIterable*) _tmp3_);
		_tmp5_ = _tmp4_;
		_g_object_unref0 (_tmp3_);
		_item_it = _tmp5_;
		while (TRUE) {
			GeeIterator* _tmp6_;
			gboolean _tmp7_ = FALSE;
			GeeIterator* _tmp8_;
			gpointer _tmp9_ = NULL;
			DbusmenuMenuitem* item;
			PlaylistDetails _tmp10_;
			const char* _tmp11_;
			DbusmenuMenuitem* _tmp12_;
			const gchar* _tmp13_ = NULL;
			_tmp6_ = _item_it;
			_tmp7_ = gee_iterator_next (_tmp6_);
			if (!_tmp7_) {
				break;
			}
			_tmp8_ = _item_it;
			_tmp9_ = gee_iterator_get (_tmp8_);
			item = (DbusmenuMenuitem*) _tmp9_;
			_tmp10_ = *new_detail;
			_tmp11_ = _tmp10_.path;
			_tmp12_ = item;
			_tmp13_ = dbusmenu_menuitem_property_get (_tmp12_, DBUSMENU_PLAYLIST_MENUITEM_PATH);
			if (g_strcmp0 (_tmp11_, _tmp13_) == 0) {
				DbusmenuMenuitem* _tmp14_;
				PlaylistDetails _tmp15_;
				const gchar* _tmp16_;
				gchar* _tmp17_ = NULL;
				gchar* _tmp18_;
				_tmp14_ = item;
				_tmp15_ = *new_detail;
				_tmp16_ = _tmp15_.name;
				_tmp17_ = playlists_menuitem_truncate_item_label_if_needs_be (self, _tmp16_);
				_tmp18_ = _tmp17_;
				dbusmenu_menuitem_property_set (_tmp14_, DBUSMENU_MENUITEM_PROP_LABEL, _tmp18_);
				_g_free0 (_tmp18_);
			}
			_g_object_unref0 (item);
		}
		_g_object_unref0 (_item_it);
	}
	_tmp19_ = self->root_item;
	_tmp20_ = dbusmenu_menuitem_property_get (_tmp19_, DBUSMENU_PLAYLIST_MENUITEM_PATH);
	_tmp21_ = *new_detail;
	_tmp22_ = _tmp21_.path;
	if (g_strcmp0 (_tmp20_, _tmp22_) == 0) {
		DbusmenuMenuitem* _tmp23_;
		PlaylistDetails _tmp24_;
		const gchar* _tmp25_;
		gchar* _tmp26_ = NULL;
		gchar* _tmp27_;
		_tmp23_ = self->root_item;
		_tmp24_ = *new_detail;
		_tmp25_ = _tmp24_.name;
		_tmp26_ = playlists_menuitem_truncate_item_label_if_needs_be (self, _tmp25_);
		_tmp27_ = _tmp26_;
		dbusmenu_menuitem_property_set (_tmp23_, DBUSMENU_MENUITEM_PROP_LABEL, _tmp27_);
		_g_free0 (_tmp27_);
	}
}
static gboolean playlists_menuitem_already_observed (PlaylistsMenuitem* self, PlaylistDetails* new_detail) {
	gboolean result = FALSE;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (new_detail != NULL, FALSE);
	{
		GeeHashMap* _tmp0_;
		GeeCollection* _tmp1_;
		GeeCollection* _tmp2_;
		GeeCollection* _tmp3_;
		GeeIterator* _tmp4_ = NULL;
		GeeIterator* _tmp5_;
		GeeIterator* _item_it;
		_tmp0_ = self->priv->current_playlists;
		_tmp1_ = gee_abstract_map_get_values ((GeeMap*) _tmp0_);
		_tmp2_ = _tmp1_;
		_tmp3_ = _tmp2_;
		_tmp4_ = gee_iterable_iterator ((GeeIterable*) _tmp3_);
		_tmp5_ = _tmp4_;
		_g_object_unref0 (_tmp3_);
		_item_it = _tmp5_;
		while (TRUE) {
			GeeIterator* _tmp6_;
			gboolean _tmp7_ = FALSE;
			GeeIterator* _tmp8_;
			gpointer _tmp9_ = NULL;
			DbusmenuMenuitem* item;
			DbusmenuMenuitem* _tmp10_;
			const gchar* _tmp11_ = NULL;
			gchar* _tmp12_;
			gchar* path;
			PlaylistDetails _tmp13_;
			const char* _tmp14_;
			const gchar* _tmp15_;
			_tmp6_ = _item_it;
			_tmp7_ = gee_iterator_next (_tmp6_);
			if (!_tmp7_) {
				break;
			}
			_tmp8_ = _item_it;
			_tmp9_ = gee_iterator_get (_tmp8_);
			item = (DbusmenuMenuitem*) _tmp9_;
			_tmp10_ = item;
			_tmp11_ = dbusmenu_menuitem_property_get (_tmp10_, DBUSMENU_PLAYLIST_MENUITEM_PATH);
			_tmp12_ = g_strdup (_tmp11_);
			path = _tmp12_;
			_tmp13_ = *new_detail;
			_tmp14_ = _tmp13_.path;
			_tmp15_ = path;
			if (g_strcmp0 (_tmp14_, _tmp15_) == 0) {
				result = TRUE;
				_g_free0 (path);
				_g_object_unref0 (item);
				_g_object_unref0 (_item_it);
				return result;
			}
			_g_free0 (path);
			_g_object_unref0 (item);
		}
		_g_object_unref0 (_item_it);
	}
	result = FALSE;
	return result;
}
void playlists_menuitem_update (PlaylistsMenuitem* self, PlaylistDetails* playlists, int playlists_length1) {
	PlaylistDetails* _tmp0_;
	gint _tmp0__length1;
	g_return_if_fail (self != NULL);
	_tmp0_ = playlists;
	_tmp0__length1 = playlists_length1;
	{
		PlaylistDetails* detail_collection = NULL;
		gint detail_collection_length1 = 0;
		gint _detail_collection_size_ = 0;
		gint detail_it = 0;
		detail_collection = _tmp0_;
		detail_collection_length1 = _tmp0__length1;
		for (detail_it = 0; detail_it < _tmp0__length1; detail_it = detail_it + 1) {
			PlaylistDetails _tmp1_ = {0};
			PlaylistDetails detail = {0};
			playlist_details_copy (&detail_collection[detail_it], &_tmp1_);
			detail = _tmp1_;
			{
				Block2Data* _data2_;
				gboolean _tmp2_ = FALSE;
				PlaylistDetails _tmp3_;
				gboolean _tmp4_ = FALSE;
				gboolean _tmp7_;
				DbusmenuMenuitem* _tmp8_;
				DbusmenuMenuitem* _tmp9_;
				PlaylistDetails _tmp10_;
				const gchar* _tmp11_;
				gchar* _tmp12_ = NULL;
				gchar* _tmp13_;
				DbusmenuMenuitem* _tmp14_;
				DbusmenuMenuitem* _tmp15_;
				PlaylistDetails _tmp16_;
				const char* _tmp17_;
				DbusmenuMenuitem* _tmp18_;
				DbusmenuMenuitem* _tmp19_;
				DbusmenuMenuitem* _tmp20_;
				GeeHashMap* _tmp21_;
				DbusmenuMenuitem* _tmp22_;
				gint _tmp23_;
				gint _tmp24_;
				DbusmenuMenuitem* _tmp25_;
				DbusmenuMenuitem* _tmp26_;
				DbusmenuMenuitem* _tmp27_;
				PlaylistDetails _tmp28_;
				const gchar* _tmp29_;
				_data2_ = g_slice_new0 (Block2Data);
				_data2_->_ref_count_ = 1;
				_data2_->self = g_object_ref (self);
				_tmp3_ = detail;
				_tmp4_ = playlists_menuitem_already_observed (self, &_tmp3_);
				if (_tmp4_) {
					_tmp2_ = TRUE;
				} else {
					PlaylistDetails _tmp5_;
					gboolean _tmp6_ = FALSE;
					_tmp5_ = detail;
					_tmp6_ = playlists_menuitem_is_video_related (self, &_tmp5_);
					_tmp2_ = _tmp6_;
				}
				_tmp7_ = _tmp2_;
				if (_tmp7_) {
					playlist_details_destroy (&detail);
					block2_data_unref (_data2_);
					_data2_ = NULL;
					continue;
				}
				_tmp8_ = dbusmenu_menuitem_new ();
				_data2_->menuitem = _tmp8_;
				_tmp9_ = _data2_->menuitem;
				_tmp10_ = detail;
				_tmp11_ = _tmp10_.name;
				_tmp12_ = playlists_menuitem_truncate_item_label_if_needs_be (self, _tmp11_);
				_tmp13_ = _tmp12_;
				dbusmenu_menuitem_property_set (_tmp9_, DBUSMENU_MENUITEM_PROP_LABEL, _tmp13_);
				_g_free0 (_tmp13_);
				_tmp14_ = _data2_->menuitem;
				dbusmenu_menuitem_property_set (_tmp14_, DBUSMENU_MENUITEM_PROP_ICON_NAME, "playlist-symbolic");
				_tmp15_ = _data2_->menuitem;
				_tmp16_ = detail;
				_tmp17_ = _tmp16_.path;
				dbusmenu_menuitem_property_set (_tmp15_, DBUSMENU_PLAYLIST_MENUITEM_PATH, (const gchar*) _tmp17_);
				_tmp18_ = _data2_->menuitem;
				dbusmenu_menuitem_property_set_bool (_tmp18_, DBUSMENU_MENUITEM_PROP_VISIBLE, TRUE);
				_tmp19_ = _data2_->menuitem;
				dbusmenu_menuitem_property_set_bool (_tmp19_, DBUSMENU_MENUITEM_PROP_ENABLED, TRUE);
				_tmp20_ = _data2_->menuitem;
				g_signal_connect_data (_tmp20_, "item-activated", (GCallback) _____lambda3__dbusmenu_menuitem_item_activated, block2_data_ref (_data2_), (GClosureNotify) block2_data_unref, 0);
				_tmp21_ = self->priv->current_playlists;
				_tmp22_ = _data2_->menuitem;
				_tmp23_ = dbusmenu_menuitem_get_id (_tmp22_);
				_tmp24_ = _tmp23_;
				_tmp25_ = _data2_->menuitem;
				gee_abstract_map_set ((GeeAbstractMap*) _tmp21_, GINT_TO_POINTER (_tmp24_), _tmp25_);
				_tmp26_ = self->root_item;
				_tmp27_ = _data2_->menuitem;
				dbusmenu_menuitem_child_append (_tmp26_, _tmp27_);
				_tmp28_ = detail;
				_tmp29_ = _tmp28_.name;
				g_debug ("playlists-menu-item.vala:66: populating valid playlists %s", _tmp29_);
				playlist_details_destroy (&detail);
				block2_data_unref (_data2_);
				_data2_ = NULL;
			}
		}
	}
	{
		GeeHashMap* _tmp30_;
		GeeCollection* _tmp31_;
		GeeCollection* _tmp32_;
		GeeCollection* _tmp33_;
		GeeIterator* _tmp34_ = NULL;
		GeeIterator* _tmp35_;
		GeeIterator* _item_it;
		_tmp30_ = self->priv->current_playlists;
		_tmp31_ = gee_abstract_map_get_values ((GeeMap*) _tmp30_);
		_tmp32_ = _tmp31_;
		_tmp33_ = _tmp32_;
		_tmp34_ = gee_iterable_iterator ((GeeIterable*) _tmp33_);
		_tmp35_ = _tmp34_;
		_g_object_unref0 (_tmp33_);
		_item_it = _tmp35_;
		while (TRUE) {
			GeeIterator* _tmp36_;
			gboolean _tmp37_ = FALSE;
			GeeIterator* _tmp38_;
			gpointer _tmp39_ = NULL;
			DbusmenuMenuitem* item;
			gboolean within;
			PlaylistDetails* _tmp40_;
			gint _tmp40__length1;
			gboolean _tmp46_;
			_tmp36_ = _item_it;
			_tmp37_ = gee_iterator_next (_tmp36_);
			if (!_tmp37_) {
				break;
			}
			_tmp38_ = _item_it;
			_tmp39_ = gee_iterator_get (_tmp38_);
			item = (DbusmenuMenuitem*) _tmp39_;
			within = FALSE;
			_tmp40_ = playlists;
			_tmp40__length1 = playlists_length1;
			{
				PlaylistDetails* detail_collection = NULL;
				gint detail_collection_length1 = 0;
				gint _detail_collection_size_ = 0;
				gint detail_it = 0;
				detail_collection = _tmp40_;
				detail_collection_length1 = _tmp40__length1;
				for (detail_it = 0; detail_it < _tmp40__length1; detail_it = detail_it + 1) {
					PlaylistDetails _tmp41_ = {0};
					PlaylistDetails detail = {0};
					playlist_details_copy (&detail_collection[detail_it], &_tmp41_);
					detail = _tmp41_;
					{
						PlaylistDetails _tmp42_;
						const char* _tmp43_;
						DbusmenuMenuitem* _tmp44_;
						const gchar* _tmp45_ = NULL;
						_tmp42_ = detail;
						_tmp43_ = _tmp42_.path;
						_tmp44_ = item;
						_tmp45_ = dbusmenu_menuitem_property_get (_tmp44_, DBUSMENU_PLAYLIST_MENUITEM_PATH);
						if (g_strcmp0 (_tmp43_, _tmp45_) == 0) {
							within = TRUE;
							playlist_details_destroy (&detail);
							break;
						}
						playlist_details_destroy (&detail);
					}
				}
			}
			_tmp46_ = within;
			if (_tmp46_ == FALSE) {
				DbusmenuMenuitem* _tmp47_;
				const gchar* _tmp48_ = NULL;
				DbusmenuMenuitem* _tmp49_;
				const gchar* _tmp50_ = NULL;
				DbusmenuMenuitem* _tmp53_;
				DbusmenuMenuitem* _tmp54_;
				_tmp47_ = self->root_item;
				_tmp48_ = dbusmenu_menuitem_property_get (_tmp47_, DBUSMENU_PLAYLIST_MENUITEM_PATH);
				_tmp49_ = item;
				_tmp50_ = dbusmenu_menuitem_property_get (_tmp49_, DBUSMENU_PLAYLIST_MENUITEM_PATH);
				if (g_strcmp0 (_tmp48_, _tmp50_) == 0) {
					DbusmenuMenuitem* _tmp51_;
					const gchar* _tmp52_ = NULL;
					_tmp51_ = self->root_item;
					_tmp52_ = _ ("Choose Playlist");
					dbusmenu_menuitem_property_set (_tmp51_, DBUSMENU_MENUITEM_PROP_LABEL, _tmp52_);
				}
				_tmp53_ = self->root_item;
				_tmp54_ = item;
				dbusmenu_menuitem_child_delete (_tmp53_, _tmp54_);
			}
			_g_object_unref0 (item);
		}
		_g_object_unref0 (_item_it);
	}
}