diff options
author | Alexander Larsson <alla@lysator.liu.se> | 2002-03-14 02:58:56 +0000 |
---|---|---|
committer | Alexander Larsson <alexl@src.gnome.org> | 2002-03-14 02:58:56 +0000 |
commit | 9aa461e0df60dc862165df85baebe6313be97016 (patch) | |
tree | 546a9969339e6c048f84f19c70efdc2457895074 /libnautilus-private/nautilus-file-private.h | |
parent | cc242e85e3aa936627a534754b0753b1a0f38ec8 (diff) | |
download | nautilus-9aa461e0df60dc862165df85baebe6313be97016.tar.gz |
After loading the link info with the new display name, clear the old
2002-03-13 Alexander Larsson <alla@lysator.liu.se>
* libnautilus-private/nautilus-directory-async.c:
(link_info_done): After loading the link info with the new display
name, clear the old cached display name.
* libnautilus-private/nautilus-file-private.h:
(NautilusFileDetails): Add cached utf-8 display name and the
collation key for the display name.
(nautilus_file_clear_cached_display_name): New function
* libnautilus-private/nautilus-file.c:
(finalize): Free cached display name and collation key.
(update_info_internal, nautilus_file_update_name): clear
cached display name when filename changes.
(compare_by_display_name): Use nautilus_file_get_display_name_nocopy()
to avoid copy. Use nautilus_file_get_display_name_collation_key() to
avoid repeating expensive collation.
(nautilus_file_clear_cached_display_name): New function to clear
the cached display name and collation key.
(nautilus_file_get_display_name_collation_key): Cache the
value of g_utf8_collate_key() in order to do fast sorting on the
display name.
(nautilus_file_get_display_name_nocopy, nautilus_file_get_display_name):
Cache the final display_name utf-8 value. Don't call g_utf8_validate()
twice.
* libnautilus-private/nautilus-icon-container.c:
Remove assert that was showing up g_list_first() in my profiles.
Diffstat (limited to 'libnautilus-private/nautilus-file-private.h')
-rw-r--r-- | libnautilus-private/nautilus-file-private.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/libnautilus-private/nautilus-file-private.h b/libnautilus-private/nautilus-file-private.h index f42cf3218..9be02878c 100644 --- a/libnautilus-private/nautilus-file-private.h +++ b/libnautilus-private/nautilus-file-private.h @@ -53,6 +53,16 @@ struct NautilusFileDetails NautilusDirectory *directory; char *relative_uri; + /* Cached version of the display name, guaranteed UTF8 safe. + * This is used a lot for sorting views. + */ + char *cached_display_name; + /* We cache the result of g_utf8_collate_key() on + * cached_display_name in order to do quick sorting on + * the display name + */ + char *display_name_collation_key; + GnomeVFSFileInfo *info; GnomeVFSResult get_info_error; @@ -132,6 +142,8 @@ gboolean nautilus_file_get_date (NautilusFile NautilusDateType date_type, time_t *date); void nautilus_file_updated_deep_count_in_progress (NautilusFile *file); +void nautilus_file_clear_cached_display_name (NautilusFile *file); + /* Compare file's state with a fresh file info struct, return FALSE if * no change, update file and return TRUE if the file info contains |