mirror of https://github.com/GNOME/gimp.git
only create the temporary file if there is a parasite to load.
2005-06-06 Sven Neumann <sven@gimp.org> * plug-ins/gfig/gfig.c (gfig_load_from_parasite): only create the temporary file if there is a parasite to load.
This commit is contained in:
parent
365f79262b
commit
b29fc29b2e
|
@ -1,3 +1,8 @@
|
|||
2005-06-06 Sven Neumann <sven@gimp.org>
|
||||
|
||||
* plug-ins/gfig/gfig.c (gfig_load_from_parasite): only create the
|
||||
temporary file if there is a parasite to load.
|
||||
|
||||
2005-06-06 Sven Neumann <sven@gimp.org>
|
||||
|
||||
* app/widgets/gimpcellrendererdashes.c: removed unused variable.
|
||||
|
|
|
@ -741,7 +741,12 @@ gfig_load_from_parasite (void)
|
|||
GimpParasite *parasite;
|
||||
GFigObj *gfig;
|
||||
|
||||
parasite = gimp_drawable_parasite_find (gfig_context->drawable_id, "gfig");
|
||||
if (! parasite)
|
||||
return NULL;
|
||||
|
||||
fname = gimp_temp_name ("gfigtmp");
|
||||
|
||||
fp = g_fopen (fname, "w");
|
||||
if (!fp)
|
||||
{
|
||||
|
@ -751,23 +756,21 @@ gfig_load_from_parasite (void)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
parasite = gimp_drawable_parasite_find (gfig_context->drawable_id, "gfig");
|
||||
|
||||
if (!parasite)
|
||||
return NULL;
|
||||
|
||||
fwrite (gimp_parasite_data (parasite),
|
||||
sizeof (guchar),
|
||||
gimp_parasite_data_size (parasite),
|
||||
fp);
|
||||
|
||||
gimp_parasite_free (parasite);
|
||||
fclose (fp);
|
||||
|
||||
gimp_parasite_free (parasite);
|
||||
|
||||
gfig = gfig_load (fname, "(none)");
|
||||
|
||||
g_unlink (fname);
|
||||
|
||||
return (gfig);
|
||||
g_free (fname);
|
||||
|
||||
return gfig;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
Loading…
Reference in New Issue