3333#define DEBUG
3434 */
3535
36- G_DEFINE_TYPE (Classmodel , classmodel , HEAPMODEL_TYPE )
36+ G_DEFINE_TYPE (Classmodel , classmodel , HEAPMODEL_TYPE );
37+
38+ /* All the classmodel that have been updated ... recomp needs to mark these
39+ * dirty before pickng the next row.
40+ */
41+ static GSList * classmodel_updated = NULL ;
3742
3843void
3944image_value_init (ImageValue * image , Classmodel * classmodel )
@@ -602,6 +607,8 @@ classmodel_dispose(GObject *gobject)
602607 (SListMapFn ) classmodel_iimage_unlink_rev , classmodel );
603608 VIPS_FREE (classmodel -> filename );
604609
610+ classmodel_updated = g_slist_remove (classmodel_updated , classmodel );
611+
605612 G_OBJECT_CLASS (classmodel_parent_class )-> dispose (gobject );
606613}
607614
@@ -1217,11 +1224,6 @@ classmodel_set_edited(Classmodel *classmodel, gboolean edited)
12171224
12181225 classmodel -> edited = edited ;
12191226 iobject_changed (IOBJECT (classmodel ));
1220-
1221- if (HEAPMODEL (classmodel )-> row &&
1222- HEAPMODEL (classmodel )-> row -> expr )
1223- expr_dirty (HEAPMODEL (classmodel )-> row -> expr ,
1224- link_serial_new ());
12251227 }
12261228
12271229 /* Mark eds for application.
@@ -1252,7 +1254,8 @@ classmodel_update(Classmodel *classmodel)
12521254 * modified, we might be in parse.
12531255 */
12541256 classmodel_set_edited (classmodel , TRUE);
1255- expr_dirty (row -> expr , link_serial_new ());
1257+
1258+ classmodel_updated = g_slist_prepend (classmodel_updated , classmodel );
12561259}
12571260
12581261/* Model has been changed by a view. Mark for recomp, and since this was a
@@ -1267,6 +1270,28 @@ classmodel_update_view(Classmodel *classmodel)
12671270 if (row &&
12681271 row -> expr )
12691272 workspace_set_modified (row -> ws , TRUE);
1273+
1274+ symbol_recalculate_all ();
1275+ }
1276+
1277+ static void *
1278+ classmodel_dirty_updated_sub (void * a , void * b )
1279+ {
1280+ Classmodel * classmodel = CLASSMODEL (a );
1281+ Row * row = HEAPMODEL (classmodel )-> row ;
1282+
1283+ if (row &&
1284+ row -> expr )
1285+ expr_dirty (row -> expr , link_serial_new ());
1286+
1287+ return NULL ;
1288+ }
1289+
1290+ void
1291+ classmodel_dirty_updated (void )
1292+ {
1293+ slist_map (classmodel_updated , classmodel_dirty_updated_sub , NULL );
1294+ VIPS_FREEF (g_slist_free , classmodel_updated );
12701295}
12711296
12721297/* Make a new classmodel subtype (eg. TYPE_PATHNAME) and link it on.
0 commit comments