Summary: | Including the same directory multiple times in XDG_DATA_DIRS causes cache to be excessively reloaded | ||
---|---|---|---|
Product: | xdgmime | Reporter: | Joe Shaw <joe> |
Component: | xdgmime | Assignee: | Jonathan Blandford <jrb> |
Status: | RESOLVED MOVED | QA Contact: | |
Severity: | normal | ||
Priority: | medium | ||
Version: | unspecified | ||
Hardware: | Other | ||
OS: | All | ||
Whiteboard: | |||
i915 platform: | i915 features: |
Description
Joe Shaw
2007-09-21 12:29:14 UTC
I agree that the valid -> invalid transition doesn't make much sense to me either, but the loop body in xdg_check_file confuses me anyway. if (! strcmp (list->directory_name, file_path) && st.st_mtime == list->mtime) { if (list->checked == XDG_CHECKED_UNCHECKED) list->checked = XDG_CHECKED_VALID; else if (list->checked == XDG_CHECKED_VALID) list->checked = XDG_CHECKED_INVALID; return (list->checked != XDG_CHECKED_VALID); } I would have expected that to be more like if (! strcmp (list->directory_name, file_path)) { if (list->checked == XDG_CHECKED_UNCHECKED) { if (list->mtime == st.st_mtime) list->checked = XDG_CHECKED_VALID; else list->checked = XDG_CHECKED_INVALID; list->mtime = st.st_mtime; } return list->checked == XDG_CHECKED_VALID; } Also, I think we can just as well prevent xdg_mime_init_from_directory from ever adding duplicates to the list. -- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/xdg/xdgmime/issues/22. |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.