コード例 #1
0
ファイル: matcher.c プロジェクト: poelzi/gtkmateview
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);
	}
}
コード例 #2
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);
}
コード例 #3
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");
}
コード例 #4
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;
}
コード例 #5
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;
	}
}