Currently, both ThunarFolder and ThunarListModel have to connect a signal to each and every file, and disconnect it later on. This can slow down things quite a lot (makes up ~20% for the infos_ready to complete on a medium sized folder). Instead, we could just a ThunarFileMonitor class, with changed(monitor,file) and destroyed(monitor,file) signals. thunar_file_destroy() (maybe dispose, check GObject source if dispose will also be run on last unref!) and thunar_file_real_changed() would then check if a monitor instance is present, and if so, forward the signal.
Committed with revision 19848. 2006-02-12 Benedikt Meurer <benny@xfce.org> * thunar/thunar-file-monitor.{c,h}, thunar/Makefile.am: Add new class ThunarFileMonitor, which allows other objects stay informed about changes to ThunarFile's without having to connect signal handlers to every ThunarFile. Bug #1447. * thunar/thunar-file.c: Emit ThunarFileMonitor signals as appropriate. Bug #1447. * thunar/thunar-folder.c, thunar/thunar-list-model.c: Use the newly added ThunarFileMonitor to monitor files for changes and deletion without having to connect and disconnect signal handlers to each and every file. Bug #1447.