[gnome-photos] base-item, pipeline: Remove all remaining undo code



commit a4fa35c851bf0f29b536e044a72088b92093ea6b
Author: Debarshi Ray <debarshir gnome org>
Date:   Fri Feb 19 19:41:58 2016 +0100

    base-item, pipeline: Remove all remaining undo code
    
    https://bugzilla.gnome.org/show_bug.cgi?id=761683

 src/photos-base-item.c |    7 -------
 src/photos-base-item.h |    2 --
 src/photos-pipeline.c  |   45 ---------------------------------------------
 src/photos-pipeline.h  |    2 --
 4 files changed, 0 insertions(+), 56 deletions(-)
---
diff --git a/src/photos-base-item.c b/src/photos-base-item.c
index 844a58e..2f6fd38 100644
--- a/src/photos-base-item.c
+++ b/src/photos-base-item.c
@@ -2170,13 +2170,6 @@ photos_base_item_operation_get (PhotosBaseItem *self, const gchar *operation, co
 
 
 gboolean
-photos_base_item_operation_undo (PhotosBaseItem *self)
-{
-  return photos_pipeline_undo (self->priv->pipeline);
-}
-
-
-gboolean
 photos_base_item_operation_remove (PhotosBaseItem *self, const gchar *operation)
 {
   return photos_pipeline_remove (self->priv->pipeline, operation);
diff --git a/src/photos-base-item.h b/src/photos-base-item.h
index 2b3760f..5207ce2 100644
--- a/src/photos-base-item.h
+++ b/src/photos-base-item.h
@@ -195,8 +195,6 @@ gboolean            photos_base_item_operation_get           (PhotosBaseItem *se
                                                               const gchar *first_property_name,
                                                               ...) G_GNUC_NULL_TERMINATED 
G_GNUC_WARN_UNUSED_RESULT;
 
-gboolean            photos_base_item_operation_undo          (PhotosBaseItem *self);
-
 gboolean            photos_base_item_operation_remove        (PhotosBaseItem *self, const gchar *operation);
 
 void                photos_base_item_operations_revert       (PhotosBaseItem *self);
diff --git a/src/photos-pipeline.c b/src/photos-pipeline.c
index 32642b9..c34d028 100644
--- a/src/photos-pipeline.c
+++ b/src/photos-pipeline.c
@@ -36,7 +36,6 @@ struct _PhotosPipeline
   GObject parent_instance;
   GeglNode *parent;
   GHashTable *hash;
-  GQueue *history;
   GeglNode *graph;
   gchar *uri;
 };
@@ -148,7 +147,6 @@ 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);
@@ -181,7 +179,6 @@ static void
 photos_pipeline_init (PhotosPipeline *self)
 {
   self->hash = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_object_unref);
-  self->history = g_queue_new ();
 }
 
 
@@ -435,10 +432,6 @@ photos_pipeline_add (PhotosPipeline *self, const gchar *operation, const gchar *
   xml = gegl_node_to_xml_full (self->graph, self->graph, "/");
   photos_debug (PHOTOS_DEBUG_GEGL, "Pipeline: %s", xml);
 
-  /* We want to remove the nodes from the graph too. */
-  g_queue_free_full (self->history, g_object_unref);
-  self->history = g_queue_new ();
-
   g_free (xml);
 }
 
@@ -541,44 +534,6 @@ photos_pipeline_save_finish (PhotosPipeline *self, GAsyncResult *res, GError **e
 
 
 gboolean
-photos_pipeline_undo (PhotosPipeline *self)
-{
-  GeglNode *input;
-  GeglNode *last;
-  GeglNode *last2;
-  GeglNode *output;
-  gboolean ret_val = FALSE;
-  gchar *operation = NULL;
-  gchar *xml = NULL;
-
-  input = gegl_node_get_input_proxy (self->graph, "input");
-  output = gegl_node_get_output_proxy (self->graph, "output");
-  last = gegl_node_get_producer (output, "input", NULL);
-  if (last == input)
-    goto out;
-
-  gegl_node_get (last, "operation", &operation, NULL);
-  g_hash_table_remove (self->hash, operation);
-  g_queue_push_head (self->history, last);
-
-  last2 = gegl_node_get_producer (last, "input", NULL);
-  gegl_node_disconnect (output, "input");
-  gegl_node_disconnect (last, "input");
-  gegl_node_link (last2, output);
-
-  xml = gegl_node_to_xml_full (self->graph, self->graph, "/");
-  photos_debug (PHOTOS_DEBUG_GEGL, "Pipeline: %s", xml);
-
-  ret_val = TRUE;
-
- out:
-  g_free (xml);
-  g_free (operation);
-  return ret_val;
-}
-
-
-gboolean
 photos_pipeline_remove (PhotosPipeline *self, const gchar *operation)
 {
   GeglNode *node;
diff --git a/src/photos-pipeline.h b/src/photos-pipeline.h
index 7d931b3..3def045 100644
--- a/src/photos-pipeline.h
+++ b/src/photos-pipeline.h
@@ -87,8 +87,6 @@ void                   photos_pipeline_save_async        (PhotosPipeline *self,
 
 gboolean               photos_pipeline_save_finish       (PhotosPipeline *self, GAsyncResult *res, GError 
**error);
 
-gboolean               photos_pipeline_undo              (PhotosPipeline *self);
-
 gboolean               photos_pipeline_remove            (PhotosPipeline *self, const gchar *operation);
 
 void                   photos_pipeline_revert            (PhotosPipeline *self);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]