Commit eb5bdebe authored by Michael Natterer's avatar Michael Natterer 😴

app: don't emit useless "name-changed" signals from GimpObject

if the same name is set via gimp_object_set_static_name() or
gimp_object_take_name() (gimp_object_set_name() and
gimp_object_set_name_safe() already had the check).

Since this is a slight behavior change it might have subtle side
effects; it definitely fixes GimpThumbBox thumbnail state to not
always re-create the thumbnail on click, which was happening since
porting to GFile (which switched from gimp_object_set_name() to
gimp_object_take_name()).
parent 7010883b
......@@ -289,6 +289,9 @@ gimp_object_set_static_name (GimpObject *object,
{
g_return_if_fail (GIMP_IS_OBJECT (object));
if (! g_strcmp0 (object->p->name, name))
return;
gimp_object_name_free (object);
object->p->name = (gchar *) name;
......@@ -304,6 +307,12 @@ gimp_object_take_name (GimpObject *object,
{
g_return_if_fail (GIMP_IS_OBJECT (object));
if (! g_strcmp0 (object->p->name, name))
{
g_free (name);
return;
}
gimp_object_name_free (object);
object->p->name = name;
......
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