Exemplo n.º 1
0
static gint gtk_mate_matcher_sorted_ix (GeeArrayList* ixs, gint val) {
	g_return_val_if_fail (ixs != NULL, 0);
	if (gee_collection_get_size ((GeeCollection*) ixs) == 0) {
		return 0;
	}
	if (val < GPOINTER_TO_INT (gee_list_get ((GeeList*) ixs, 0))) {
		return 0;
	}
	if (gee_collection_get_size ((GeeCollection*) ixs) == 1) {
		if (val > GPOINTER_TO_INT (gee_list_get ((GeeList*) ixs, 0))) {
			return 1;
		} else {
			return 0;
		}
	} else {
		{
			gint i;
			i = 0;
			for (; i < (gee_collection_get_size ((GeeCollection*) ixs) - 1); i++) {
				gboolean _tmp4;
				_tmp4 = FALSE;
				if (val > GPOINTER_TO_INT (gee_list_get ((GeeList*) ixs, i))) {
					_tmp4 = val < GPOINTER_TO_INT (gee_list_get ((GeeList*) ixs, i + 1));
				} else {
					_tmp4 = FALSE;
				}
				if (_tmp4) {
					return i + 1;
				}
			}
		}
		return gee_collection_get_size ((GeeCollection*) ixs);
	}
}
Exemplo n.º 2
0
static void vala_dmap_db_real_foreach (DMAPDb* base, GHFunc func, void* func_target) {
	ValaDMAPDb * self;
	gint i = 0;
	self = (ValaDMAPDb*) base;
	{
		gboolean _tmp0_;
		i = 0;
		_tmp0_ = TRUE;
		while (TRUE) {
			gint _tmp1_;
			void* _tmp2_ = NULL;
			gpointer _tmp3_ = NULL;
			if (!_tmp0_) {
				i++;
			}
			_tmp0_ = FALSE;
			_tmp1_ = gee_collection_get_size ((GeeCollection*) self->priv->db);
			if (!(i < _tmp1_)) {
				break;
			}
			_tmp2_ = GINT_TO_POINTER (i + 1);
			_tmp3_ = gee_abstract_list_get ((GeeAbstractList*) self->priv->db, i);
			func (_tmp2_, (DMAPRecord*) _tmp3_, func_target);
		}
	}
}
Exemplo n.º 3
0
static GeeList* rygel_folder_container_real_get_children_finish (RygelMediaContainer* base, GAsyncResult* res, GError** error) {
#line 158 "rygel-folder-container.c"
	RygelFolderContainer * self;
	self = (RygelFolderContainer*) base;
#line 85 "rygel-folder-container.vala"
	g_return_val_if_fail (res != NULL, NULL);
#line 88 "rygel-folder-container.vala"
	if (RYGEL_IS_FOLDER_DIRECTORY_SEARCH_RESULT (res)) {
#line 165 "rygel-folder-container.c"
		RygelFolderDirectorySearchResult* _tmp0_;
		RygelFolderDirectorySearchResult* dsr;
		GeeList* _tmp1_;
#line 89 "rygel-folder-container.vala"
		_tmp0_ = NULL;
#line 171 "rygel-folder-container.c"
		dsr = (_tmp0_ = RYGEL_FOLDER_DIRECTORY_SEARCH_RESULT (res), (_tmp0_ == NULL) ? NULL : g_object_ref (_tmp0_));
		{
			GeeIterator* _item_it;
			_item_it = gee_iterable_iterator ((GeeIterable*) ((GeeList*) ((RygelSimpleAsyncResult*) dsr)->data));
#line 91 "rygel-folder-container.vala"
			while (gee_iterator_next (_item_it)) {
#line 178 "rygel-folder-container.c"
				RygelMediaObject* item;
				item = (RygelMediaObject*) gee_iterator_get (_item_it);
#line 92 "rygel-folder-container.vala"
				gee_collection_add ((GeeCollection*) self->priv->items, item);
#line 183 "rygel-folder-container.c"
				(item == NULL) ? NULL : (item = (g_object_unref (item), NULL));
			}
			(_item_it == NULL) ? NULL : (_item_it = (g_object_unref (_item_it), NULL));
		}
#line 95 "rygel-folder-container.vala"
		((RygelMediaContainer*) self)->child_count = (guint) gee_collection_get_size ((GeeCollection*) self->priv->items);
#line 96 "rygel-folder-container.vala"
		gee_collection_remove ((GeeCollection*) self->priv->results, res);
#line 97 "rygel-folder-container.vala"
		_tmp1_ = NULL;
#line 97 "rygel-folder-container.vala"
		return (_tmp1_ = rygel_folder_directory_search_result_get_children (dsr), (dsr == NULL) ? NULL : (dsr = (g_object_unref (dsr), NULL)), _tmp1_);
#line 196 "rygel-folder-container.c"
	} else {
		RygelSimpleAsyncResult* _tmp2_;
		RygelSimpleAsyncResult* simple_res;
		GeeList* _tmp3_;
		GeeList* _tmp4_;
#line 99 "rygel-folder-container.vala"
		_tmp2_ = NULL;
#line 204 "rygel-folder-container.c"
		simple_res = (_tmp2_ = RYGEL_SIMPLE_ASYNC_RESULT (res), (_tmp2_ == NULL) ? NULL : g_object_ref (_tmp2_));
#line 101 "rygel-folder-container.vala"
		_tmp3_ = NULL;
#line 101 "rygel-folder-container.vala"
		_tmp4_ = NULL;
#line 101 "rygel-folder-container.vala"
		return (_tmp4_ = (_tmp3_ = (GeeList*) simple_res->data, (_tmp3_ == NULL) ? NULL : g_object_ref (_tmp3_)), (simple_res == NULL) ? NULL : (simple_res = (g_object_unref (simple_res), NULL)), _tmp4_);
#line 212 "rygel-folder-container.c"
	}
}
Exemplo n.º 4
0
static gint64 vala_dmap_db_real_count (DMAPDb* base) {
	ValaDMAPDb * self;
	gint64 result = 0LL;
	gint _tmp0_;
	self = (ValaDMAPDb*) base;
	_tmp0_ = gee_collection_get_size ((GeeCollection*) self->priv->db);
	result = (gint64) _tmp0_;
	return result;
}
Exemplo n.º 5
0
static guint vala_dmap_db_real_add (DMAPDb* base, DMAPRecord* record) {
	ValaDMAPDb * self;
	guint result = 0U;
	gint _tmp0_;
	self = (ValaDMAPDb*) base;
	g_return_val_if_fail (record != NULL, 0U);
	gee_abstract_collection_add ((GeeAbstractCollection*) self->priv->db, DMAP_RECORD (record));
	gee_abstract_collection_add ((GeeAbstractCollection*) self->priv->db, DMAP_RECORD (record));
	_tmp0_ = gee_collection_get_size ((GeeCollection*) self->priv->db);
	result = (guint) _tmp0_;
	return result;
}
Exemplo n.º 6
0
void ease_main_remove_welcome (void) {
#line 1102 "ease-main.c"
	EaseWelcomeWindow* _tmp0_;
#line 378 "ease-main.vala"
	gtk_widget_hide_all ((GtkWidget*) ease_main_welcome);
#line 379 "ease-main.vala"
	ease_main_welcome = (_tmp0_ = NULL, _g_object_unref0 (ease_main_welcome), _tmp0_);
#line 380 "ease-main.vala"
	if (gee_collection_get_size ((GeeCollection*) ease_main_windows) == 0) {
#line 382 "ease-main.vala"
		gtk_main_quit ();
#line 1112 "ease-main.c"
	}
}
void
empathy_individual_manager_link_personas (EmpathyIndividualManager *self,
    GeeSet *personas)
{
  EmpathyIndividualManagerPriv *priv;

  g_return_if_fail (EMPATHY_IS_INDIVIDUAL_MANAGER (self));
  g_return_if_fail (personas != NULL);

  priv = GET_PRIV (self);

  DEBUG ("Linking %u personas",
      gee_collection_get_size (GEE_COLLECTION (personas)));

  folks_individual_aggregator_link_personas (priv->aggregator, personas,
      (GAsyncReadyCallback) link_personas_cb, NULL);
}
Exemplo n.º 8
0
static void rygel_external_container_update_container (RygelExternalContainer* self, GError** error) {
#line 794 "rygel-external-container.c"
	char** _tmp1_;
	gint _obj_paths_size_;
	gint obj_paths_length1;
	gint _tmp0_;
	char** obj_paths;
#line 170 "rygel-external-container.vala"
	g_return_if_fail (self != NULL);
#line 171 "rygel-external-container.vala"
	gee_abstract_collection_clear ((GeeAbstractCollection*) self->priv->containers);
#line 804 "rygel-external-container.c"
	obj_paths = (_tmp1_ = rygel_external_media_container_get_containers (self->actual_container, &_tmp0_), obj_paths_length1 = _tmp0_, _obj_paths_size_ = obj_paths_length1, _tmp1_);
	{
		char** obj_path_collection;
		int obj_path_collection_length1;
		int obj_path_it;
#line 174 "rygel-external-container.vala"
		obj_path_collection = obj_paths;
#line 812 "rygel-external-container.c"
		obj_path_collection_length1 = obj_paths_length1;
		for (obj_path_it = 0; obj_path_it < obj_paths_length1; obj_path_it = obj_path_it + 1) {
			char* obj_path;
			obj_path = g_strdup (obj_path_collection[obj_path_it]);
			{
				char* _tmp2_;
				RygelExternalContainer* _tmp3_;
				RygelExternalContainer* container;
#line 175 "rygel-external-container.vala"
				container = (_tmp3_ = rygel_external_container_new (_tmp2_ = g_strconcat ("container:", (const char*) obj_path, NULL), self->service_name, obj_path, self->host_ip, self), _g_free0 (_tmp2_), _tmp3_);
#line 181 "rygel-external-container.vala"
				gee_abstract_collection_add ((GeeAbstractCollection*) self->priv->containers, container);
#line 825 "rygel-external-container.c"
				_g_free0 (obj_path);
				_g_object_unref0 (container);
			}
		}
	}
#line 184 "rygel-external-container.vala"
	((RygelMediaContainer*) self)->child_count = gee_collection_get_size ((GeeCollection*) self->priv->containers) + ((gint) rygel_external_media_container_get_item_count (self->actual_container));
#line 833 "rygel-external-container.c"
	obj_paths = (_vala_array_free (obj_paths, obj_paths_length1, (GDestroyNotify) g_free), NULL);
}
Exemplo n.º 9
0
static void rygel_folder_container_real_get_children (RygelMediaContainer* base, guint offset, guint max_count, GCancellable* cancellable, GAsyncReadyCallback callback, void* callback_target) {
#line 115 "rygel-folder-container.c"
	RygelFolderContainer * self;
	self = (RygelFolderContainer*) base;
	/* if the cache is empty, fill it*/
#line 56 "rygel-folder-container.vala"
	if (gee_collection_get_size ((GeeCollection*) self->priv->items) == 0) {
#line 121 "rygel-folder-container.c"
		RygelFolderDirectorySearchResult* res;
		res = rygel_folder_directory_search_result_new ((RygelMediaContainer*) self, offset, max_count, callback, callback_target);
#line 62 "rygel-folder-container.vala"
		g_file_enumerate_children_async (self->priv->root_dir, G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE "," G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME "," G_FILE_ATTRIBUTE_STANDARD_TYPE "," G_FILE_ATTRIBUTE_STANDARD_NAME, G_FILE_QUERY_INFO_NONE, G_PRIORITY_DEFAULT, NULL, _rygel_folder_directory_search_result_enumerate_children_ready_gasync_ready_callback, res);
#line 71 "rygel-folder-container.vala"
		gee_collection_add ((GeeCollection*) self->priv->results, (GAsyncResult*) res);
#line 128 "rygel-folder-container.c"
		(res == NULL) ? NULL : (res = (g_object_unref (res), NULL));
	} else {
		guint stop;
		GeeList* children;
		RygelSimpleAsyncResult* res;
		GeeList* _tmp1_;
		GeeList* _tmp0_;
		stop = offset + max_count;
#line 74 "rygel-folder-container.vala"
		stop = CLAMP (stop, (guint) 0, ((RygelMediaContainer*) self)->child_count);
#line 139 "rygel-folder-container.c"
		children = gee_list_slice ((GeeList*) self->priv->items, (gint) offset, (gint) stop);
		res = rygel_simple_async_result_new (GEE_TYPE_LIST, (GBoxedCopyFunc) g_object_ref, g_object_unref, (GObject*) self, callback, callback_target);
		_tmp1_ = NULL;
#line 80 "rygel-folder-container.vala"
		_tmp0_ = NULL;
#line 80 "rygel-folder-container.vala"
		res->data = (_tmp1_ = (_tmp0_ = children, (_tmp0_ == NULL) ? NULL : g_object_ref (_tmp0_)), (res->data == NULL) ? NULL : (res->data = (g_object_unref (res->data), NULL)), _tmp1_);
#line 81 "rygel-folder-container.vala"
		rygel_simple_async_result_complete_in_idle (res);
#line 149 "rygel-folder-container.c"
		(children == NULL) ? NULL : (children = (g_object_unref (children), NULL));
		(res == NULL) ? NULL : (res = (g_object_unref (res), NULL));
	}
}
RygelTrackerRootContainer* rygel_tracker_root_container_construct (GType object_type, const char* title) {
	RygelTrackerRootContainer * self;
	GeeArrayList* _tmp0_;
	RygelTrackerImageCategory* _tmp1_;
	RygelTrackerMusicCategory* _tmp2_;
	RygelTrackerVideoCategory* _tmp3_;
	g_return_val_if_fail (title != NULL, NULL);
	self = (RygelTrackerRootContainer*) rygel_media_container_construct_root (object_type, title, (guint) 0);
	_tmp0_ = NULL;
	self->priv->categories = (_tmp0_ = gee_array_list_new (RYGEL_TYPE_TRACKER_CATEGORY, (GBoxedCopyFunc) g_object_ref, g_object_unref, g_direct_equal), (self->priv->categories == NULL) ? NULL : (self->priv->categories = (g_object_unref (self->priv->categories), NULL)), _tmp0_);
	_tmp1_ = NULL;
	gee_collection_add ((GeeCollection*) self->priv->categories, (RygelTrackerCategory*) (_tmp1_ = rygel_tracker_image_category_new ("16", (RygelMediaContainer*) self, "All Images")));
	(_tmp1_ == NULL) ? NULL : (_tmp1_ = (g_object_unref (_tmp1_), NULL));
	_tmp2_ = NULL;
	gee_collection_add ((GeeCollection*) self->priv->categories, (RygelTrackerCategory*) (_tmp2_ = rygel_tracker_music_category_new ("14", (RygelMediaContainer*) self, "All Music")));
	(_tmp2_ == NULL) ? NULL : (_tmp2_ = (g_object_unref (_tmp2_), NULL));
	_tmp3_ = NULL;
	gee_collection_add ((GeeCollection*) self->priv->categories, (RygelTrackerCategory*) (_tmp3_ = rygel_tracker_video_category_new ("15", (RygelMediaContainer*) self, "All Videos")));
	(_tmp3_ == NULL) ? NULL : (_tmp3_ = (g_object_unref (_tmp3_), NULL));
	((RygelMediaContainer*) self)->child_count = (guint) gee_collection_get_size ((GeeCollection*) self->priv->categories);
	return self;
}
Exemplo n.º 11
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;
}
Exemplo n.º 12
0
static void steadyflow_file_list_controller_update_model (SteadyflowFileListController* self) {
	GtkListStore* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->model;
	gtk_list_store_clear (_tmp0_);
	{
		SteadyflowCoreIDownloadService* _tmp1_;
		SteadyflowCoreIDownloadService* _tmp2_;
		GeeList* _tmp3_;
		GeeList* _tmp4_;
		GeeList* _file_list;
		GeeList* _tmp5_;
		gint _tmp6_;
		gint _tmp7_;
		gint _file_size;
		gint _file_index;
		_tmp1_ = steadyflow_services_get_download ();
		_tmp2_ = _tmp1_;
		_tmp3_ = steadyflow_core_idownload_service_get_files (_tmp2_);
		_tmp4_ = _tmp3_;
		_file_list = _tmp4_;
		_tmp5_ = _file_list;
		_tmp6_ = gee_collection_get_size ((GeeCollection*) _tmp5_);
		_tmp7_ = _tmp6_;
		_file_size = _tmp7_;
		_file_index = -1;
		while (TRUE) {
			gint _tmp8_;
			gint _tmp9_;
			gint _tmp10_;
			GeeList* _tmp11_;
			gint _tmp12_;
			gpointer _tmp13_ = NULL;
			SteadyflowCoreIDownloadFile* file;
			SteadyflowCoreIDownloadFile* _tmp14_;
			const gchar* _tmp15_;
			const gchar* _tmp16_;
			gchar* _tmp17_ = NULL;
			gchar* _tmp18_;
			const gchar* _tmp19_;
			gboolean _tmp20_ = FALSE;
			gboolean _tmp21_;
			GtkTreeIter iter = {0};
			GtkListStore* _tmp22_;
			GtkTreeIter _tmp23_ = {0};
			GtkListStore* _tmp24_;
			GtkTreeIter _tmp25_;
			SteadyflowCoreIDownloadFile* _tmp26_;
			_tmp8_ = _file_index;
			_file_index = _tmp8_ + 1;
			_tmp9_ = _file_index;
			_tmp10_ = _file_size;
			if (!(_tmp9_ < _tmp10_)) {
				break;
			}
			_tmp11_ = _file_list;
			_tmp12_ = _file_index;
			_tmp13_ = gee_list_get (_tmp11_, _tmp12_);
			file = (SteadyflowCoreIDownloadFile*) _tmp13_;
			_tmp14_ = file;
			_tmp15_ = steadyflow_core_idownload_file_get_local_basename (_tmp14_);
			_tmp16_ = _tmp15_;
			_tmp17_ = g_utf8_casefold (_tmp16_, (gssize) (-1));
			_tmp18_ = _tmp17_;
			_tmp19_ = self->priv->filter;
			_tmp20_ = string_contains (_tmp18_, _tmp19_);
			_tmp21_ = !_tmp20_;
			_g_free0 (_tmp18_);
			if (_tmp21_) {
				_g_object_unref0 (file);
				continue;
			}
			_tmp22_ = self->priv->model;
			gtk_list_store_prepend (_tmp22_, &_tmp23_);
			iter = _tmp23_;
			_tmp24_ = self->priv->model;
			_tmp25_ = iter;
			_tmp26_ = file;
			gtk_list_store_set (_tmp24_, &_tmp25_, 0, _tmp26_, -1, -1);
			_g_object_unref0 (file);
		}
		_g_object_unref0 (_file_list);
	}
	g_signal_emit_by_name (self, "filelist-changed");
}
Exemplo n.º 13
0
void steadyflow_file_list_controller_on_file_add_request (SteadyflowFileListController* self, SteadyflowAddFileDialog* dlg) {
	gchar* save_to;
	gboolean _tmp0_ = FALSE;
	SteadyflowAddFileDialog* _tmp1_;
	SteadyflowCoreIDownloadFileFinishAction _tmp2_ = 0;
	gboolean _tmp6_;
	SteadyflowAddFileDialog* _tmp14_;
	gchar* _tmp15_ = NULL;
	const gchar* _tmp16_;
	SteadyflowAddFileDialog* _tmp24_;
	gchar* _tmp25_ = NULL;
	gchar* url;
	const gchar* _tmp50_;
	GFile* _tmp51_ = NULL;
	GFile* _tmp52_;
	gboolean _tmp53_ = FALSE;
	gboolean _tmp54_;
	SteadyflowAddFileDialog* _tmp67_;
	SteadyflowCoreIDownloadFileFinishAction _tmp68_ = 0;
	SteadyflowCoreIDownloadFileFinishAction finish_action;
	SteadyflowAddFileDialog* _tmp69_;
	gchar* _tmp70_ = NULL;
	gchar* finish_command;
	SteadyflowAddFileDialog* _tmp71_;
	GError * _inner_error_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (dlg != NULL);
	save_to = NULL;
	_tmp1_ = dlg;
	_tmp2_ = steadyflow_add_file_dialog_get_finish_action (_tmp1_);
	if (_tmp2_ == STEADYFLOW_CORE_IDOWNLOAD_FILE_FINISH_ACTION_RUN_COMMAND) {
		SteadyflowAddFileDialog* _tmp3_;
		gchar* _tmp4_ = NULL;
		gchar* _tmp5_;
		_tmp3_ = dlg;
		_tmp4_ = steadyflow_add_file_dialog_get_finish_command (_tmp3_);
		_tmp5_ = _tmp4_;
		_tmp0_ = _tmp5_ == NULL;
		_g_free0 (_tmp5_);
	} else {
		_tmp0_ = FALSE;
	}
	_tmp6_ = _tmp0_;
	if (_tmp6_) {
		SteadyflowAddFileDialog* _tmp7_;
		const gchar* _tmp8_ = NULL;
		const gchar* _tmp9_ = NULL;
		GtkMessageDialog* _tmp10_;
		GtkMessageDialog* _tmp11_;
		GtkMessageDialog* md;
		GtkMessageDialog* _tmp12_;
		GtkMessageDialog* _tmp13_;
		_tmp7_ = dlg;
		_tmp8_ = _ ("Please enter a command to run");
		_tmp9_ = _ ("You have specified that Steadyflow should run a command when the downl" \
"oad finishes, " "but have not entered a command to run. Please specify it.");
		_tmp10_ = (GtkMessageDialog*) gtk_message_dialog_new_with_markup ((GtkWindow*) _tmp7_, GTK_DIALOG_MODAL, GTK_MESSAGE_WARNING, GTK_BUTTONS_CLOSE, STEADYFLOW_UI_UI_UTIL_MESSAGE_FORMAT, _tmp8_, _tmp9_);
		_tmp11_ = g_object_ref_sink (_tmp10_);
		md = _tmp11_;
		_tmp12_ = md;
		gtk_dialog_run ((GtkDialog*) _tmp12_);
		_tmp13_ = md;
		gtk_widget_destroy ((GtkWidget*) _tmp13_);
		_g_object_unref0 (md);
		_g_free0 (save_to);
		return;
	}
	_tmp14_ = dlg;
	_tmp15_ = steadyflow_add_file_dialog_get_save_path (_tmp14_);
	_g_free0 (save_to);
	save_to = _tmp15_;
	_tmp16_ = save_to;
	if (_tmp16_ == NULL) {
		SteadyflowAddFileDialog* _tmp17_;
		const gchar* _tmp18_ = NULL;
		const gchar* _tmp19_ = NULL;
		GtkMessageDialog* _tmp20_;
		GtkMessageDialog* _tmp21_;
		GtkMessageDialog* md;
		GtkMessageDialog* _tmp22_;
		GtkMessageDialog* _tmp23_;
		_tmp17_ = dlg;
		_tmp18_ = _ ("Invalid file name");
		_tmp19_ = _ ("The file name you have entered is not valid. Please correct it.");
		_tmp20_ = (GtkMessageDialog*) gtk_message_dialog_new_with_markup ((GtkWindow*) _tmp17_, GTK_DIALOG_MODAL, GTK_MESSAGE_WARNING, GTK_BUTTONS_CLOSE, STEADYFLOW_UI_UI_UTIL_MESSAGE_FORMAT, _tmp18_, _tmp19_);
		_tmp21_ = g_object_ref_sink (_tmp20_);
		md = _tmp21_;
		_tmp22_ = md;
		gtk_dialog_run ((GtkDialog*) _tmp22_);
		_tmp23_ = md;
		gtk_widget_destroy ((GtkWidget*) _tmp23_);
		_g_object_unref0 (md);
		_g_free0 (save_to);
		return;
	}
	_tmp24_ = dlg;
	_tmp25_ = steadyflow_add_file_dialog_get_url (_tmp24_);
	url = _tmp25_;
	{
		SteadyflowCoreIDownloadService* _tmp26_;
		SteadyflowCoreIDownloadService* _tmp27_;
		GeeList* _tmp28_;
		GeeList* _tmp29_;
		GeeList* _file_list;
		GeeList* _tmp30_;
		gint _tmp31_;
		gint _tmp32_;
		gint _file_size;
		gint _file_index;
		_tmp26_ = steadyflow_services_get_download ();
		_tmp27_ = _tmp26_;
		_tmp28_ = steadyflow_core_idownload_service_get_files (_tmp27_);
		_tmp29_ = _tmp28_;
		_file_list = _tmp29_;
		_tmp30_ = _file_list;
		_tmp31_ = gee_collection_get_size ((GeeCollection*) _tmp30_);
		_tmp32_ = _tmp31_;
		_file_size = _tmp32_;
		_file_index = -1;
		while (TRUE) {
			gint _tmp33_;
			gint _tmp34_;
			gint _tmp35_;
			GeeList* _tmp36_;
			gint _tmp37_;
			gpointer _tmp38_ = NULL;
			SteadyflowCoreIDownloadFile* file;
			SteadyflowCoreIDownloadFile* _tmp39_;
			const gchar* _tmp40_;
			const gchar* _tmp41_;
			const gchar* _tmp42_;
			_tmp33_ = _file_index;
			_file_index = _tmp33_ + 1;
			_tmp34_ = _file_index;
			_tmp35_ = _file_size;
			if (!(_tmp34_ < _tmp35_)) {
				break;
			}
			_tmp36_ = _file_list;
			_tmp37_ = _file_index;
			_tmp38_ = gee_list_get (_tmp36_, _tmp37_);
			file = (SteadyflowCoreIDownloadFile*) _tmp38_;
			_tmp39_ = file;
			_tmp40_ = steadyflow_core_idownload_file_get_url (_tmp39_);
			_tmp41_ = _tmp40_;
			_tmp42_ = url;
			if (g_strcmp0 (_tmp41_, _tmp42_) == 0) {
				SteadyflowAddFileDialog* _tmp43_;
				const gchar* _tmp44_ = NULL;
				const gchar* _tmp45_ = NULL;
				GtkMessageDialog* _tmp46_;
				GtkMessageDialog* _tmp47_;
				GtkMessageDialog* md;
				GtkMessageDialog* _tmp48_;
				GtkMessageDialog* _tmp49_;
				_tmp43_ = dlg;
				_tmp44_ = _ ("File already in list");
				_tmp45_ = _ ("The address you are trying to add for download is already in the file " \
"list.");
				_tmp46_ = (GtkMessageDialog*) gtk_message_dialog_new_with_markup ((GtkWindow*) _tmp43_, GTK_DIALOG_MODAL, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, STEADYFLOW_UI_UI_UTIL_MESSAGE_FORMAT, _tmp44_, _tmp45_);
				_tmp47_ = g_object_ref_sink (_tmp46_);
				md = _tmp47_;
				_tmp48_ = md;
				gtk_dialog_run ((GtkDialog*) _tmp48_);
				_tmp49_ = md;
				gtk_widget_destroy ((GtkWidget*) _tmp49_);
				_g_object_unref0 (md);
				_g_object_unref0 (file);
				_g_object_unref0 (_file_list);
				_g_free0 (url);
				_g_free0 (save_to);
				return;
			}
			_g_object_unref0 (file);
		}
		_g_object_unref0 (_file_list);
	}
	_tmp50_ = save_to;
	_tmp51_ = g_file_new_for_path (_tmp50_);
	_tmp52_ = _tmp51_;
	_tmp53_ = g_file_query_exists (_tmp52_, NULL);
	_tmp54_ = _tmp53_;
	_g_object_unref0 (_tmp52_);
	if (_tmp54_) {
		SteadyflowAddFileDialog* _tmp55_;
		const gchar* _tmp56_ = NULL;
		const gchar* _tmp57_ = NULL;
		GtkMessageDialog* _tmp58_;
		GtkMessageDialog* _tmp59_;
		GtkMessageDialog* md;
		GtkMessageDialog* _tmp60_;
		GtkMessageDialog* _tmp61_;
		const gchar* _tmp62_ = NULL;
		GtkMessageDialog* _tmp63_;
		gint _tmp64_ = 0;
		gint response;
		GtkMessageDialog* _tmp65_;
		gint _tmp66_;
		_tmp55_ = dlg;
		_tmp56_ = _ ("File exists");
		_tmp57_ = _ ("The file you are trying to save the download to already exists. " "Are you sure you want to overwrite it?");
		_tmp58_ = (GtkMessageDialog*) gtk_message_dialog_new_with_markup ((GtkWindow*) _tmp55_, GTK_DIALOG_MODAL, GTK_MESSAGE_WARNING, GTK_BUTTONS_NONE, STEADYFLOW_UI_UI_UTIL_MESSAGE_FORMAT, _tmp56_, _tmp57_);
		_tmp59_ = g_object_ref_sink (_tmp58_);
		md = _tmp59_;
		_tmp60_ = md;
		gtk_dialog_add_button ((GtkDialog*) _tmp60_, GTK_STOCK_CANCEL, (gint) GTK_RESPONSE_CANCEL);
		_tmp61_ = md;
		_tmp62_ = _ ("Overwrite");
		gtk_dialog_add_button ((GtkDialog*) _tmp61_, _tmp62_, (gint) GTK_RESPONSE_OK);
		_tmp63_ = md;
		_tmp64_ = gtk_dialog_run ((GtkDialog*) _tmp63_);
		response = _tmp64_;
		_tmp65_ = md;
		gtk_widget_destroy ((GtkWidget*) _tmp65_);
		_tmp66_ = response;
		if (_tmp66_ != ((gint) GTK_RESPONSE_OK)) {
			_g_object_unref0 (md);
			_g_free0 (url);
			_g_free0 (save_to);
			return;
		}
		_g_object_unref0 (md);
	}
	_tmp67_ = dlg;
	_tmp68_ = steadyflow_add_file_dialog_get_finish_action (_tmp67_);
	finish_action = _tmp68_;
	_tmp69_ = dlg;
	_tmp70_ = steadyflow_add_file_dialog_get_finish_command (_tmp69_);
	finish_command = _tmp70_;
	_tmp71_ = dlg;
	gtk_widget_destroy ((GtkWidget*) _tmp71_);
	{
		SteadyflowCoreIDownloadService* _tmp72_;
		SteadyflowCoreIDownloadService* _tmp73_;
		const gchar* _tmp74_;
		const gchar* _tmp75_;
		SteadyflowCoreIDownloadFileFinishAction _tmp76_;
		const gchar* _tmp77_;
		SteadyflowCoreIDownloadFile* _tmp78_ = NULL;
		SteadyflowCoreIDownloadFile* _tmp79_;
		_tmp72_ = steadyflow_services_get_download ();
		_tmp73_ = _tmp72_;
		_tmp74_ = url;
		_tmp75_ = save_to;
		_tmp76_ = finish_action;
		_tmp77_ = finish_command;
		_tmp78_ = steadyflow_core_idownload_service_add_file (_tmp73_, _tmp74_, _tmp75_, _tmp76_, _tmp77_, &_inner_error_);
		_tmp79_ = _tmp78_;
		_g_object_unref0 (_tmp79_);
		if (_inner_error_ != NULL) {
			goto __catch17_g_error;
		}
	}
	goto __finally17;
	__catch17_g_error:
	{
		GError* e = NULL;
		const gchar* _tmp80_ = NULL;
		const gchar* _tmp81_ = NULL;
		gchar* _tmp82_;
		gchar* _tmp83_;
		GError* _tmp84_;
		const gchar* _tmp85_;
		gchar* _tmp86_;
		gchar* _tmp87_;
		GtkMessageDialog* _tmp88_;
		GtkMessageDialog* _tmp89_;
		GtkMessageDialog* _tmp90_;
		GtkMessageDialog* md;
		GtkMessageDialog* _tmp91_;
		GtkMessageDialog* _tmp92_;
		e = _inner_error_;
		_inner_error_ = NULL;
		_tmp80_ = _ ("Error adding download");
		_tmp81_ = _ ("An error has occurred while trying to start the download.");
		_tmp82_ = g_strconcat (_tmp81_, "\n\n", NULL);
		_tmp83_ = _tmp82_;
		_tmp84_ = e;
		_tmp85_ = _tmp84_->message;
		_tmp86_ = g_strconcat (_tmp83_, _tmp85_, NULL);
		_tmp87_ = _tmp86_;
		_tmp88_ = (GtkMessageDialog*) gtk_message_dialog_new_with_markup (NULL, 0, GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, STEADYFLOW_UI_UI_UTIL_MESSAGE_FORMAT, _tmp80_, _tmp87_);
		_tmp89_ = g_object_ref_sink (_tmp88_);
		_tmp90_ = _tmp89_;
		_g_free0 (_tmp87_);
		_g_free0 (_tmp83_);
		md = _tmp90_;
		_tmp91_ = md;
		gtk_dialog_run ((GtkDialog*) _tmp91_);
		_tmp92_ = md;
		gtk_widget_destroy ((GtkWidget*) _tmp92_);
		_g_object_unref0 (md);
		_g_error_free0 (e);
	}
	__finally17:
	if (_inner_error_ != NULL) {
		_g_free0 (finish_command);
		_g_free0 (url);
		_g_free0 (save_to);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
		g_clear_error (&_inner_error_);
		return;
	}
	_g_free0 (finish_command);
	_g_free0 (url);
	_g_free0 (save_to);
}
Exemplo n.º 14
0
static gboolean rygel_media_container_real_search_co (RygelMediaContainerSearchData* data) {
	switch (data->_state_) {
		case 0:
		goto _state_0;
		case 25:
		goto _state_25;
		case 26:
		goto _state_26;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	{
		data->_result_ = gee_array_list_new (RYGEL_TYPE_MEDIA_OBJECT, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL);
		data->_state_ = 25;
		rygel_media_container_get_children (data->self, (guint) 0, (guint) data->self->child_count, data->cancellable, rygel_media_container_search_ready, data);
		return FALSE;
		_state_25:
		data->children = rygel_media_container_get_children_finish (data->self, data->_res_, &data->_inner_error_);
		if (data->_inner_error_ != NULL) {
			g_simple_async_result_set_from_error (data->_async_result, data->_inner_error_);
			g_error_free (data->_inner_error_);
			_g_object_unref0 (data->_result_);
			{
				if (data->_state_ == 0) {
					g_simple_async_result_complete_in_idle (data->_async_result);
				} else {
					g_simple_async_result_complete (data->_async_result);
				}
				g_object_unref (data->_async_result);
				return FALSE;
			}
		}
#line 108 "rygel-media-container.vala"
		if (data->offset > 0) {
#line 108 "rygel-media-container.vala"
			data->_tmp0_ = TRUE;
#line 454 "rygel-media-container.c"
		} else {
#line 108 "rygel-media-container.vala"
			data->_tmp0_ = data->max_count > 0;
#line 458 "rygel-media-container.c"
		}
#line 108 "rygel-media-container.vala"
		if (data->_tmp0_) {
#line 109 "rygel-media-container.vala"
			data->limit = data->offset + data->max_count;
#line 464 "rygel-media-container.c"
		} else {
#line 111 "rygel-media-container.vala"
			data->limit = (guint) 0;
#line 468 "rygel-media-container.c"
		}
		{
			data->_child_it = gee_iterable_iterator ((GeeIterable*) data->children);
#line 115 "rygel-media-container.vala"
			while (TRUE) {
#line 115 "rygel-media-container.vala"
				if (!gee_iterator_next (data->_child_it)) {
#line 115 "rygel-media-container.vala"
					break;
#line 478 "rygel-media-container.c"
				}
				data->child = (RygelMediaObject*) gee_iterator_get (data->_child_it);
#line 116 "rygel-media-container.vala"
				if (data->expression == NULL) {
#line 116 "rygel-media-container.vala"
					data->_tmp1_ = TRUE;
#line 485 "rygel-media-container.c"
				} else {
#line 116 "rygel-media-container.vala"
					data->_tmp1_ = rygel_search_expression_satisfied_by (data->expression, data->child);
#line 489 "rygel-media-container.c"
				}
#line 116 "rygel-media-container.vala"
				if (data->_tmp1_) {
#line 117 "rygel-media-container.vala"
					gee_abstract_collection_add ((GeeAbstractCollection*) data->_result_, data->child);
#line 495 "rygel-media-container.c"
				}
#line 120 "rygel-media-container.vala"
				if (data->limit > 0) {
#line 120 "rygel-media-container.vala"
					data->_tmp2_ = gee_collection_get_size ((GeeCollection*) data->_result_) >= data->limit;
#line 501 "rygel-media-container.c"
				} else {
#line 120 "rygel-media-container.vala"
					data->_tmp2_ = FALSE;
#line 505 "rygel-media-container.c"
				}
#line 120 "rygel-media-container.vala"
				if (data->_tmp2_) {
#line 509 "rygel-media-container.c"
					_g_object_unref0 (data->child);
#line 121 "rygel-media-container.vala"
					break;
#line 513 "rygel-media-container.c"
				}
				_g_object_unref0 (data->child);
			}
			_g_object_unref0 (data->_child_it);
		}
#line 125 "rygel-media-container.vala"
		if (data->limit == 0) {
#line 125 "rygel-media-container.vala"
			data->_tmp3_ = TRUE;
#line 523 "rygel-media-container.c"
		} else {
#line 125 "rygel-media-container.vala"
			data->_tmp3_ = gee_collection_get_size ((GeeCollection*) data->_result_) < data->limit;
#line 527 "rygel-media-container.c"
		}
#line 125 "rygel-media-container.vala"
		if (data->_tmp3_) {
#line 127 "rygel-media-container.vala"
			if (data->limit == 0) {
#line 127 "rygel-media-container.vala"
				data->_tmp4_ = (guint) 0;
#line 535 "rygel-media-container.c"
			} else {
#line 127 "rygel-media-container.vala"
				data->_tmp4_ = data->limit - gee_collection_get_size ((GeeCollection*) data->_result_);
#line 539 "rygel-media-container.c"
			}
			data->child_limit = data->_tmp4_;
			data->_state_ = 26;
			rygel_media_container_search_in_children (data->self, data->expression, data->children, data->child_limit, data->cancellable, rygel_media_container_search_ready, data);
			return FALSE;
			_state_26:
			data->child_results = rygel_media_container_search_in_children_finish (data->self, data->_res_, &data->_inner_error_);
			if (data->_inner_error_ != NULL) {
				g_simple_async_result_set_from_error (data->_async_result, data->_inner_error_);
				g_error_free (data->_inner_error_);
				_g_object_unref0 (data->_result_);
				_g_object_unref0 (data->children);
				{
					if (data->_state_ == 0) {
						g_simple_async_result_complete_in_idle (data->_async_result);
					} else {
						g_simple_async_result_complete (data->_async_result);
					}
					g_object_unref (data->_async_result);
					return FALSE;
				}
			}
#line 133 "rygel-media-container.vala"
			gee_abstract_collection_add_all ((GeeAbstractCollection*) data->_result_, (GeeCollection*) data->child_results);
#line 564 "rygel-media-container.c"
			_g_object_unref0 (data->child_results);
		}
#line 137 "rygel-media-container.vala"
		if (gee_collection_get_size ((GeeCollection*) data->_result_) > 0) {
#line 137 "rygel-media-container.vala"
			data->_tmp5_ = data->limit > 0;
#line 571 "rygel-media-container.c"
		} else {
#line 137 "rygel-media-container.vala"
			data->_tmp5_ = FALSE;
#line 575 "rygel-media-container.c"
		}
#line 137 "rygel-media-container.vala"
		if (data->_tmp5_) {
#line 141 "rygel-media-container.vala"
			data->start = CLAMP (data->offset, (guint) 0, (guint) (gee_collection_get_size ((GeeCollection*) data->_result_) - 1));
#line 143 "rygel-media-container.vala"
			if (data->max_count != 0) {
#line 143 "rygel-media-container.vala"
				data->_tmp6_ = (data->start + data->max_count) <= gee_collection_get_size ((GeeCollection*) data->_result_);
#line 585 "rygel-media-container.c"
			} else {
#line 143 "rygel-media-container.vala"
				data->_tmp6_ = FALSE;
#line 589 "rygel-media-container.c"
			}
#line 143 "rygel-media-container.vala"
			if (data->_tmp6_) {
#line 144 "rygel-media-container.vala"
				data->stop = data->start + data->max_count;
#line 595 "rygel-media-container.c"
			} else {
#line 146 "rygel-media-container.vala"
				data->stop = (guint) gee_collection_get_size ((GeeCollection*) data->_result_);
#line 599 "rygel-media-container.c"
			}
#line 151 "rygel-media-container.vala"
			data->total_matches = (guint) 0;
#line 603 "rygel-media-container.c"
			data->result = gee_abstract_list_slice ((GeeAbstractList*) data->_result_, (gint) data->start, (gint) data->stop);
			_g_object_unref0 (data->_result_);
			_g_object_unref0 (data->children);
			{
				if (data->_state_ == 0) {
					g_simple_async_result_complete_in_idle (data->_async_result);
				} else {
					g_simple_async_result_complete (data->_async_result);
				}
				g_object_unref (data->_async_result);
				return FALSE;
			}
		} else {
#line 155 "rygel-media-container.vala"
			data->total_matches = (guint) gee_collection_get_size ((GeeCollection*) data->_result_);
#line 619 "rygel-media-container.c"
			data->result = (GeeList*) data->_result_;
			_g_object_unref0 (data->children);
			{
				if (data->_state_ == 0) {
					g_simple_async_result_complete_in_idle (data->_async_result);
				} else {
					g_simple_async_result_complete (data->_async_result);
				}
				g_object_unref (data->_async_result);
				return FALSE;
			}
		}
		_g_object_unref0 (data->_result_);
		_g_object_unref0 (data->children);
	}
	{
		if (data->_state_ == 0) {
			g_simple_async_result_complete_in_idle (data->_async_result);
		} else {
			g_simple_async_result_complete (data->_async_result);
		}
		g_object_unref (data->_async_result);
		return FALSE;
	}
}
Exemplo n.º 15
0
SteadyflowFileListController* steadyflow_file_list_controller_construct (GType object_type, GtkTreeView* tree) {
	SteadyflowFileListController * self = NULL;
	GtkTreeView* _tmp0_;
	GtkTreeView* _tmp1_;
	GtkTreeView* _tmp2_;
	GtkTreeSelection* _tmp3_ = NULL;
	GTimer* _tmp4_;
	GTimer* _tmp5_;
	GtkTreeViewColumn* _tmp6_;
	GtkTreeViewColumn* _tmp7_;
	GtkTreeViewColumn* column;
	GtkTreeViewColumn* _tmp8_;
	GtkTreeViewColumn* _tmp9_;
	SteadyflowUIDownloadCellRenderer* _tmp10_;
	GtkCellRenderer* _tmp11_;
	GtkCellRenderer* renderer;
	GtkTreeViewColumn* _tmp12_;
	GtkCellRenderer* _tmp13_;
	GtkTreeViewColumn* _tmp14_;
	GtkCellRenderer* _tmp15_;
	GType* _tmp16_ = NULL;
	GType* _tmp17_;
	gint _tmp17__length1;
	GtkListStore* _tmp18_;
	GtkTreeView* _tmp19_;
	GtkListStore* _tmp20_;
	GtkTreeView* _tmp21_;
	GtkTreeViewColumn* _tmp22_;
	SteadyflowCoreIDownloadService* _tmp37_;
	SteadyflowCoreIDownloadService* _tmp38_;
	SteadyflowCoreIDownloadService* _tmp39_;
	SteadyflowCoreIDownloadService* _tmp40_;
	GtkTreeView* _tmp41_;
	GtkTreeSelection* _tmp42_ = NULL;
	g_return_val_if_fail (tree != NULL, NULL);
	self = (SteadyflowFileListController*) g_object_new (object_type, NULL);
	_tmp0_ = tree;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	_g_object_unref0 (self->priv->tree);
	self->priv->tree = _tmp1_;
	_tmp2_ = tree;
	_tmp3_ = gtk_tree_view_get_selection (_tmp2_);
	gtk_tree_selection_set_mode (_tmp3_, GTK_SELECTION_MULTIPLE);
	_tmp4_ = g_timer_new ();
	_g_timer_destroy0 (self->priv->redraw_timer);
	self->priv->redraw_timer = _tmp4_;
	_tmp5_ = self->priv->redraw_timer;
	g_timer_start (_tmp5_);
	_tmp6_ = gtk_tree_view_column_new ();
	_tmp7_ = g_object_ref_sink (_tmp6_);
	column = _tmp7_;
	_tmp8_ = column;
	gtk_tree_view_column_set_expand (_tmp8_, TRUE);
	_tmp9_ = column;
	gtk_tree_view_column_set_clickable (_tmp9_, FALSE);
	_tmp10_ = steadyflow_ui_download_cell_renderer_new ();
	_tmp11_ = (GtkCellRenderer*) g_object_ref_sink (_tmp10_);
	renderer = _tmp11_;
	_tmp12_ = column;
	_tmp13_ = renderer;
	gtk_cell_layout_pack_start ((GtkCellLayout*) _tmp12_, _tmp13_, TRUE);
	_tmp14_ = column;
	_tmp15_ = renderer;
	gtk_cell_layout_set_cell_data_func ((GtkCellLayout*) _tmp14_, _tmp15_, _steadyflow_file_list_controller_set_cell_data_gtk_cell_layout_data_func, g_object_ref (self), g_object_unref);
	_tmp16_ = g_new0 (GType, 1);
	_tmp16_[0] = STEADYFLOW_CORE_TYPE_IDOWNLOAD_FILE;
	_tmp17_ = _tmp16_;
	_tmp17__length1 = 1;
	_tmp18_ = gtk_list_store_newv (1, _tmp17_);
	_g_object_unref0 (self->priv->model);
	self->priv->model = _tmp18_;
	_tmp17_ = (g_free (_tmp17_), NULL);
	_tmp19_ = tree;
	_tmp20_ = self->priv->model;
	gtk_tree_view_set_model (_tmp19_, (GtkTreeModel*) _tmp20_);
	_tmp21_ = tree;
	_tmp22_ = column;
	gtk_tree_view_append_column (_tmp21_, _tmp22_);
	{
		SteadyflowCoreIDownloadService* _tmp23_;
		SteadyflowCoreIDownloadService* _tmp24_;
		GeeList* _tmp25_;
		GeeList* _tmp26_;
		GeeList* _file_list;
		GeeList* _tmp27_;
		gint _tmp28_;
		gint _tmp29_;
		gint _file_size;
		gint _file_index;
		_tmp23_ = steadyflow_services_get_download ();
		_tmp24_ = _tmp23_;
		_tmp25_ = steadyflow_core_idownload_service_get_files (_tmp24_);
		_tmp26_ = _tmp25_;
		_file_list = _tmp26_;
		_tmp27_ = _file_list;
		_tmp28_ = gee_collection_get_size ((GeeCollection*) _tmp27_);
		_tmp29_ = _tmp28_;
		_file_size = _tmp29_;
		_file_index = -1;
		while (TRUE) {
			gint _tmp30_;
			gint _tmp31_;
			gint _tmp32_;
			GeeList* _tmp33_;
			gint _tmp34_;
			gpointer _tmp35_ = NULL;
			SteadyflowCoreIDownloadFile* file;
			SteadyflowCoreIDownloadFile* _tmp36_;
			_tmp30_ = _file_index;
			_file_index = _tmp30_ + 1;
			_tmp31_ = _file_index;
			_tmp32_ = _file_size;
			if (!(_tmp31_ < _tmp32_)) {
				break;
			}
			_tmp33_ = _file_list;
			_tmp34_ = _file_index;
			_tmp35_ = gee_list_get (_tmp33_, _tmp34_);
			file = (SteadyflowCoreIDownloadFile*) _tmp35_;
			_tmp36_ = file;
			steadyflow_file_list_controller_connect_file_signals (self, _tmp36_);
			_g_object_unref0 (file);
		}
		_g_object_unref0 (_file_list);
	}
	steadyflow_file_list_controller_update_model (self);
	_tmp37_ = steadyflow_services_get_download ();
	_tmp38_ = _tmp37_;
	g_signal_connect_object (_tmp38_, "file-added", (GCallback) ___lambda26__steadyflow_core_idownload_service_file_added, self, 0);
	_tmp39_ = steadyflow_services_get_download ();
	_tmp40_ = _tmp39_;
	g_signal_connect_object (_tmp40_, "file-removed", (GCallback) ___lambda27__steadyflow_core_idownload_service_file_removed, self, 0);
	_tmp41_ = tree;
	_tmp42_ = gtk_tree_view_get_selection (_tmp41_);
	g_signal_connect_object (_tmp42_, "changed", (GCallback) ___lambda28__gtk_tree_selection_changed, self, 0);
	_g_object_unref0 (renderer);
	_g_object_unref0 (column);
	return self;
}
Exemplo n.º 16
0
static gboolean rygel_media_container_find_object_co (RygelMediaContainerFindObjectData* data) {
	switch (data->_state_) {
		case 0:
		goto _state_0;
		case 29:
		goto _state_29;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	{
		data->expression = rygel_relational_expression_new ();
#line 220 "rygel-media-container.vala"
		((RygelSearchExpression*) data->expression)->op = GINT_TO_POINTER (GUPNP_SEARCH_CRITERIA_OP_EQ);
#line 221 "rygel-media-container.vala"
		((RygelSearchExpression*) data->expression)->operand1 = (data->_tmp0_ = g_strdup ("@id"), _g_free0 (((RygelSearchExpression*) data->expression)->operand1), data->_tmp0_);
#line 222 "rygel-media-container.vala"
		((RygelSearchExpression*) data->expression)->operand2 = (data->_tmp1_ = g_strdup (data->id), _g_free0 (((RygelSearchExpression*) data->expression)->operand2), data->_tmp1_);
#line 902 "rygel-media-container.c"
		data->_state_ = 29;
		rygel_media_container_search (data->self, (RygelSearchExpression*) data->expression, (guint) 0, (guint) 1, data->cancellable, rygel_media_container_find_object_ready, data);
		return FALSE;
		_state_29:
		data->results = rygel_media_container_search_finish (data->self, data->_res_, &data->total_matches, &data->_inner_error_);
		if (data->_inner_error_ != NULL) {
			g_simple_async_result_set_from_error (data->_async_result, data->_inner_error_);
			g_error_free (data->_inner_error_);
			_rygel_search_expression_unref0 (data->expression);
			{
				if (data->_state_ == 0) {
					g_simple_async_result_complete_in_idle (data->_async_result);
				} else {
					g_simple_async_result_complete (data->_async_result);
				}
				g_object_unref (data->_async_result);
				return FALSE;
			}
		}
#line 230 "rygel-media-container.vala"
		if (gee_collection_get_size ((GeeCollection*) data->results) > 0) {
#line 924 "rygel-media-container.c"
			data->result = (RygelMediaObject*) gee_list_get (data->results, 0);
			_rygel_search_expression_unref0 (data->expression);
			_g_object_unref0 (data->results);
			{
				if (data->_state_ == 0) {
					g_simple_async_result_complete_in_idle (data->_async_result);
				} else {
					g_simple_async_result_complete (data->_async_result);
				}
				g_object_unref (data->_async_result);
				return FALSE;
			}
		} else {
			data->result = NULL;
			_rygel_search_expression_unref0 (data->expression);
			_g_object_unref0 (data->results);
			{
				if (data->_state_ == 0) {
					g_simple_async_result_complete_in_idle (data->_async_result);
				} else {
					g_simple_async_result_complete (data->_async_result);
				}
				g_object_unref (data->_async_result);
				return FALSE;
			}
		}
		_rygel_search_expression_unref0 (data->expression);
		_g_object_unref0 (data->results);
	}
	{
		if (data->_state_ == 0) {
			g_simple_async_result_complete_in_idle (data->_async_result);
		} else {
			g_simple_async_result_complete (data->_async_result);
		}
		g_object_unref (data->_async_result);
		return FALSE;
	}
}
Exemplo n.º 17
0
static void ease_main_remove_window (EaseEditorWindow* win) {
#line 859 "ease-main.c"
	guint _tmp0_;
	guint _tmp1_;
	gboolean _tmp2_ = FALSE;
#line 278 "ease-main.vala"
	g_return_if_fail (win != NULL);
#line 865 "ease-main.c"
	{
		GeeIterator* _info_it;
#line 280 "ease-main.vala"
		_info_it = gee_abstract_collection_iterator ((GeeAbstractCollection*) ease_main_windows);
#line 280 "ease-main.vala"
		while (TRUE) {
#line 872 "ease-main.c"
			EaseMainEditorWindowInfo* info;
#line 280 "ease-main.vala"
			if (!gee_iterator_next (_info_it)) {
#line 280 "ease-main.vala"
				break;
#line 878 "ease-main.c"
			}
#line 280 "ease-main.vala"
			info = (EaseMainEditorWindowInfo*) gee_iterator_get (_info_it);
#line 282 "ease-main.vala"
			if (info->window == win) {
#line 284 "ease-main.vala"
				gee_abstract_collection_remove ((GeeAbstractCollection*) ease_main_windows, info);
#line 886 "ease-main.c"
				_ease_main_editor_window_info_unref0 (info);
#line 285 "ease-main.vala"
				break;
#line 890 "ease-main.c"
			}
			_ease_main_editor_window_info_unref0 (info);
		}
		_g_object_unref0 (_info_it);
	}
#line 288 "ease-main.vala"
	g_signal_parse_name ("play", EASE_TYPE_EDITOR_WINDOW, &_tmp0_, NULL, FALSE);
#line 288 "ease-main.vala"
	g_signal_handlers_disconnect_matched (win, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp0_, 0, NULL, (GCallback) _ease_main_on_play_ease_editor_window_play, NULL);
#line 289 "ease-main.vala"
	g_signal_parse_name ("close", EASE_TYPE_EDITOR_WINDOW, &_tmp1_, NULL, FALSE);
#line 289 "ease-main.vala"
	g_signal_handlers_disconnect_matched (win, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp1_, 0, NULL, (GCallback) _ease_main_on_close_ease_editor_window_close, NULL);
#line 291 "ease-main.vala"
	if (gee_collection_get_size ((GeeCollection*) ease_main_windows) == 0) {
#line 291 "ease-main.vala"
		_tmp2_ = ease_main_welcome == NULL;
#line 908 "ease-main.c"
	} else {
#line 291 "ease-main.vala"
		_tmp2_ = FALSE;
#line 912 "ease-main.c"
	}
#line 291 "ease-main.vala"
	if (_tmp2_) {
#line 293 "ease-main.vala"
		gtk_main_quit ();
#line 918 "ease-main.c"
	}
}
Exemplo n.º 18
0
static gboolean rygel_external_container_real_get_children_co (RygelExternalContainerGetChildrenData* data) {
	switch (data->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	{
		data->media_objects = gee_array_list_new (RYGEL_TYPE_MEDIA_OBJECT, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL);
#line 83 "rygel-external-container.vala"
		gee_abstract_collection_add_all ((GeeAbstractCollection*) data->media_objects, (GeeCollection*) data->self->priv->containers);
#line 388 "rygel-external-container.c"
		data->obj_paths = (data->_tmp1_ = rygel_external_media_container_get_items (data->self->actual_container, &data->_tmp0_), data->obj_paths_length1 = data->_tmp0_, data->_obj_paths_size_ = data->obj_paths_length1, data->_tmp1_);
		data->factory = rygel_external_item_factory_new ();
		{
			data->obj_path_collection = data->obj_paths;
			data->obj_path_collection_length1 = data->obj_paths_length1;
			for (data->obj_path_it = 0; data->obj_path_it < data->obj_paths_length1; data->obj_path_it = data->obj_path_it + 1) {
				data->obj_path = g_strdup (data->obj_path_collection[data->obj_path_it]);
				{
					{
						data->_state_ = 1;
						rygel_external_item_factory_create_for_path (data->factory, data->obj_path, data->self, rygel_external_container_get_children_ready, data);
						return FALSE;
						_state_1:
						data->item = rygel_external_item_factory_create_for_path_finish (data->factory, data->_res_, &data->_inner_error_);
						if (data->_inner_error_ != NULL) {
							goto __catch1_g_error;
						}
#line 92 "rygel-external-container.vala"
						gee_abstract_collection_add ((GeeAbstractCollection*) data->media_objects, (RygelMediaObject*) data->item);
#line 408 "rygel-external-container.c"
						_g_object_unref0 (data->item);
					}
					goto __finally1;
					__catch1_g_error:
					{
						data->err = data->_inner_error_;
						data->_inner_error_ = NULL;
						{
#line 94 "rygel-external-container.vala"
							g_warning ("rygel-external-container.vala:94: Error initializable item at '%s': %s" \
". Ignoring..", data->obj_path, data->err->message);
#line 419 "rygel-external-container.c"
							_g_error_free0 (data->err);
						}
					}
					__finally1:
					if (data->_inner_error_ != NULL) {
						g_simple_async_result_set_from_error (data->_async_result, data->_inner_error_);
						g_error_free (data->_inner_error_);
						_g_free0 (data->obj_path);
						_g_object_unref0 (data->media_objects);
						data->obj_paths = (_vala_array_free (data->obj_paths, data->obj_paths_length1, (GDestroyNotify) g_free), NULL);
						_rygel_external_item_factory_unref0 (data->factory);
						{
							if (data->_state_ == 0) {
								g_simple_async_result_complete_in_idle (data->_async_result);
							} else {
								g_simple_async_result_complete (data->_async_result);
							}
							g_object_unref (data->_async_result);
							return FALSE;
						}
					}
					_g_free0 (data->obj_path);
				}
			}
		}
		data->stop = data->offset + data->max_count;
#line 101 "rygel-external-container.vala"
		data->stop = CLAMP (data->stop, (guint) 0, (guint) gee_collection_get_size ((GeeCollection*) data->media_objects));
#line 448 "rygel-external-container.c"
		data->result = gee_abstract_list_slice ((GeeAbstractList*) data->media_objects, (gint) data->offset, (gint) data->stop);
		_g_object_unref0 (data->media_objects);
		data->obj_paths = (_vala_array_free (data->obj_paths, data->obj_paths_length1, (GDestroyNotify) g_free), NULL);
		_rygel_external_item_factory_unref0 (data->factory);
		{
			if (data->_state_ == 0) {
				g_simple_async_result_complete_in_idle (data->_async_result);
			} else {
				g_simple_async_result_complete (data->_async_result);
			}
			g_object_unref (data->_async_result);
			return FALSE;
		}
		_g_object_unref0 (data->media_objects);
		data->obj_paths = (_vala_array_free (data->obj_paths, data->obj_paths_length1, (GDestroyNotify) g_free), NULL);
		_rygel_external_item_factory_unref0 (data->factory);
	}
	{
		if (data->_state_ == 0) {
			g_simple_async_result_complete_in_idle (data->_async_result);
		} else {
			g_simple_async_result_complete (data->_async_result);
		}
		g_object_unref (data->_async_result);
		return FALSE;
	}
}
Exemplo n.º 19
0
static gboolean rygel_external_container_real_search_co (RygelExternalContainerSearchData* data) {
	switch (data->_state_) {
		case 0:
		goto _state_0;
		case 2:
		goto _state_2;
		case 3:
		goto _state_3;
		case 4:
		goto _state_4;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	{
		data->results = gee_array_list_new (RYGEL_TYPE_MEDIA_OBJECT, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL);
#line 116 "rygel-external-container.vala"
		if (data->expression == NULL) {
#line 116 "rygel-external-container.vala"
			data->_tmp0_ = TRUE;
#line 553 "rygel-external-container.c"
		} else {
#line 116 "rygel-external-container.vala"
			data->_tmp0_ = !RYGEL_IS_RELATIONAL_EXPRESSION (data->expression);
#line 557 "rygel-external-container.c"
		}
#line 116 "rygel-external-container.vala"
		if (data->_tmp0_) {
#line 561 "rygel-external-container.c"
			data->_state_ = 2;
			RYGEL_MEDIA_CONTAINER_CLASS (rygel_external_container_parent_class)->search (RYGEL_MEDIA_CONTAINER (data->self), data->expression, data->offset, data->max_count, data->cancellable, rygel_external_container_search_ready, data);
			return FALSE;
			_state_2:
			data->_tmp1_ = RYGEL_MEDIA_CONTAINER_CLASS (rygel_external_container_parent_class)->search_finish (RYGEL_MEDIA_CONTAINER (data->self), data->_res_, &data->total_matches, &data->_inner_error_);
			if (data->_inner_error_ != NULL) {
				g_simple_async_result_set_from_error (data->_async_result, data->_inner_error_);
				g_error_free (data->_inner_error_);
				_g_object_unref0 (data->results);
				{
					if (data->_state_ == 0) {
						g_simple_async_result_complete_in_idle (data->_async_result);
					} else {
						g_simple_async_result_complete (data->_async_result);
					}
					g_object_unref (data->_async_result);
					return FALSE;
				}
			}
			data->result = data->_tmp1_;
			_g_object_unref0 (data->results);
			{
				if (data->_state_ == 0) {
					g_simple_async_result_complete_in_idle (data->_async_result);
				} else {
					g_simple_async_result_complete (data->_async_result);
				}
				g_object_unref (data->_async_result);
				return FALSE;
			}
		}
		data->rel_expression = _rygel_search_expression_ref0 ((data->_tmp2_ = data->expression, RYGEL_IS_RELATIONAL_EXPRESSION (data->_tmp2_) ? ((RygelRelationalExpression*) data->_tmp2_) : NULL));
		data->id = g_strdup ((const char*) ((RygelSearchExpression*) data->rel_expression)->operand2);
#line 128 "rygel-external-container.vala"
		if (_vala_strcmp0 ((const char*) ((RygelSearchExpression*) data->rel_expression)->operand1, "@id") != 0) {
#line 128 "rygel-external-container.vala"
			data->_tmp4_ = TRUE;
#line 599 "rygel-external-container.c"
		} else {
#line 129 "rygel-external-container.vala"
			data->_tmp4_ = GPOINTER_TO_INT (((RygelSearchExpression*) data->rel_expression)->op) != GUPNP_SEARCH_CRITERIA_OP_EQ;
#line 603 "rygel-external-container.c"
		}
#line 128 "rygel-external-container.vala"
		if (data->_tmp4_) {
#line 128 "rygel-external-container.vala"
			data->_tmp3_ = TRUE;
#line 609 "rygel-external-container.c"
		} else {
#line 130 "rygel-external-container.vala"
			data->_tmp3_ = !rygel_external_container_is_direct_child (data->self, data->id);
#line 613 "rygel-external-container.c"
		}
#line 128 "rygel-external-container.vala"
		if (data->_tmp3_) {
#line 617 "rygel-external-container.c"
			data->_state_ = 3;
			RYGEL_MEDIA_CONTAINER_CLASS (rygel_external_container_parent_class)->search (RYGEL_MEDIA_CONTAINER (data->self), data->expression, data->offset, data->max_count, data->cancellable, rygel_external_container_search_ready, data);
			return FALSE;
			_state_3:
			data->_tmp5_ = RYGEL_MEDIA_CONTAINER_CLASS (rygel_external_container_parent_class)->search_finish (RYGEL_MEDIA_CONTAINER (data->self), data->_res_, &data->total_matches, &data->_inner_error_);
			if (data->_inner_error_ != NULL) {
				g_simple_async_result_set_from_error (data->_async_result, data->_inner_error_);
				g_error_free (data->_inner_error_);
				_g_object_unref0 (data->results);
				_rygel_search_expression_unref0 (data->rel_expression);
				_g_free0 (data->id);
				{
					if (data->_state_ == 0) {
						g_simple_async_result_complete_in_idle (data->_async_result);
					} else {
						g_simple_async_result_complete (data->_async_result);
					}
					g_object_unref (data->_async_result);
					return FALSE;
				}
			}
			data->result = data->_tmp5_;
			_g_object_unref0 (data->results);
			_rygel_search_expression_unref0 (data->rel_expression);
			_g_free0 (data->id);
			{
				if (data->_state_ == 0) {
					g_simple_async_result_complete_in_idle (data->_async_result);
				} else {
					g_simple_async_result_complete (data->_async_result);
				}
				g_object_unref (data->_async_result);
				return FALSE;
			}
		}
		data->factory = rygel_external_item_factory_new ();
#line 140 "rygel-external-container.vala"
		if (rygel_external_item_factory_id_valid (data->id)) {
#line 656 "rygel-external-container.c"
			data->_state_ = 4;
			rygel_external_item_factory_create_for_id (data->factory, data->id, data->self, rygel_external_container_search_ready, data);
			return FALSE;
			_state_4:
			data->media_object = rygel_external_item_factory_create_for_id_finish (data->factory, data->_res_, &data->_inner_error_);
			if (data->_inner_error_ != NULL) {
				g_simple_async_result_set_from_error (data->_async_result, data->_inner_error_);
				g_error_free (data->_inner_error_);
				_g_object_unref0 (data->results);
				_rygel_search_expression_unref0 (data->rel_expression);
				_g_free0 (data->id);
				_rygel_external_item_factory_unref0 (data->factory);
				{
					if (data->_state_ == 0) {
						g_simple_async_result_complete_in_idle (data->_async_result);
					} else {
						g_simple_async_result_complete (data->_async_result);
					}
					g_object_unref (data->_async_result);
					return FALSE;
				}
			}
#line 142 "rygel-external-container.vala"
			gee_abstract_collection_add ((GeeAbstractCollection*) data->results, (RygelMediaObject*) data->media_object);
#line 681 "rygel-external-container.c"
			_g_object_unref0 (data->media_object);
		} else {
			{
				data->_container_it = gee_abstract_collection_iterator ((GeeAbstractCollection*) data->self->priv->containers);
#line 144 "rygel-external-container.vala"
				while (TRUE) {
#line 144 "rygel-external-container.vala"
					if (!gee_iterator_next (data->_container_it)) {
#line 144 "rygel-external-container.vala"
						break;
#line 692 "rygel-external-container.c"
					}
					data->container = (RygelExternalContainer*) gee_iterator_get (data->_container_it);
#line 145 "rygel-external-container.vala"
					if (_vala_strcmp0 (((RygelMediaObject*) data->container)->id, data->id) == 0) {
#line 146 "rygel-external-container.vala"
						gee_abstract_collection_add ((GeeAbstractCollection*) data->results, (RygelMediaObject*) data->container);
#line 699 "rygel-external-container.c"
					}
					_g_object_unref0 (data->container);
				}
				_g_object_unref0 (data->_container_it);
			}
		}
#line 151 "rygel-external-container.vala"
		data->total_matches = (guint) gee_collection_get_size ((GeeCollection*) data->results);
#line 708 "rygel-external-container.c"
		data->result = (GeeList*) data->results;
		_rygel_search_expression_unref0 (data->rel_expression);
		_g_free0 (data->id);
		_rygel_external_item_factory_unref0 (data->factory);
		{
			if (data->_state_ == 0) {
				g_simple_async_result_complete_in_idle (data->_async_result);
			} else {
				g_simple_async_result_complete (data->_async_result);
			}
			g_object_unref (data->_async_result);
			return FALSE;
		}
		_g_object_unref0 (data->results);
		_rygel_search_expression_unref0 (data->rel_expression);
		_g_free0 (data->id);
		_rygel_external_item_factory_unref0 (data->factory);
	}
	{
		if (data->_state_ == 0) {
			g_simple_async_result_complete_in_idle (data->_async_result);
		} else {
			g_simple_async_result_complete (data->_async_result);
		}
		g_object_unref (data->_async_result);
		return FALSE;
	}
}
Exemplo n.º 20
0
static gboolean rygel_media_container_search_in_children_co (RygelMediaContainerSearchInChildrenData* data) {
	switch (data->_state_) {
		case 0:
		goto _state_0;
		case 30:
		goto _state_30;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	{
		data->_result_ = gee_array_list_new (RYGEL_TYPE_MEDIA_OBJECT, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL);
		{
			data->_child_it = gee_iterable_iterator ((GeeIterable*) data->children);
#line 245 "rygel-media-container.vala"
			while (TRUE) {
#line 245 "rygel-media-container.vala"
				if (!gee_iterator_next (data->_child_it)) {
#line 245 "rygel-media-container.vala"
					break;
#line 1033 "rygel-media-container.c"
				}
				data->child = (RygelMediaObject*) gee_iterator_get (data->_child_it);
#line 246 "rygel-media-container.vala"
				if (RYGEL_IS_MEDIA_CONTAINER (data->child)) {
#line 1038 "rygel-media-container.c"
					data->container = _g_object_ref0 ((data->_tmp0_ = data->child, RYGEL_IS_MEDIA_CONTAINER (data->_tmp0_) ? ((RygelMediaContainer*) data->_tmp0_) : NULL));
					data->_state_ = 30;
					rygel_media_container_search (data->container, data->expression, (guint) 0, data->limit, data->cancellable, rygel_media_container_search_in_children_ready, data);
					return FALSE;
					_state_30:
					data->child_result = rygel_media_container_search_finish (data->container, data->_res_, &data->tmp, &data->_inner_error_);
					if (data->_inner_error_ != NULL) {
						g_simple_async_result_set_from_error (data->_async_result, data->_inner_error_);
						g_error_free (data->_inner_error_);
						_g_object_unref0 (data->container);
						_g_object_unref0 (data->child);
						_g_object_unref0 (data->_child_it);
						_g_object_unref0 (data->_result_);
						{
							if (data->_state_ == 0) {
								g_simple_async_result_complete_in_idle (data->_async_result);
							} else {
								g_simple_async_result_complete (data->_async_result);
							}
							g_object_unref (data->_async_result);
							return FALSE;
						}
					}
#line 256 "rygel-media-container.vala"
					gee_abstract_collection_add_all ((GeeAbstractCollection*) data->_result_, (GeeCollection*) data->child_result);
#line 1064 "rygel-media-container.c"
					_g_object_unref0 (data->container);
					_g_object_unref0 (data->child_result);
				}
#line 259 "rygel-media-container.vala"
				if (data->limit > 0) {
#line 259 "rygel-media-container.vala"
					data->_tmp1_ = gee_collection_get_size ((GeeCollection*) data->_result_) >= data->limit;
#line 1072 "rygel-media-container.c"
				} else {
#line 259 "rygel-media-container.vala"
					data->_tmp1_ = FALSE;
#line 1076 "rygel-media-container.c"
				}
#line 259 "rygel-media-container.vala"
				if (data->_tmp1_) {
#line 1080 "rygel-media-container.c"
					_g_object_unref0 (data->child);
#line 260 "rygel-media-container.vala"
					break;
#line 1084 "rygel-media-container.c"
				}
				_g_object_unref0 (data->child);
			}
			_g_object_unref0 (data->_child_it);
		}
		data->result = (GeeList*) data->_result_;
		{
			if (data->_state_ == 0) {
				g_simple_async_result_complete_in_idle (data->_async_result);
			} else {
				g_simple_async_result_complete (data->_async_result);
			}
			g_object_unref (data->_async_result);
			return FALSE;
		}
		_g_object_unref0 (data->_result_);
	}
	{
		if (data->_state_ == 0) {
			g_simple_async_result_complete_in_idle (data->_async_result);
		} else {
			g_simple_async_result_complete (data->_async_result);
		}
		g_object_unref (data->_async_result);
		return FALSE;
	}
}