mirror of https://github.com/GNOME/gimp.git
app/brushes.c: pathc from Andy Thomas to improve brsh loading via pdb
app/drawable.c: patch from gimp-hpux i missed yesterday... -adrian
This commit is contained in:
parent
741884c24e
commit
ba4557617b
|
@ -1,3 +1,9 @@
|
|||
Thu Mar 19 14:13:33 EST 1998 Adrian Likins <adrian@gimp.org>
|
||||
|
||||
* applied patch from Andy Thomas to brushes.c to
|
||||
improve brush loading via pdb. Fixes problems with
|
||||
bruses of the same name.
|
||||
|
||||
Thu Mar 19 13:21:28 MET 1998 Sven Neumann <sven@gimp.org>
|
||||
|
||||
* docs/gimp_quick_reference.[tex|ps]: added a
|
||||
|
|
|
@ -65,6 +65,8 @@ void
|
|||
brushes_init ()
|
||||
{
|
||||
GSList * list;
|
||||
GBrushP gb_start = NULL;
|
||||
gint gb_count = 0;
|
||||
|
||||
if (brush_list)
|
||||
brushes_free();
|
||||
|
@ -83,9 +85,39 @@ brushes_init ()
|
|||
|
||||
while (list) {
|
||||
/* Set the brush index */
|
||||
((GBrush *) list->data)->index = num_brushes++;
|
||||
list = g_slist_next (list);
|
||||
}
|
||||
/* ALT make names unique */
|
||||
GBrushP gb = (GBrushP)list->data;
|
||||
gb->index = num_brushes++;
|
||||
list = g_slist_next(list);
|
||||
if(list) {
|
||||
GBrushP gb2 = (GBrushP)list->data;
|
||||
|
||||
if(gb_start == NULL) {
|
||||
gb_start = gb;
|
||||
}
|
||||
|
||||
if(gb_start->name
|
||||
&& gb2->name
|
||||
&& (strcmp(gb_start->name,gb2->name) == 0)) {
|
||||
|
||||
gint b_digits = 2;
|
||||
gint gb_tmp_cnt = gb_count++;
|
||||
|
||||
/* Alter gb2... */
|
||||
g_free(gb2->name);
|
||||
while((gb_tmp_cnt /= 10) > 0)
|
||||
b_digits++;
|
||||
/* name str + " #" + digits + null */
|
||||
gb2->name = g_malloc(strlen(gb_start->name)+3+b_digits);
|
||||
sprintf(gb2->name,"%s #%d",gb_start->name,gb_count);
|
||||
}
|
||||
else
|
||||
{
|
||||
gb_start = gb2;
|
||||
gb_count = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -88,7 +88,7 @@ gimp_drawable_class_init (GimpDrawableClass *class)
|
|||
gtk_signal_default_marshaller,
|
||||
GTK_TYPE_NONE, 0);
|
||||
|
||||
gtk_object_class_add_signals (object_class, drawable_signals, LAST_SIGNAL);
|
||||
gtk_object_class_add_signals (object_class, (guint *)drawable_signals, LAST_SIGNAL);
|
||||
|
||||
object_class->destroy = gimp_drawable_destroy;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue