[gimp] app: take the default value of GimpPDBContext::interpolation from gimprc



commit 46e4fa93b2d5408176205587c42f83dd6c770556
Author: Michael Natterer <mitch gimp org>
Date:   Thu Sep 16 20:16:12 2010 +0200

    app: take the default value of GimpPDBContext::interpolation from gimprc

 app/pdb/gimppdbcontext.c |   24 ++++++++++++++++++++++++
 1 files changed, 24 insertions(+), 0 deletions(-)
---
diff --git a/app/pdb/gimppdbcontext.c b/app/pdb/gimppdbcontext.c
index 5e27376..9119162 100644
--- a/app/pdb/gimppdbcontext.c
+++ b/app/pdb/gimppdbcontext.c
@@ -25,6 +25,8 @@
 
 #include "pdb-types.h"
 
+#include "config/gimpcoreconfig.h"
+
 #include "core/gimp.h"
 
 #include "gimppdbcontext.h"
@@ -46,6 +48,7 @@ enum
 };
 
 
+static void   gimp_pdb_context_constructed  (GObject      *object);
 static void   gimp_pdb_context_set_property (GObject      *object,
                                              guint         property_id,
                                              const GValue *value,
@@ -66,6 +69,7 @@ gimp_pdb_context_class_init (GimpPDBContextClass *klass)
 {
   GObjectClass *object_class = G_OBJECT_CLASS (klass);
 
+  object_class->constructed  = gimp_pdb_context_constructed;
   object_class->set_property = gimp_pdb_context_set_property;
   object_class->get_property = gimp_pdb_context_get_property;
 
@@ -120,6 +124,26 @@ gimp_pdb_context_init (GimpPDBContext *options)
 }
 
 static void
+gimp_pdb_context_constructed (GObject *object)
+{
+  GimpInterpolationType  interpolation;
+  GParamSpec            *pspec;
+
+  interpolation = GIMP_CONTEXT (object)->gimp->config->interpolation_type;
+
+  pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (object),
+                                        "interpolation");
+
+  if (pspec)
+    G_PARAM_SPEC_ENUM (pspec)->default_value = interpolation;
+
+  g_object_set (object, "interpolation", interpolation, NULL);
+
+  if (G_OBJECT_CLASS (parent_class)->constructed)
+    G_OBJECT_CLASS (parent_class)->constructed (object);
+}
+
+static void
 gimp_pdb_context_set_property (GObject      *object,
                                guint         property_id,
                                const GValue *value,



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