After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 45337 - MIME code hits disk every few seconds, bad for laptops & such
MIME code hits disk every few seconds, bad for laptops & such
Status: RESOLVED FIXED
Product: gnome-vfs
Classification: Deprecated
Component: MIME and file/program mapping
cvs (head)
Other Linux
: Normal normal
: ---
Assigned To: John Sullivan
John Sullivan
Depends on:
Blocks:
 
 
Reported: 2000-12-22 21:40 UTC by John Sullivan
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description John Sullivan 2001-09-10 00:48:29 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 -------