[gimp/metadata-browser] Bug 664591 - Spyrogimp script crashes GIMP
- From: Roman Joost <romanofski src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/metadata-browser] Bug 664591 - Spyrogimp script crashes GIMP
- Date: Wed, 12 Sep 2012 22:15:51 +0000 (UTC)
commit 1cd8d36a712b1aa852806f3e66f8e319445612a6
Author: Michael Natterer <mitch gimp org>
Date: Wed Nov 23 20:55:55 2011 +0100
Bug 664591 - Spyrogimp script crashes GIMP
Don't let resetting the tool options reset away their name to NULL.
Found by massimo.
app/core/gimptooloptions.c | 48 ++++++++++++++++++++++++++++++++-----------
1 files changed, 35 insertions(+), 13 deletions(-)
---
diff --git a/app/core/gimptooloptions.c b/app/core/gimptooloptions.c
index aa3042e..b8981d7 100644
--- a/app/core/gimptooloptions.c
+++ b/app/core/gimptooloptions.c
@@ -50,23 +50,29 @@ enum
};
-static void gimp_tool_options_dispose (GObject *object);
-static void gimp_tool_options_set_property (GObject *object,
- guint property_id,
- const GValue *value,
- GParamSpec *pspec);
-static void gimp_tool_options_get_property (GObject *object,
- guint property_id,
- GValue *value,
- GParamSpec *pspec);
+static void gimp_tool_options_config_iface_init (GimpConfigInterface *iface);
-static void gimp_tool_options_real_reset (GimpToolOptions *tool_options);
+static void gimp_tool_options_dispose (GObject *object);
+static void gimp_tool_options_set_property (GObject *object,
+ guint property_id,
+ const GValue *value,
+ GParamSpec *pspec);
+static void gimp_tool_options_get_property (GObject *object,
+ guint property_id,
+ GValue *value,
+ GParamSpec *pspec);
-static void gimp_tool_options_tool_notify (GimpToolOptions *options,
- GParamSpec *pspec);
+static void gimp_tool_options_real_reset (GimpToolOptions *tool_options);
+static void gimp_tool_options_config_reset (GimpConfig *config);
-G_DEFINE_TYPE (GimpToolOptions, gimp_tool_options, GIMP_TYPE_CONTEXT)
+static void gimp_tool_options_tool_notify (GimpToolOptions *options,
+ GParamSpec *pspec);
+
+
+G_DEFINE_TYPE_WITH_CODE (GimpToolOptions, gimp_tool_options, GIMP_TYPE_CONTEXT,
+ G_IMPLEMENT_INTERFACE (GIMP_TYPE_CONFIG,
+ gimp_tool_options_config_iface_init))
#define parent_class gimp_tool_options_parent_class
@@ -103,6 +109,12 @@ gimp_tool_options_init (GimpToolOptions *options)
}
static void
+gimp_tool_options_config_iface_init (GimpConfigInterface *iface)
+{
+ iface->reset = gimp_tool_options_config_reset;
+}
+
+static void
gimp_tool_options_dispose (GObject *object)
{
GimpToolOptions *options = GIMP_TOOL_OPTIONS (object);
@@ -234,6 +246,16 @@ gimp_tool_options_real_reset (GimpToolOptions *tool_options)
}
static void
+gimp_tool_options_config_reset (GimpConfig *config)
+{
+ gchar *name = g_strdup (gimp_object_get_name (config));
+
+ gimp_config_reset_properties (G_OBJECT (config));
+
+ gimp_object_take_name (GIMP_OBJECT (config), name);
+}
+
+static void
gimp_tool_options_tool_notify (GimpToolOptions *options,
GParamSpec *pspec)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]