Commit c297913a authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann
Browse files

fixed serialization of empty string properties that I broke yesterday.

2002-12-02  Sven Neumann  <sven@gimp.org>

	* app/config/gimpconfig-serialize.c: fixed serialization of empty
	string properties that I broke yesterday.
parent 4ccd0f0a
2002-12-02 Sven Neumann <sven@gimp.org>
* app/config/gimpconfig-serialize.c: fixed serialization of empty
string properties that I broke yesterday.
2002-12-02 Michael Natterer <mitch@gimp.org>
 
* app/core/gimpdata.[ch]: use GError for reporting load/save
......
......@@ -10,6 +10,7 @@ dubbed GIMP 1.4.
Overview of Changes in GIMP 1.3.11
==================================
- Updated the Win32 build system [Hans Breuer]
- Factored common code out of a number of plug-ins [Maurits]
- Use g_rand* functions whereever random numbers are needed [Bolsh]
......@@ -29,6 +30,7 @@ Other contributors:
Overview of Changes in GIMP 1.3.10
==================================
- Text tool can load text files now [Sven]
- Some unfinished work on the imagemap tools and related widgets [Sven]
- Undeprecated ink tool [Bolsh, Sven]
......@@ -51,6 +53,7 @@ Other contributors:
Overview of Changes in GIMP 1.3.9
=================================
- Some minor improvements to the text tool [Sven]
- Started to cleanup DND code [Mitch]
- Added GimpViewableDialog [Mitch]
......@@ -68,6 +71,7 @@ Other contributors:
Overview of Changes in GIMP 1.3.8
=================================
- Lots of plug-ins cleaned up and improved [Maurits]
- More work on the help browser [Sven]
- Core code cleanup [Mitch, Sven]
......@@ -82,12 +86,14 @@ Other contributors:
Overview of Changes in GIMP 1.3.7
=================================
- Build fixes
- Bug fixes
Overview of Changes in GIMP 1.3.6
=================================
- Support tile cache > 4GB on machines with 64bit long integers [Sven]
- Added support for large files (> 2GB) [Sven]
- Cleaned up configure, updated to autoconf-2.52 [Sven]
......@@ -118,6 +124,7 @@ Other contributors:
Overview of Changes in GIMP 1.3.5
=================================
- Improved tool options and made them dockable [Mitch]
- Cleanup of brush, gradient, pattern and palette PDB functions [Mitch]
- Autogenerate libgimp/gimp_pdb.h [Yosh]
......@@ -140,6 +147,7 @@ Other Contributors:
Overview of Changes in GIMP 1.3.4
=================================
- Improved image status bar and image title [Mitch]
- Updated thumbnail code according to changes in proposed standard [Sven]
- Implemented init_proc in plug-ins [Nathan]
......@@ -173,6 +181,7 @@ Other Contributors:
Overview of Changes in GIMP 1.3.3
=================================
- Most of the code is free of deprecated GTK+ calls now [Mitch, Yosh, Sven]
- More use of stock icons [Sven, Mitch]
- New RGB->Indexed quantizer [Adam]
......
......@@ -137,19 +137,12 @@ dump_system_gimprc (void)
g_string_append (str, "# ");
if (gimp_config_serialize_property (rc, prop_spec, str, TRUE))
if (! gimp_config_serialize_property (rc, prop_spec, str, TRUE))
{
g_string_append (str, "\n");
write (1, str->str, str->len);
}
else if (prop_spec->value_type != G_TYPE_STRING)
{
g_warning ("couldn't serialize property %s::%s of type %s",
g_type_name (G_TYPE_FROM_INSTANCE (rc)),
prop_spec->name,
g_type_name (prop_spec->value_type));
}
}
g_free (property_specs);
......
......@@ -90,18 +90,9 @@ gimp_config_serialize_properties (GObject *object,
{
if (write (fd, str->str, str->len) == -1)
return FALSE;
g_string_assign (str, "\n");
}
else if (prop_spec->value_type != G_TYPE_STRING)
{
g_warning ("couldn't serialize property %s::%s of type %s",
g_type_name (G_TYPE_FROM_INSTANCE (object)),
prop_spec->name,
g_type_name (prop_spec->value_type));
g_string_assign (str, "");
}
g_string_assign (str, "\n");
}
g_free (property_specs);
......@@ -153,6 +144,9 @@ gimp_config_serialize_changed_properties (GObject *new,
prop_spec = (GParamSpec *) list->data;
if (! (prop_spec->flags & GIMP_PARAM_SERIALIZE))
continue;
g_value_init (&new_value, prop_spec->value_type);
g_object_get_property (new, prop_spec->name, &new_value);
......@@ -165,7 +159,7 @@ gimp_config_serialize_changed_properties (GObject *new,
gimp_config_string_indent (str, indent_level);
g_string_append_printf (str, "(%s ", prop_spec->name);
if (gimp_config_serialize_value (&new_value, str, TRUE))
{
g_string_append (str, ")\n");
......@@ -174,12 +168,14 @@ gimp_config_serialize_changed_properties (GObject *new,
if (write (fd, str->str, str->len) == -1)
return FALSE;
}
else if (prop_spec->value_type != G_TYPE_STRING)
else
{
g_warning ("couldn't serialize property %s::%s of type %s",
g_type_name (G_TYPE_FROM_INSTANCE (new)),
prop_spec->name,
g_type_name (prop_spec->value_type));
/* don't warn for empty string properties */
if (prop_spec->value_type != G_TYPE_STRING)
g_warning ("couldn't serialize property %s::%s of type %s",
g_type_name (G_TYPE_FROM_INSTANCE (new)),
prop_spec->name,
g_type_name (prop_spec->value_type));
}
g_value_unset (&new_value);
......@@ -245,12 +241,25 @@ gimp_config_serialize_property (GObject *object,
(const GValue *) &value,
param_spec,
str))
return FALSE;
{
g_value_unset (&value);
return FALSE;
}
}
else
{
if (! gimp_config_serialize_value (&value, str, escaped))
return FALSE;
{
/* don't warn for empty string properties */
if (! G_VALUE_HOLDS_STRING (&value))
g_warning ("couldn't serialize property %s::%s of type %s",
g_type_name (G_TYPE_FROM_INSTANCE (object)),
param_spec->name,
g_type_name (param_spec->value_type));
g_value_unset (&value);
return FALSE;
}
}
g_value_unset (&value);
......
......@@ -90,18 +90,9 @@ gimp_config_serialize_properties (GObject *object,
{
if (write (fd, str->str, str->len) == -1)
return FALSE;
g_string_assign (str, "\n");
}
else if (prop_spec->value_type != G_TYPE_STRING)
{
g_warning ("couldn't serialize property %s::%s of type %s",
g_type_name (G_TYPE_FROM_INSTANCE (object)),
prop_spec->name,
g_type_name (prop_spec->value_type));
g_string_assign (str, "");
}
g_string_assign (str, "\n");
}
g_free (property_specs);
......@@ -153,6 +144,9 @@ gimp_config_serialize_changed_properties (GObject *new,
prop_spec = (GParamSpec *) list->data;
if (! (prop_spec->flags & GIMP_PARAM_SERIALIZE))
continue;
g_value_init (&new_value, prop_spec->value_type);
g_object_get_property (new, prop_spec->name, &new_value);
......@@ -165,7 +159,7 @@ gimp_config_serialize_changed_properties (GObject *new,
gimp_config_string_indent (str, indent_level);
g_string_append_printf (str, "(%s ", prop_spec->name);
if (gimp_config_serialize_value (&new_value, str, TRUE))
{
g_string_append (str, ")\n");
......@@ -174,12 +168,14 @@ gimp_config_serialize_changed_properties (GObject *new,
if (write (fd, str->str, str->len) == -1)
return FALSE;
}
else if (prop_spec->value_type != G_TYPE_STRING)
else
{
g_warning ("couldn't serialize property %s::%s of type %s",
g_type_name (G_TYPE_FROM_INSTANCE (new)),
prop_spec->name,
g_type_name (prop_spec->value_type));
/* don't warn for empty string properties */
if (prop_spec->value_type != G_TYPE_STRING)
g_warning ("couldn't serialize property %s::%s of type %s",
g_type_name (G_TYPE_FROM_INSTANCE (new)),
prop_spec->name,
g_type_name (prop_spec->value_type));
}
g_value_unset (&new_value);
......@@ -245,12 +241,25 @@ gimp_config_serialize_property (GObject *object,
(const GValue *) &value,
param_spec,
str))
return FALSE;
{
g_value_unset (&value);
return FALSE;
}
}
else
{
if (! gimp_config_serialize_value (&value, str, escaped))
return FALSE;
{
/* don't warn for empty string properties */
if (! G_VALUE_HOLDS_STRING (&value))
g_warning ("couldn't serialize property %s::%s of type %s",
g_type_name (G_TYPE_FROM_INSTANCE (object)),
param_spec->name,
g_type_name (param_spec->value_type));
g_value_unset (&value);
return FALSE;
}
}
g_value_unset (&value);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment