[gimp/metadata-browser] xcf: use only one bit to save expanded state



commit 7b039d72e83fbd5e7e837fc9408c86fe8a222f6e
Author: Massimo Valentini <mvalentini src gnome org>
Date:   Fri Oct 7 20:05:52 2011 +0200

    xcf: use only one bit to save expanded state

 app/xcf/xcf-load.c    |    4 +++-
 app/xcf/xcf-private.h |    5 +++++
 app/xcf/xcf-save.c    |    5 ++++-
 3 files changed, 12 insertions(+), 2 deletions(-)
---
diff --git a/app/xcf/xcf-load.c b/app/xcf/xcf-load.c
index 0a32880..2fa05e8 100644
--- a/app/xcf/xcf-load.c
+++ b/app/xcf/xcf-load.c
@@ -1137,7 +1137,9 @@ xcf_load_layer (XcfInfo    *info,
     }
   else
     {
-      gimp_viewable_set_expanded (GIMP_VIEWABLE (layer), group_layer_flags != 0);
+      gboolean expanded = group_layer_flags & XCF_GROUP_ITEM_EXPANDED;
+
+      gimp_viewable_set_expanded (GIMP_VIEWABLE (layer), expanded);
     }
 
   /* read in the layer mask */
diff --git a/app/xcf/xcf-private.h b/app/xcf/xcf-private.h
index 1873e20..33076d4 100644
--- a/app/xcf/xcf-private.h
+++ b/app/xcf/xcf-private.h
@@ -75,6 +75,11 @@ typedef enum
   XCF_STROKETYPE_BEZIER_STROKE = 1
 } XcfStrokeType;
 
+typedef enum
+{
+  XCF_GROUP_ITEM_EXPANDED      = 1
+} XcfGroupItemFlagsType;
+
 typedef struct _XcfInfo  XcfInfo;
 
 struct _XcfInfo
diff --git a/app/xcf/xcf-save.c b/app/xcf/xcf-save.c
index f02b357..44e4785 100644
--- a/app/xcf/xcf-save.c
+++ b/app/xcf/xcf-save.c
@@ -539,7 +539,10 @@ xcf_save_layer_props (XcfInfo    *info,
 
   if (gimp_viewable_get_children (GIMP_VIEWABLE (layer)))
     {
-      gint32 flags = gimp_viewable_get_expanded (GIMP_VIEWABLE (layer));
+      gint32 flags = 0;
+
+      if (gimp_viewable_get_expanded (GIMP_VIEWABLE (layer)))
+        flags |= XCF_GROUP_ITEM_EXPANDED;
 
       xcf_check_error (xcf_save_prop (info,
                                       image, PROP_GROUP_ITEM_FLAGS, error,



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