[gnome-photos] base-item, pipeline: Pass the URI during construction
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-photos] base-item, pipeline: Pass the URI during construction
- Date: Mon, 28 Dec 2015 09:57:38 +0000 (UTC)
commit 060f113bf7fa8a1014fc3390bfaa3b5da0fa1b72
Author: Debarshi Ray <debarshir gnome org>
Date: Fri Dec 18 20:13:28 2015 +0100
base-item, pipeline: Pass the URI during construction
src/photos-base-item.c | 15 +++++++++++++++
src/photos-pipeline.c | 17 +++++++++++++++++
src/photos-pipeline.h | 1 +
3 files changed, 33 insertions(+), 0 deletions(-)
---
diff --git a/src/photos-base-item.c b/src/photos-base-item.c
index 97c16cd..7f62b17 100644
--- a/src/photos-base-item.c
+++ b/src/photos-base-item.c
@@ -1795,12 +1795,27 @@ photos_base_item_load_async (PhotosBaseItem *self,
}
else
{
+ PhotosBaseItemClass *class;
+ gchar *uri = NULL;
+
+ class = PHOTOS_BASE_ITEM_GET_CLASS (self);
+ if (class->create_pipeline_path != NULL)
+ {
+ gchar *path;
+
+ path = class->create_pipeline_path (self);
+ uri = photos_utils_convert_path_to_uri (path);
+ g_free (path);
+ }
+
priv->edit_graph = gegl_node_new ();
priv->buffer_source = gegl_node_new_child (priv->edit_graph, "operation", "gegl:buffer-source", NULL);
photos_pipeline_new_async (priv->edit_graph,
+ uri,
cancellable,
photos_base_item_load_pipeline,
g_object_ref (task));
+ g_free (uri);
}
g_object_unref (task);
diff --git a/src/photos-pipeline.c b/src/photos-pipeline.c
index 8131f29..10ebf1a 100644
--- a/src/photos-pipeline.c
+++ b/src/photos-pipeline.c
@@ -35,6 +35,7 @@ struct _PhotosPipeline
GHashTable *hash;
GQueue *history;
GeglNode *graph;
+ gchar *uri;
};
struct _PhotosPipelineClass
@@ -46,6 +47,7 @@ enum
{
PROP_0,
PROP_PARENT,
+ PROP_URI
};
static void photos_pipeline_async_initable_iface_init (GAsyncInitableIface *iface);
@@ -121,6 +123,7 @@ photos_pipeline_finalize (GObject *object)
PhotosPipeline *self = PHOTOS_PIPELINE (object);
g_queue_free (self->history);
+ g_free (self->uri);
G_OBJECT_CLASS (photos_pipeline_parent_class)->finalize (object);
}
@@ -137,6 +140,10 @@ photos_pipeline_set_property (GObject *object, guint prop_id, const GValue *valu
self->parent = GEGL_NODE (g_value_dup_object (value));
break;
+ case PROP_URI:
+ self->uri = g_value_dup_string (value);
+ break;
+
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@@ -169,6 +176,14 @@ photos_pipeline_class_init (PhotosPipelineClass *class)
"A GeglNode representing the parent graph",
GEGL_TYPE_NODE,
G_PARAM_CONSTRUCT_ONLY | G_PARAM_WRITABLE));
+
+ g_object_class_install_property (object_class,
+ PROP_URI,
+ g_param_spec_string ("uri",
+ "An URI",
+ "The location to save this pipeline",
+ NULL,
+ G_PARAM_CONSTRUCT_ONLY | G_PARAM_WRITABLE));
}
@@ -214,6 +229,7 @@ photos_pipeline_async_initable_iface_init (GAsyncInitableIface *iface)
void
photos_pipeline_new_async (GeglNode *parent,
+ const gchar *uri,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data)
@@ -224,6 +240,7 @@ photos_pipeline_new_async (GeglNode *parent,
callback,
user_data,
"parent", parent,
+ "uri", uri,
NULL);
}
diff --git a/src/photos-pipeline.h b/src/photos-pipeline.h
index b6e1d34..3e5142a 100644
--- a/src/photos-pipeline.h
+++ b/src/photos-pipeline.h
@@ -56,6 +56,7 @@ typedef struct _PhotosPipelineClass PhotosPipelineClass;
GType photos_pipeline_get_type (void) G_GNUC_CONST;
void photos_pipeline_new_async (GeglNode *parent,
+ const gchar *uri,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]