GNOME Bugzilla – Bug 45337
MIME code hits disk every few seconds, bad for laptops & such
Last modified: 2004-12-22 21:47:04 UTC
My fix for bug 44798 introduced a new issue. In order to tell interested observers when MIME data has changed, we periodically call a function that hits the disk (reload_if_needed). Periodically hitting the disk is bad, since it can use up precious laptop battery life and perhaps prevent sleep also. I can change this mechanism to use gconf for part of the notification, so that the disk isn't involved. Note to self: the way to do this is to set up a gconf client in gnome-vfs-mime-monitor that looks at a new key that's something like "data_changed_time_stamp". Then set the value of this gconf key whenever a change occurs (e.g. _set_icon). So one vfs process will set the key, and all vfs processes will notice the change, and then emit their signals. ------- Additional Comments From sullivan@eazel.com 2001-01-02 17:40:37 ---- Note to self: this means that changes to the data files that don't go through the calls like _set_icon won't be broadcast to listeners. For instance, if a new file appears in the directory. Is this worth worrying about? We could also emit the data_changed signal whenever we notice that the disk file has changed, without polling for it, but that would cause two data_changed signals every time a client calls something like _set_icon (one immediately, one later on when some other call triggers a reload). Need to consider this further. ------- Additional Comments From sullivan@eazel.com 2001-01-02 17:49:16 ---- After further consideration, only sending the signal when _set_icon or the like is called directly seems fine. In Nautilus, refreshing a window will ensure that the mime database is up to date, so in the worst case if a new data file sneaks in behind the APIs back somehow its contents will still be used when any new Nautilus window is opened or existing one refreshed. ------- Additional Comments From sullivan@eazel.com 2001-01-05 12:00:00 ---- Tragically, the gconf approach didn't work (see bug 45460). I fixed this instead by just removing the polling code, which leaves behind fairly minor bug 45459. ------- Bug moved to this database by unknown@bugzilla.gnome.org 2001-09-09 20:48 -------