[gimp/gimp-2-8] Bug 700215 - Gradient name changes do not persist across sessions...



commit dd8aeeec92a64390a8ece059c62368821a172bfe
Author: Michael Natterer <mitch gimp org>
Date:   Wed May 29 22:23:38 2013 +0200

    Bug 700215 - Gradient name changes do not persist across sessions...
    
    if the gradient itself isn't changed.
    
    GimpData: implement GimpObject::name_changed() and set the "dirty"
    flag to TRUE. Don't set dirty in GimpData::dirty()'s default impl
    because that calls gimp_object_name_changed() anyway.
    (cherry picked from commit 5280a02ed836c496b9ece026776e5e9866a75f0e)

 app/core/gimpdata.c |   21 ++++++++++++++++-----
 1 files changed, 16 insertions(+), 5 deletions(-)
---
diff --git a/app/core/gimpdata.c b/app/core/gimpdata.c
index e1461d4..47d1308 100644
--- a/app/core/gimpdata.c
+++ b/app/core/gimpdata.c
@@ -105,6 +105,7 @@ static void      gimp_data_get_property      (GObject             *object,
                                               GValue              *value,
                                               GParamSpec          *pspec);
 
+static void      gimp_data_name_changed      (GimpObject          *object);
 static gint64    gimp_data_get_memsize       (GimpObject          *object,
                                               gint64              *gui_size);
 
@@ -183,6 +184,7 @@ gimp_data_class_init (GimpDataClass *klass)
   object_class->set_property      = gimp_data_set_property;
   object_class->get_property      = gimp_data_get_property;
 
+  gimp_object_class->name_changed = gimp_data_name_changed;
   gimp_object_class->get_memsize  = gimp_data_get_memsize;
 
   klass->dirty                    = gimp_data_real_dirty;
@@ -350,6 +352,17 @@ gimp_data_get_property (GObject    *object,
     }
 }
 
+static void
+gimp_data_name_changed (GimpObject *object)
+{
+  GimpDataPrivate *private = GIMP_DATA_GET_PRIVATE (object);
+
+  private->dirty = TRUE;
+
+  if (GIMP_OBJECT_CLASS (parent_class)->name_changed)
+    GIMP_OBJECT_CLASS (parent_class)->name_changed (object);
+}
+
 static gint64
 gimp_data_get_memsize (GimpObject *object,
                        gint64     *gui_size)
@@ -366,13 +379,11 @@ gimp_data_get_memsize (GimpObject *object,
 static void
 gimp_data_real_dirty (GimpData *data)
 {
-  GimpDataPrivate *private = GIMP_DATA_GET_PRIVATE (data);
-
-  private->dirty = TRUE;
-
   gimp_viewable_invalidate_preview (GIMP_VIEWABLE (data));
 
-  /* Emit the "name-changed" to signal general dirtiness */
+  /* Emit the "name-changed" to signal general dirtiness, our name
+   * changed implementation will also set the "dirty" flag to TRUE.
+   */
   gimp_object_name_changed (GIMP_OBJECT (data));
 }
 


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