Exemplo n.º 1
0
RygelMediaContainer* rygel_media_container_construct_root (GType object_type, const char* title, gint child_count) {
#line 332 "rygel-media-container.c"
	RygelMediaContainer * self;
#line 57 "rygel-media-container.vala"
	g_return_val_if_fail (title != NULL, NULL);
#line 59 "rygel-media-container.vala"
	self = (RygelMediaContainer*) rygel_media_container_construct (object_type, "0", NULL, title, child_count);
#line 338 "rygel-media-container.c"
	return self;
}
Exemplo n.º 2
0
RygelFolderContainer* rygel_folder_container_construct (GType object_type, RygelMediaContainer* parent, GFile* file) {
#line 362 "rygel-folder-container.c"
	RygelFolderContainer * self;
	char* _tmp0_;
	char* _tmp1_;
	char* id;
	char* _tmp2_;
	GFile* _tmp4_;
	GFile* _tmp3_;
	GeeArrayList* _tmp5_;
	GeeList* _tmp6_;
#line 156 "rygel-folder-container.vala"
	g_return_val_if_fail (parent != NULL, NULL);
#line 156 "rygel-folder-container.vala"
	g_return_val_if_fail (file != NULL, NULL);
#line 720 "gio-2.0.vapi"
	_tmp0_ = NULL;
#line 157 "rygel-folder-container.vala"
	_tmp1_ = NULL;
#line 380 "rygel-folder-container.c"
	id = (_tmp1_ = g_compute_checksum_for_string (G_CHECKSUM_MD5, _tmp0_ = g_file_get_uri (file), -1), _tmp0_ = (g_free (_tmp0_), NULL), _tmp1_);
#line 713 "gio-2.0.vapi"
	_tmp2_ = NULL;
#line 160 "rygel-folder-container.vala"
	self = (RygelFolderContainer*) rygel_media_container_construct (object_type, id, parent, _tmp2_ = g_file_get_basename (file), (guint) 0);
#line 386 "rygel-folder-container.c"
	_tmp2_ = (g_free (_tmp2_), NULL);
	_tmp4_ = NULL;
#line 161 "rygel-folder-container.vala"
	_tmp3_ = NULL;
#line 161 "rygel-folder-container.vala"
	self->priv->root_dir = (_tmp4_ = (_tmp3_ = file, (_tmp3_ == NULL) ? NULL : g_object_ref (_tmp3_)), (self->priv->root_dir == NULL) ? NULL : (self->priv->root_dir = (g_object_unref (self->priv->root_dir), NULL)), _tmp4_);
#line 393 "rygel-folder-container.c"
	_tmp5_ = NULL;
#line 163 "rygel-folder-container.vala"
	self->priv->items = (_tmp5_ = gee_array_list_new (RYGEL_TYPE_MEDIA_OBJECT, (GBoxedCopyFunc) g_object_ref, g_object_unref, g_direct_equal), (self->priv->items == NULL) ? NULL : (self->priv->items = (g_object_unref (self->priv->items), NULL)), _tmp5_);
#line 164 "rygel-folder-container.vala"
	((RygelMediaContainer*) self)->child_count = (guint) 0;
#line 399 "rygel-folder-container.c"
	_tmp6_ = NULL;
#line 165 "rygel-folder-container.vala"
	self->priv->results = (_tmp6_ = (GeeList*) gee_array_list_new (G_TYPE_ASYNC_RESULT, (GBoxedCopyFunc) g_object_ref, g_object_unref, g_direct_equal), (self->priv->results == NULL) ? NULL : (self->priv->results = (g_object_unref (self->priv->results), NULL)), _tmp6_);
#line 403 "rygel-folder-container.c"
	id = (g_free (id), NULL);
	return self;
}
Exemplo n.º 3
0
RygelExternalContainer* rygel_external_container_construct (GType object_type, const char* id, const char* service_name, const char* object_path, const char* host_ip, RygelExternalContainer* parent) {
#line 236 "rygel-external-container.c"
	GError * _inner_error_;
	RygelExternalContainer * self;
	char* _tmp0_;
	char* _tmp1_;
	char* _tmp2_;
	GeeArrayList* _tmp3_;
#line 42 "rygel-external-container.vala"
	g_return_val_if_fail (id != NULL, NULL);
#line 42 "rygel-external-container.vala"
	g_return_val_if_fail (service_name != NULL, NULL);
#line 42 "rygel-external-container.vala"
	g_return_val_if_fail (object_path != NULL, NULL);
#line 42 "rygel-external-container.vala"
	g_return_val_if_fail (host_ip != NULL, NULL);
#line 251 "rygel-external-container.c"
	_inner_error_ = NULL;
#line 47 "rygel-external-container.vala"
	self = (RygelExternalContainer*) rygel_media_container_construct (object_type, id, (RygelMediaContainer*) parent, "Uknown", 0);
#line 49 "rygel-external-container.vala"
	self->service_name = (_tmp0_ = g_strdup (service_name), _g_free0 (self->service_name), _tmp0_);
#line 50 "rygel-external-container.vala"
	self->priv->object_path = (_tmp1_ = g_strdup (object_path), _g_free0 (self->priv->object_path), _tmp1_);
#line 51 "rygel-external-container.vala"
	self->host_ip = (_tmp2_ = g_strdup (host_ip), _g_free0 (self->host_ip), _tmp2_);
#line 53 "rygel-external-container.vala"
	self->priv->containers = (_tmp3_ = gee_array_list_new (RYGEL_TYPE_EXTERNAL_CONTAINER, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL), _g_object_unref0 (self->priv->containers), _tmp3_);
#line 263 "rygel-external-container.c"
	{
		DBusGConnection* connection;
		RygelExternalMediaContainer* _tmp4_;
		char* _tmp5_;
#line 56 "rygel-external-container.vala"
		connection = dbus_g_bus_get (DBUS_BUS_SESSION, &_inner_error_);
#line 270 "rygel-external-container.c"
		if (_inner_error_ != NULL) {
			goto __catch0_g_error;
		}
#line 59 "rygel-external-container.vala"
		self->actual_container = (_tmp4_ = rygel_external_media_container_dbus_proxy_new (connection, service_name, object_path), _g_object_unref0 (self->actual_container), _tmp4_);
#line 63 "rygel-external-container.vala"
		rygel_media_object_set_title ((RygelMediaObject*) self, _tmp5_ = rygel_external_media_object_get_display_name ((RygelExternalMediaObject*) self->actual_container));
#line 278 "rygel-external-container.c"
		_g_free0 (_tmp5_);
#line 65 "rygel-external-container.vala"
		rygel_external_container_update_container (self, &_inner_error_);
#line 282 "rygel-external-container.c"
		if (_inner_error_ != NULL) {
			_dbus_g_connection_unref0 (connection);
			goto __catch0_g_error;
		}
#line 67 "rygel-external-container.vala"
		g_signal_connect_object (self->actual_container, "updated", (GCallback) _rygel_external_container_on_updated_rygel_external_media_container_updated, self, 0);
#line 289 "rygel-external-container.c"
		_dbus_g_connection_unref0 (connection);
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError * err;
		err = _inner_error_;
		_inner_error_ = NULL;
		{
#line 69 "rygel-external-container.vala"
			g_critical ("rygel-external-container.vala:69: Failed to fetch information about co" \
"ntainer '%s': %s\n", ((RygelMediaObject*) self)->id, err->message);
#line 301 "rygel-external-container.c"
			_g_error_free0 (err);
		}
	}
	__finally0:
	if (_inner_error_ != NULL) {
		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 NULL;
	}
	return self;
}