2009-01-31 Cosimo Cecchi <cosimoc@gnome.org>
* libnautilus-private/nautilus-directory-async.c (lacks_link_info),
(monitor_includes_file), (link_info_done), (link_info_got_data),
(link_info_start):
* libnautilus-private/nautilus-file-private.h:
* libnautilus-private/nautilus-file.c (nautilus_file_clear_info),
(nautilus_file_should_show),
(filter_hidden_and_backup_partition_callback),
(nautilus_file_is_foreign_link):
* libnautilus-private/nautilus-file.h:
* libnautilus-private/nautilus-link.c (string_array_contains),
(nautilus_link_get_link_info_given_file_contents):
* libnautilus-private/nautilus-link.h:
* src/file-manager/fm-desktop-icon-view.c
(fm_desktop_icon_view_init):
* src/file-manager/fm-directory-view.c (fm_directory_view_init),
(fm_directory_view_should_show_file),
(fm_directory_view_set_show_foreign):
* src/file-manager/fm-directory-view.h:
* src/file-manager/fm-tree-model.c (should_show_file):
Follow the "OnlyShowIn" and "NotShowIn" == GNOME keys for
.desktop files, when they are put on the desktop.
Thanks to Federico Mena Quintero and Jared Moore (#338933).
svn path=/trunk/; revision=14905
2008-07-20 Christian Neumair <cneumair@gnome.org>
* libnautilus-private/nautilus-dnd.c (check_same_fs),
(nautilus_drag_default_drop_action_for_icons):
* libnautilus-private/nautilus-file-private.h:
* libnautilus-private/nautilus-file.c (nautilus_file_clear_info),
(finalize), (update_info_internal),
(nautilus_file_get_filesystem_id):
* libnautilus-private/nautilus-file.h:
Query filesystem ID, as referenced string. Use it to determine whether
two files are on the same FS during DND. Gets rid of synchronous I/O.
svn path=/trunk/; revision=14376
2008-06-30 Christian Neumair <cneumair@gnome.org>
* libnautilus-private/nautilus-directory-async.c (thumbnail_done),
(thumbnail_loader_size_prepared), (get_pixbuf_for_content),
(thumbnail_start):
* libnautilus-private/nautilus-file.h:
Scale down huge pixbufs when loading. Massively speed up loading of
directories where the original image is used as thumbnail.
Also try to write the whole file at once rather than writing in chunks.
* libnautilus-private/nautilus-file-private.h:
* libnautilus-private/nautilus-file.c (nautilus_file_get_icon):
Rewrite some flaky parts of thumbnailing.
Never scale any thumbnails up.
Always compose thumbnail on the fly instead storing it once and
scaling it up and down.
Add flag to force that thumbnail size matches
the output icon size for tree view.
* src/file-manager/fm-list-model.c (fm_list_model_get_value):
Use this flag.
svn path=/trunk/; revision=14309
2008-04-26 A. Walton <awalton@gnome.org>
reviewed by: Christian Neumair
* libnautilus-private/nautilus-file-private.h:
* libnautilus-private/nautilus-file-utilities.c
(nautilus_compute_title_for_location):
* libnautilus-private/nautilus-file.c (update_info_internal),
(nautilus_file_get_description):
* libnautilus-private/nautilus-file.h:
Use standard::description in the window title when it's available.
Closes bug #516007.
svn path=/trunk/; revision=14094
2008-02-21 David Zeuthen <davidz@redhat.com>
* libnautilus-private/nautilus-autorun.c: (should_autorun_mount):
Use g_volume_should_automount() to determine if we should autorun
programs on a mount.
* libnautilus-private/nautilus-directory-async.c:
(nautilus_directory_set_up_request),
(nautilus_async_destroying_file), (lacks_filesystem_info),
(wants_filesystem_info), (request_is_satisfied),
(directory_count_start), (mime_list_start),
(filesystem_info_cancel), (filesystem_info_stop),
(filesystem_info_state_free), (got_filesystem_info),
(query_filesystem_info_callback), (filesystem_info_start),
(start_or_stop_io), (nautilus_directory_cancel),
(cancel_filesystem_info_for_file), (cancel_loading_attributes),
(nautilus_directory_cancel_loading_file_attributes):
* libnautilus-private/nautilus-directory-private.h:
* libnautilus-private/nautilus-file-attributes.h: Add new
filesystem info attribute; right now two bits in NautilusFile's
private structure are set; the filesystem::use-preview and
filesystem:readonly.
* libnautilus-private/nautilus-file-operations.c:
(nautilus_file_operations_mount_volume):
* src/nautilus-places-sidebar.c: (open_selected_bookmark),
(mount_shortcut_cb): Don't inhibit automount from
nautilus_file_operations_mount_volume() because then everything
will be inhibited as the mount_added callback use it as
well. Rather, move the call to inhibit out to the proper call
sites.
* libnautilus-private/nautilus-file-private.h:
* libnautilus-private/nautilus-file.c:
(nautilus_file_get_filesystem_use_preview),
(nautilus_file_should_show_thumbnail),
(get_speed_tradeoff_preference_for_file),
(nautilus_file_get_mount):
* libnautilus-private/nautilus-file.h:
* src/file-manager/fm-directory-view.c: (load_directory):
* src/file-manager/fm-icon-view.c: (should_preview_sound):
* src/nautilus-window-manage-views.c: (update_for_new_location):
Use the new filesystem::use-preview hint to determine if we should
preview non-native files (such as gphoto2:// and cdda://
mounts).
svn path=/trunk/; revision=13795
2008-02-13 Alexander Larsson <alexl@redhat.com>
* libnautilus-private/nautilus-file.[ch]:
* libnautilus-private/nautilus-file-private.h:
Add nautilus_file_is_launcher()
* libnautilus-private/nautilus-directory-async.c:
* libnautilus-private/nautilus-dnd.c:
* libnautilus-private/nautilus-link.[ch]
* libnautilus-private/nautilus-mime-actions.c:
* libnautilus-private/nautilus-program-choosing.[ch]:
* src/file-manager/fm-directory-view.c:
* src/file-manager/fm-tree-view.c:
Remove weird desktop-file: and command: hacks, and
replace with usage and implementation of
nautilus_file_is_launcher().
This fixes some problems where the old desktop-file uri
was interpreted as an actual file.
svn path=/trunk/; revision=13734
2007-12-20 Alexander Larsson <alexl@redhat.com>
* libnautilus-private/nautilus-file-private.h:
Missed one "std" in the conversion
svn path=/trunk/; revision=13539
2006-10-18 Alexander Larsson <alexl@redhat.com>
* libnautilus-private/nautilus-file-private.h:
Add is_added flag to NautilusFile to make sure we always
send an added event to directory monitors.
* libnautilus-private/nautilus-directory-async.c:
(dequeue_pending_idle_callback):
Don't add the file to both added and changed list
If the file exist but hasn't been added yet, add it.
* libnautilus-private/nautilus-directory.c: (is_tentative):
Don't return non-added files for get_file_list to avoid duplicating
files if you do a list and then track adds.
Partially fixes#336051.
2006-04-18 Alexander Larsson <alexl@redhat.com>
* libnautilus-private/nautilus-file-attributes.h:
* libnautilus-private/nautilus-directory-async.c:
* libnautilus-private/nautilus-directory-private.h:
* libnautilus-private/nautilus-file-private.h:
* libnautilus-private/nautilus-file.c:
* libnautilus-private/nautilus-file.h:
Add LARGE_TOP_LEFT_TEXT attribute and change the text size for
the normal top-left text to 10x5.
Add need_large argument to nautilus_file_peek_top_left_text and
nautilus_extract_top_left_text.
* libnautilus-private/nautilus-icon-canvas-item.[ch]
Make details an instance-private instead of allocating separately.
Add _set_is_visible() and only keep PangoLayouts cached for
visible icons.
* libnautilus-private/nautilus-icon-container.[ch]:
* src/file-manager/fm-icon-container.c:
Monitor large embedded text for larger icons.
Call nautilus_icon_canvas_item_set_is_visible as needed.
* libnautilus-private/nautilus-icon-factory.[ch]:
Limit never-free recently used cache to 20 items.
Free other unused cache items after a 100 sec.
2005-09-06 Alexander Larsson <alexl@redhat.com>
* libnautilus-private/nautilus-directory-async.c:
(nautilus_directory_monitor_add_internal),
(nautilus_directory_monitor_remove_internal):
* libnautilus-private/nautilus-file-private.h:
* libnautilus-private/nautilus-file.c: (finalize):
Only use directory monitors to avoid using lots and lots of
file monitors. This is an optimization in almost all cases, although
it does a bit more work when viewing a file properties dialog with the
containing folder window hidden. (#315041)
2005-06-02 Christian Neumair <chris@gnome-de.org>
* libnautilus-private/nautilus-file.c: (compare_by_emblems),
(get_automatic_emblems_as_integer):
* libnautilus-private/nautilus-file-private.h:
Only take user-added emblems ("keywords") into account when sorting by
emblems. Fixes#166376.
2004-01-14 Alexander Larsson <alexl@redhat.com>
* libnautilus-private/nautilus-directory-async.c:
* libnautilus-private/nautilus-directory-private.h:
* libnautilus-private/nautilus-file-attributes.h:
* libnautilus-private/nautilus-file-private.h:
* libnautilus-private/nautilus-file.c:
* libnautilus-private/nautilus-file.h:
Add slow_mime_type file attribute.
Allow call_when_ready to take a NULL callback, and
allow these monitors to be duplicated. (Used for
fire-and-forget attribute reading)
* libnautilus-private/nautilus-mime-actions.c:
(nautilus_mime_actions_get_minimum_file_attributes):
Add slow mime type here
* src/file-manager/fm-directory-view.c:
Get slow mime type on selection
* src/file-manager/fm-properties-window.c:
Get slow mime type for properties dialog.
Don't use the same pointer twice for the
same monitor.
2003-12-18 Alexander Larsson <alexl@redhat.com>
* configure.in:
Require gtk/glib 2.3.0
* libnautilus-private/nautilus-directory.c:
Use gobject private data for details
* libnautilus-private/nautilus-file-private.h:
* libnautilus-private/nautilus-file.[ch]:
Use gobject private data for details
Add has_open_window flag and setter/getter
* libnautilus-private/nautilus-icon-container.[ch]:
* src/file-manager/fm-icon-container.c:
Support visiting modifier for icons with open windows
* src/file-manager/fm-directory-view.c:
Don't use filename extension in templates name
* src/file-manager/fm-list-model.c:
Support accept and visiting icon modifiers
* src/file-manager/fm-list-view.c:
Always set the drag_view on the model so that the accept
modifier works
* src/nautilus-window.c: (nautilus_window_set_viewed_file):
Set has_open_window on file
2003-11-05 Alexander Larsson <alexl@redhat.com>
* configure.in:
Require new gnome-vfs
* components/tree/nautilus-tree-view.c:
* libnautilus-private/nautilus-desktop-link-monitor.c:
* libnautilus-private/nautilus-desktop-link.[ch]:
* libnautilus-private/nautilus-monitor.c:
* libnautilus-private/nautilus-trash-directory.c:
* libnautilus-private/nautilus-trash-monitor.[ch]:
* src/nautilus-application.c:
Use gnome-vfs-volume-manager instead of nautilus-volume-manager.c
* libnautilus-private/nautilus-desktop-icon-file.c:
Set the volume on the nautilusfile
* libnautilus-private/nautilus-directory-async.c:
Load volume info from link
* libnautilus-private/nautilus-file-attributes.h:
* libnautilus-private/nautilus-mime-actions.c:
Add new VOLUMES attribute
* libnautilus-private/nautilus-file-private.h:
Add has_volume and has_drive to NautilusFile
* libnautilus-private/nautilus-file.[ch]:
Add has_volume and has_drive to NautilusFile
Volumes/drives are sorted separately
* libnautilus-private/nautilus-link-desktop-file.[ch]:
* libnautilus-private/nautilus-link.[ch]:
Read drive and volume id from links
* src/file-manager/fm-desktop-icon-view.c:
* src/file-manager/nautilus-desktop-icon-view-ui.xml:
Remove volume ops. Remove disks menu
* src/file-manager/fm-directory-view.c:
* src/file-manager/nautilus-directory-view-ui.xml:
Implement volume ops using gnome-vfs
* src/file-manager/fm-properties-window.c:
Handle drives/volumes
* src/nautilus-window.c:
Make a nicer title for some specific locations
* libnautilus-private/nautilus-volume-monitor.[ch]:
* libnautilus-private/Makefile.am
remove this old crap
2003-03-12 Alexander Larsson <alexl@redhat.com>
* libnautilus-private/nautilus-file-private.h:
* libnautilus-private/nautilus-file.c: (finalize),
(nautilus_file_invalidate_attributes_internal),
(nautilus_file_is_thumbnailing),
(nautilus_file_set_is_thumbnailing):
* libnautilus-private/nautilus-file.h:
Keep track of whether the file is being thumbnailed.
If it is at finalization, remove from the thumbnail queue.
* libnautilus-private/nautilus-icon-container.h:
* libnautilus-private/nautilus-icon-container.c:
(redo_layout_internal), (realize),
(nautilus_icon_container_instance_init),
(nautilus_icon_container_prioritize_thumbnailing),
(nautilus_icon_container_prioritize_thumbnailing_for_visible_icons)
, (handle_vadjustment_changed):
Prioritize thumbnailing for icons visibile on the screen.
* libnautilus-private/nautilus-icon-factory.c:
(show_thumbnails_changed_callback):
Remove all thumbnails from queue when thumbnails are disabled.
* libnautilus-private/nautilus-thumbnails.h:
* libnautilus-private/nautilus-thumbnails.c: (free_thumbnail_info),
(nautilus_thumbnail_remove_from_queue),
(nautilus_thumbnail_remove_all_from_queue),
(nautilus_thumbnail_prioritize),
(thumbnail_thread_notify_file_changed),
(nautilus_create_thumbnail), (thumbnail_thread_start):
New functions to remove thumbnails from the queue and to prioritize them.
* src/file-manager/fm-icon-container.c:
(fm_icon_container_prioritize_thumbnailing),
(fm_icon_container_class_init):
Implement prioritize_thumbnailing.
2003-02-10 Dave Camp <dave@ximian.com>
* libnautilus-private/nautilus-directory.c:
(nautilus_directory_notify_files_moved): Use
nautilus_file_update_name_and_directory().
* libnautilus-private/nautilus-file-private.h:
* libnautilus-private/nautilus-file.c: (update_name_internal): New
function.
(nautilus_file_update_name_and_directory): New function.
(nautilus_file_update_name): Use update_name_internal.
(nautilus_file_set_directory): Use
nautilus_file_update_name_and_directory().
Fixes#97490.
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.
* libnautilus-private/nautilus-directory.c:
(nautilus_directory_notify_files_removed): Don't pay any attention
if we're told about removal of a file we're renaming.
* libnautilus-private/nautilus-file-private.h: Add new call to tell
if the file is being renamed.
* libnautilus-private/nautilus-file.c: (rename_guts): Set flag to
say this file is being renamed.
(nautilus_file_rename_in_progress): New.
* libnautilus-private/Makefile.am: Remove nautilus-desktop-file-loader.[ch].
* libnautilus-private/nautilus-desktop-file-loader.c: Remove.
* libnautilus-private/nautilus-desktop-file-loader.h: Remove.
* libnautilus-private/nautilus-directory-async.c:
(link_info_nautilus_link_read_callback): Pass in NULL for the new
optional URI parameter for parsing existing link files.
* libnautilus-private/nautilus-link-desktop-file.h:
* libnautilus-private/nautilus-link-desktop-file.c:
Change to use GnomeDesktopItem instead of NautilusDesktopFile.
* libnautilus-private/nautilus-link.h:
* libnautilus-private/nautilus-link.c:
(nautilus_link_get_link_uri_given_file_contents),
(nautilus_link_get_link_name_given_file_contents),
(nautilus_link_get_link_icon_given_file_contents):
Add optional URI parameter for parsing existing link files. This
is passed down to the GnomeDesktopItem level, which can sometimes
do a better job if it knows the URI.
* src/file-manager/fm-directory-view.c: (activate_callback):
Change to use GnomeDesktopItem instead of NautilusDesktopFile. Also,
simplify error handling.
* Many files:
Fix includes to use <> style in headers more consistently, and remove
unnecessarily includes.
* libnautilus-private/nautilus-file-attributes.h,
libnautilus-private/nautilus-file-private.h: Rename CUSTOM_NAME
attribute to DISPLAY_NAME.
* libnautilus-private/nautilus-file.h,
libnautilus-private/nautilus-file.c:
(nautilus_file_get_name): Always return the real name of the file.
(nautilus_file_get_display_name): New function which returns the
display name of the file, taking into account special names that
may be set for .desktop files or gmc-style links, as
nautilus_file_get_name formerly did.
(nautilus_file_compare_display_name): Use display name and rename
for clarity.
(destroy, compare_by_name, nautilus_file_get_string_attribute,
nautilus_file_get_all_attributes, nautilus_self_check_file):
Adjust for custom_name->display_name change, use
nautilus_file_get_display_name instead of natilus_file_get_name
where appropriate.
* libnautilus-private/nautilus-directory-async.c:
(nautilus_directory_set_up_request), (link_info_done,
(link_info_gmc_link_read_callback): Adjust for custom_name->display_name change.
In all the places below, use nautilus_file_get_display_name
instead of nautilus_file_get_name:
* components/text/nautilus-text-view.c: (file_read_callback):
* components/tree/nautilus-tree-model.c:
(nautilus_tree_model_monitor_add),
(nautilus_tree_model_node_begin_monitoring_no_connect):
* components/tree/nautilus-tree-view.c:
(nautilus_tree_view_insert_model_node),
(nautilus_tree_view_update_model_node):
* libnautilus-private/nautilus-program-chooser.c:
(get_file_name_for_display):
* libnautilus-private/nautilus-program-choosing.c:
(application_cannot_open_location):
* src/file-manager/fm-directory-view.c:
(fm_directory_view_display_selection_info),
(real_file_limit_reached), (file_name_from_uri),
(add_script_to_script_menus), (add_submenu_to_script_menus),
(copy_or_cut_files), (get_executable_text_file_action),
(fm_directory_view_activate_file), (finish_loading):
* src/file-manager/fm-error-reporting.c:
(fm_report_error_loading_directory),
(fm_report_error_renaming_file), (fm_report_error_setting_group),
(fm_report_error_setting_owner),
(fm_report_error_setting_permissions), (fm_rename_file):
* src/file-manager/fm-icon-view.c:
(icon_container_preview_callback), (get_icon_text_callback):
* src/file-manager/fm-list-view.c: (match_row_name):
* src/file-manager/fm-properties-window.c:
(name_field_update_to_match_file),
(update_properties_window_title), (create_permissions_page),
(create_properties_window):
* src/file-manager/fm-search-list-view.c: (real_adding_file):
* src/nautilus-window-manage-views.c: (compute_default_title):
* src/nautilus-window.c: (nautilus_window_set_viewed_file):
copying an empty folder to another).
* libnautilus-private/nautilus-directory-async.c:
(nautilus_file_invalidate_count_and_mime_list): New function to
invalidate a directory's item count and item mime list given it's
corresponding NautilusFile object.
(nautilus_directory_invalidate_count_and_mime_list): Reimplemented
in terms of the above.
* libnautilus-private/nautilus-file-private.h:
Prototype the new function.
* libnautilus-private/nautilus-directory.c:
(nautilus_directory_notify_files_added): If the NautilusDirectory
for a directory into which files are being moved is not being
monitored but the NautilusFile is, make sure to invalidate it's
item count and mime list. This is the corner case that bug 7015
was tickling.
installed on people's systems.
* libnautilus-extensions/nautilus-directory-async.c:
(find_monitor): Tightened up the function.
(monitor_file_compare), (find_any_monitor): Functions to see if a
file still has a reason to be monitored.
(nautilus_directory_monitor_add_internal): Start FAM monitoring.
(nautilus_directory_monitor_remove_internal): Stop FAM monitoring.
* libnautilus-extensions/nautilus-directory-private.h: Add a place
to keep track of the FAM monitor.
* libnautilus-extensions/nautilus-file-private.h: Add a place
to keep track of the FAM monitor.
* libnautilus-extensions/nautilus-directory.c:
(nautilus_directory_destroy): Stop FAM monitoring.
* libnautilus-extensions/nautilus-file.c: (destroy): Stop FAM
monitoring.
* libnautilus-extensions/nautilus-monitor.c:
(get_event_uri): Use FAMREQUEST_GETREQNUM instead of going
directly at the struct.
(process_fam_notifications): Get rid of the messages and call
nautilus_file_changes_consume_changes on the way out.
(nautilus_monitor_file): Get rid of the message.
(nautilus_monitor_directory): Get rid of the message and use
FAMREQUEST_GETREQNUM instead of going directly at the struct.
(nautilus_monitor_cancel): Get rid of the message and use
FAMREQUEST_GETREQNUM instead of going directly at the struct.
2001-03-02 Pavel Cisler <pavel@eazel.com>
Fix 7225 (emblem sorting locks up entire system for extended
period of time)
reviewed by: Darin Adler <darin@eazel.com>
* libnautilus-extensions/nautilus-file-private.h:
* libnautilus-extensions/nautilus-file.c:
(fill_emblem_cache_if_needed), (compare_by_emblems):
Implement a simple cache for automatic and keyword emblems.
* libnautilus-extensions/nautilus-file.c:
(destroy), (nautilus_file_set_keywords),
(nautilus_file_emit_changed):
Nuke the cache when keywords change.
2001-02-20 John Harper <jsh@eazel.com>
reviewed by Maciej Stachowiak <mjs@eazel.com>
Fixed bug where a renamed node in the tree view doesn't get
resorted:
* libnautilus-extensions/nautilus-ctree.c (set_node_info): if
the ctree is in auto-sort mode, sort the branch containing the
changed node
Fixed a crash in the tree view when expanding nodes that have
been moved across directories:
* components/tree/nautilus-tree-node.c
(nautilus_tree_node_remove_children): new function, unparents
all children of the given node
(nautilus_tree_node_destroy): emit a warning if the list of
children is non-null (then call remove_children). Ideally the
remove_children function should get called before the final
unref of a directory node
* components/tree/nautilus-tree-model.c
(report_node_removed_internal): call
nautilus_tree_node_remove_children before unref'ing the node
Mostly fixed bug where expansion state hash table accumulates
cruft over time (e.g. directories that no longer exist or got
moved to locations where they can never be displayed):
* components/tree/nautilus-tree-view.h
(NautilusTreeViewDetails): added `view_node_to_uri_map' hash
table. This is used to map view nodes to the URIs we believe
they are displaying. This is necessary since by the time we
find out about changes to nodes, the names of the underlying
NautilusFile objects have often already been changed
* components/tree/nautilus-tree-view.c
(unlink_view_node_from_uri, link_view_node_with_uri,
map_view_node_to_uri): functions accessing the new hash table
(nautilus_tree_view_would_include_file): new function, returns
true iff the given file may possibly appear in the tree view.
Climbs through all parents of the file to do this
(nautilus_tree_view_model_node_renamed_callback): only
propagates the expansion state if the would_include function
indicates that the new URI of the file would be included in the
tree view
* components/tree/nautilus-tree-model.c (report_node_changed):
no need to suppress the `node_removed' signal when renaming the
node (now that the view always deletes the expansion state of
the correct URI)
* libnautilus-extensions/nautilus-file.c,
libnautilus-extensions/nautilus-file-private.h,
libnautilus-extensions/nautilus-file-utilities.c,
libnautilus-extensions/nautilus-file-utilities.h
(nautilus_file_name_matches_hidden_pattern,
nautilus_file_name_matches_backup_pattern): moved these
functions from being private in nautilus-file to being public
in nautilus-file-utilities
Fixed tree view bug where moving nodes across directories still
loses the expansion state:
* components/tree/nautilus-tree-model.c
(nautilus_tree_model_directory_files_changed_callback):
separated the cases of the file being deleted and it being
moved across directories. In the move case emit the
`being_renamed' signal so the expansion state gets propagated
(nautilus_tree_view_remove_model_node, forget_view_node): moved
the code to delete the expansion state from forget_view_node to
nautilus_tree_view_remove_model_node - avoids deleting
expansion state of nodes that will later be renamed. It may
leave non-existent directories in the expansion state, but this
is a lesser bug than losing the expansion state totally. Also,
use the map_view_node_to_uri function to find the URI whose
expansion state needs to be removed
Fixed the bug where tree view icons often got chopped at top
and bottom when they're drawn (if the icon height is greater
than the font height). This means that fewer rows may fit in
the same vertical space, but visually it's (imho) a huge
improvement (I think this is bug 6085):
* components/tree/nautilus-tree-view.c
(nautilus_tree_view_initialize): call gtk_clist_set_row_height
with the maximum of the font height and the icon height
* libnautilus-extensions/nautilus-ctree.c (draw_row): always
calculate row_center_offset locally, and do it in such a way
that the text really is in the center of the row!
Fixed bug 5165 - repeatedly expanding and collapsing an empty
directory doesn't change how the node's icon is drawn after the
first expansion:
* libnautilus-extensions/nautilus-ctree.c (real_tree_expand,
real_tree_collapse): before returning, call tree_draw_node on
the node that changed state
Finish fixing bug 6286 (need to re-apply optimization where we do
a single directory load):
* src/nautilus-window-manage-views.c: (begin_location_change): Do
the force_reload work in here. We want it on all 4 kinds of
location change (forward, back, new location, reload). Other
browsers don't do reload on back, so we may want to change this at
some point.
(nautilus_window_reload): Remove the old code to invalidate from
here now that it's done in begin_location_change.
* src/file-manager/fm-directory-view.c: (load_location_callback),
(load_directory), (finish_loading), (filtering_changed_callback):
Remove the old code to do force_reload. The NautilusDirectory part
of triggering a reload is now handled by the shell.
* libnautilus-extensions/nautilus-directory.h:
* libnautilus-extensions/nautilus-directory.c:
(nautilus_directory_file_monitor_add): No force_reload parameter
any more.
(nautilus_directory_force_reload): New separate call used to force
a reload. A method call so subclasses can implement.
(nautilus_self_check_directory): Removed the FALSE force_reload
argument to file_monitor_add.
* libnautilus-extensions/nautilus-vfs-directory.c:
(vfs_file_monitor_add): No force_reload parameter any more.
(vfs_force_reload): Call through to
nautilus_directory_force_reload_internal to do the real work.
(nautilus_vfs_directory_initialize_class): Install the new
force_reload function.
* libnautilus-extensions/nautilus-merged-directory.c:
(merged_file_monitor_add): No force_reload parameter any more.
(merged_force_reload): Tell all of the real directories to force a
reload.
(monitor_add_directory): No force_reload to track any more.
(nautilus_merged_directory_initialize_class): Install the new
force_reload function.
* libnautilus-extensions/nautilus-directory-private.h:
* libnautilus-extensions/nautilus-directory-async.c:
(nautilus_directory_force_reload_internal): Change the name of
this function, since there's now a public function that is named
nautilus_directory_force_reload.
* libnautilus-extensions/nautilus-file-private.h:
* libnautilus-extensions/nautilus-file.c:
(nautilus_file_get_all_attributes): Made a separate call so other
parts of the framework can use it.
(nautilus_file_invalidate_all_attributes): Use the new call.
* components/tree/nautilus-tree-model.c:
(nautilus_tree_model_monitor_add),
(nautilus_tree_model_node_begin_monitoring_no_connect): Use the
new force_reload call. The old one had more granularity and thus
forced less to be reloaded, but it's OK to do a little more here.
* libnautilus-extensions/nautilus-trash-monitor.c:
(nautilus_trash_monitor_initialize): Removed the FALSE
force_reload argument to file_monitor_add.
Other stuff:
* libnautilus-extensions/nautilus-directory-metafile.c:
(get_metafile), (nautilus_directory_get_file_metadata),
(nautilus_directory_get_file_metadata_list),
(nautilus_directory_set_file_metadata),
(nautilus_directory_set_file_metadata_list),
(nautilus_directory_copy_file_metadata),
(nautilus_directory_remove_file_metadata),
(nautilus_directory_rename_file_metadata): Moved FIXMEs around.
Pass NULL instead of &ev when calling bonobo_object_release_unref
since we don't really want to do anything different if there's
some kind of error.
* nautilus-installer/install-lib/.cvsignore:
* nautilus-installer/libtrilobite/.cvsignore:
Gotta create these files when you make new directories.
* README: Change xml-i18n-tools to mention the correct branch.
Fixed bug 4427 (Should not execute text files by default).
Now it asks whether to run or display executable text files.
Advanced users can set a new preference.
* libnautilus-extensions/nautilus-stock-dialogs.h:
* libnautilus-extensions/nautilus-stock-dialogs.c:
(create_message_box): New bottleneck function, contains former
guts of show_message_box but doesn't call gtk_widget_show.
(show_message_box): Now just a simple wrapper for
calling create_message_box and showing the result.
(nautilus_show_info_dialog), (nautilus_show_warning_dialog),
(nautilus_show_error_dialog), (nautilus_show_yes_no_dialog),
(nautilus_show_error_dialog_with_details):
Renamed to add verb "show" to names.
(nautilus_run_simple_dialog): Renamed to add verb "run" to name.
(nautilus_create_question_dialog): New public function, does
not show the dialog yet so caller can add more buttons or
whatever before showing.
* libnautilus-extensions/nautilus-global-preferences.h:
* libnautilus-extensions/nautilus-global-preferences.c:
(global_preferences_install_descriptions),
(global_preferences_install_defaults),
(global_preferences_install_visibility),
(global_preferences_create_dialog): Add new preference for
what to do when an executable text file is activated. It
defaults to "Ask" and is visible only at Advanced level.
* libnautilus-extensions/nautilus-file-private.h:
* libnautilus-extensions/nautilus-file.h: Moved
nautilus_file_contains_text into public header.
* src/file-manager/fm-directory-view.c:
(get_executable_text_file_action): New function, uses preference
and dialog (if necessary) to determine how to handle activating
an executable text file.
(activate_callback): Now handles executable text files specially
by using get_executable_text_file_action. Restructured the control
flow a little.
* components/music/nautilus-music-view.c: (set_album_cover),
(play_current_file), (nautilus_music_view_update):
* components/rpmview/nautilus-rpm-view-install.c:
(nautilus_rpm_view_install_done):
* components/services/summary/nautilus-view/nautilus-summary-dialogs.c:
(nautilus_summary_login_failure_dialog),
(generate_error_dialog):
* components/text/nautilus-text-view.c: (file_read_callback):
* libnautilus-extensions/nautilus-file-operations.c:
(confirm_empty_trash),
(handle_transfer_vfs_error), (handle_transfer_overwrite),
(nautilus_file_operations_copy_move),
(handle_new_folder_vfs_error),
(nautilus_file_operations_move_to_trash):
* libnautilus-extensions/nautilus-icon-dnd.c:
(confirm_switch_to_manual_layout):
* libnautilus-extensions/nautilus-program-chooser.c:
(nautilus_program_chooser_show_no_choices_message):
* libnautilus-extensions/nautilus-program-choosing.c:
(nautilus_launch_application):
* libnautilus-extensions/nautilus-volume-monitor.c:
(display_mount_status):
* src/file-manager/fm-desktop-icon-view.c:
(icon_view_create_nautilus_links):
* src/file-manager/fm-directory-view.c:
(fm_directory_view_confirm_multiple_windows),
(real_file_limit_reached), (fm_directory_view_confirm_deletion),
(confirm_delete_from_trash), (report_broken_symbolic_link),
* src/file-manager/fm-error-reporting.c:
(fm_report_error_renaming_file), (fm_report_error_setting_group),
(fm_report_error_setting_owner),
(fm_report_error_setting_permissions):
* src/file-manager/fm-properties-window.c: (set_custom_image):
* src/file-manager/fm-search-list-view.c: (load_location_callback),
(load_error_callback), (display_indexed_search_problems_dialog),
(real_file_limit_reached):
* src/file-manager/nautilus-indexing-info.c:
(update_file_index_callback),
(show_search_service_not_available_dialog):
* src/nautilus-application.c: (check_required_directories),
(nautilus_application_startup):
* src/nautilus-location-bar.c: (drag_data_received_callback):
* src/nautilus-property-browser.c: (remove_pattern),
(remove_emblem), (emblem_image_file_changed),
(add_pattern_to_browser), (add_color_to_browser),
(emblem_dialog_clicked):
* src/nautilus-sidebar.c: (receive_dropped_uri_list):
* src/nautilus-theme-selector.c: (add_theme_to_icons),
(theme_select_row_callback):
* src/nautilus-window-manage-views.c: (handle_unreadable_location),
(report_content_view_failure_to_user_internal),
(report_sidebar_panel_failure_to_user),
(nautilus_window_end_location_change_callback):
* src/nautilus-window-menus.c: (forget_history_if_confirmed),
(show_bogus_bookmark_window): Updated for dialog API name changes.
* libnautilus-extensions/nautilus-file.c: (get_description):
Lucky Aaron gets missing mime description complaints now.
could be faster)
Fixed bug 5687 (Sidebar flickers and CPU thrashes during
deep count calculation in properties window)
Changed the deep count calculation to send a specialized
signal when the in-progress count updates, instead of using
"file_changed", since many parts of the UI react to file_changed
by doing (in this case unnecessary) work. My stopwatch measurement
on a large directory showed that the time to calculate 20000
contained files went from 147 seconds to 8 seconds, and the CPU
usage pegged around 15% (formerly 100%).
* libnautilus-extensions/nautilus-directory-async.c:
(deep_count_callback): Call nautilus_file_changed only when
count is finished; call nautilus_file_updated_deep_count_in_progress
after every new higher value is computed.
* libnautilus-extensions/nautilus-file-private.h:
Added prototype for nautilus_file_updated_deep_count_in_progress.
* libnautilus-extensions/nautilus-file.h:
* libnautilus-extensions/nautilus-file.c:
(nautilus_file_initialize_class): define "updated_deep_count_in_progres"
signal.
(nautilus_file_updated_deep_count_in_progress): send this new signal
for this file (which must be a directory) and any links pointing to
it.
* src/file-manager/fm-properties-window.c:
(attach_directory_contents_value_field): Make text field in properties
window react to new signal instead of "changed".
Fixed bug 2147 (NautilusFile for trash needs non-empty values for
more properties), bug 5652 (MIME type field appears but shouldn't
in properties window for Trash), and bug 4620 (trash sidebar
should show number of items).
* libnautilus-extensions/nautilus-file.h:
* libnautilus-extensions/nautilus-file-private.h:
* libnautilus-extensions/nautilus-file.c:
(nautilus_file_new_from_relative_uri): Create trash file subclass
when appropriate.
(nautilus_file_info_missing): Rename so it can be used in other
source files.
(nautilus_file_get_date): New method that returns numeric dates.
(nautilus_file_get_date_as_string): Change to call
nautilus_file_get_date to get the numeric date.
(nautilus_file_get_file_type): Turn into a method.
* libnautilus-extensions/nautilus-merged-directory.h:
* libnautilus-extensions/nautilus-merged-directory.c:
(merged_call_when_ready): Rolled in the old
merged_callback_connect_directory function.
(merged_contains_file): Moved down to a more appropriate part of
the source file.
(nautilus_merged_directory_get_real_directories): New public
function for use by trash.
* libnautilus-extensions/nautilus-trash-file.c:
(trash_callback_hash), (trash_callback_equal),
(trash_callback_destroy), (trash_callback_check_done),
(trash_callback_remove_file), (ready_callback),
(real_file_changed_callback), (monitor_add_file), (add_real_file),
(trash_callback_remove_file_cover), (monitor_remove_file),
(remove_real_file), (add_real_file_given_directory),
(add_directory_callback), (remove_directory_callback),
(trash_file_call_when_ready), (trash_file_cancel_call_when_ready),
(trash_file_check_if_ready), (trash_file_monitor_add),
(trash_file_monitor_remove), (trash_file_get_file_type),
(trash_file_get_item_count), (trash_file_get_deep_counts),
(trash_file_get_date), (remove_all_real_files),
(nautilus_trash_file_initialize), (trash_destroy),
(nautilus_trash_file_initialize_class):
New code. First implementation of getting some attributes for the
merged trash. Gets list of directories from the
NautilusTrashDirectory object. The code in here is similar to the
NautilusMergedDirectory class and at some point perhaps we can
make the two share more.
* libnautilus-extensions/nautilus-vfs-file.c:
(vfs_file_get_file_type), (vfs_file_get_date),
(nautilus_vfs_file_initialize_class): Implement the two new
methods for the standard vfs case.
Fixed various things that affect the properties window for the
trash that showed up while I was testing the above work:
* libnautilus-extensions/nautilus-icon-factory.c:
(nautilus_icon_factory_get_icon_name_for_regular_file),
(nautilus_icon_factory_get_icon_name_for_file): Move trash special
case out so it doesn't matter what type the trash seems to be. The
old code relied on trash not being a directory.
* src/file-manager/fm-properties-window.c:
(create_properties_window), (create_properties_window_callback),
(cancel_create_properties_window_callback),
(directory_view_destroyed_callback), (remove_pending_file): Rework
code to fix problems where the timed wait or the signal handler
wasn't properly cleaned up.
Fixed remaining bit of bug 5631 (Tear-offs of right-click menus
don't work.):
* src/file-manager/nautilus-desktop-icon-view-ui.xml: Mark Disks
right-click submenu so it won't get a tear-off item.
Fixed bug 5650 (nautilus --quit fails to return to prompt
sometimes):
* src/nautilus-application.c: (nautilus_application_startup): Add
special case so "nautilus --quit" doesn't hang waiting for a
response from the (now quit) "server" instance of Nautilus.
* src/nautilus-shell-interface.idl: Had to make the quit call no
longer be "oneway" to get it to work right, otherwise the quit
message could be lost when the sending application exited too
fast.
Fix bug 5675 (Nitpicks in new "could not be moved to new special
location" dialog):
* libnautilus-extensions/nautilus-file-operations.c:
(handle_transfer_overwrite): Updated message wording as Eli (and
Vera) suggest.
Other changes:
* libnautilus-extensions/nautilus-view-identifier.c:
(get_lang_list): Fix comment and a small storage leak in the case
where lang_with_locale is non-NULL but empty.
* po/POTFILES.ignore: Obsolete file, no longer used.
* src/file-manager/fm-desktop-icon-view.c:
(update_home_link_and_delete_copies): Update comment to help
translators understand better.
* libnautilus-extensions/nautilus-directory-async.c:
(directory_load_callback): Added a new assertion that could help
in future gnome-vfs debugging.
* libnautilus/nautilus-view-component.idl: Removed long-ago-fixed
FIXME comment.
* src/nautilus-window-manage-views.c: Tweak spacing.
Fixed bug 3811 (shallow file counts and top-left text are fetched
even for non-displayed hidden/backup items).
* libnautilus-extensions/nautilus-directory-private.h:
* libnautilus-extensions/nautilus-directory-async.c:
(allow_metafile): Add "ghelp:" and "gnome-help:" to the
unfortunate list of hard-coded schemes. If we hard-code "help:" we
have to hard-code its synonyms too.
(find_monitor): Use g_new0 so fields in the Monitor are not
uninitialized in this case (the fields in question are ignored,
but it's still nicer this way).
(nautilus_directory_monitor_add_internal): Set up the "monitor
hidden files" and "monitor backup files" in the Monitor structure
based on new parameters.
(should_display_file_name): Use
nautilus_file_name_matches_hidden_pattern and
nautilus_file_name_matches_backup_pattern.
(monitor_includes_file): New function that encapsulates the rule
about which monitor includes which file. Handles the new flags for
not monitoring hidden or backup files.
(is_needy): Call monitor_includes_file.
(select_needy_file): Call monitor_includes_file.
* libnautilus-extensions/nautilus-file-private.h:
* libnautilus-extensions/nautilus-file.c:
(nautilus_file_name_matches_hidden_pattern),
(nautilus_file_name_matches_backup_pattern): New functions to
share with the directory code.
(nautilus_file_is_hidden_file), (nautilus_file_is_backup_file):
Use the new functions and use the raw relative_uri -- no need to
unescape to change to a file name since the "." and "~" characters
are not encoded.
* src/file-manager/fm-directory-view.c:
(fm_directory_view_initialize): Share more code with the
filtering_changed_callback. Handle the desktop view better by
never setting the "show hidden" and "show backup" flags (so they
are both FALSE) and not setting up the callbacks.
(fm_directory_view_destroy): Since we don't set up the callbacks
for desktop windows, don't remove them for desktop windows.
(queue_pending_files): Remove the desktop special case from
here. It was strange to set the flags up then wait until this
moment to clear them both. It's better to keep them FALSE.
(finish_loading): Renamed and changed to pass the appropriate
values in to the nautilus_directory_file_monitor_add call -- this
is the actual bug fix.
(filtering_changed_callback): Remove the desktop special case,
since this function will now never be called for the desktop.
* libnautilus-extensions/nautilus-directory.h:
* libnautilus-extensions/nautilus-directory.c:
(nautilus_directory_file_monitor_add): Pass through the new
"monitor hidden files" and "monitor backup files" parameters.
(nautilus_self_check_directory): Pass TRUE for both.
* libnautilus-extensions/nautilus-vfs-directory.c:
(vfs_file_monitor_add): Pass through the new "monitor hidden
files" and "monitor backup files" parameters.
* libnautilus-extensions/nautilus-merged-directory.c:
(merged_file_monitor_add), (monitor_add_directory): Store the
"monitor hidden files" and "monitor backup files" and pass them
through to the individual directory monitor calls.
* components/tree/nautilus-tree-model.c:
(nautilus_tree_model_node_begin_monitoring_no_connect):
* libnautilus-extensions/nautilus-file.c:
(nautilus_file_monitor_add):
* libnautilus-extensions/nautilus-trash-monitor.c:
(nautilus_trash_monitor_initialize):
* src/nautilus-applicable-views.c:
(got_minimum_file_info_callback):
Pass in TRUE for "monitor hidden files" and "monitor backup files"
to get the same behavior as before. (In some cases the booleans
are just ignored, in other cases we just monitor all files as we
used to.)
* RENAMING: Remind myself to change the name of the
NAUTILUS_CALL_VIRTUAL macro to NAUTILUS_CALL_METHOD some day.
Fixed bug 5067 (Moving a file doesn't update the directory in the
link hash table).
Fixed bug 5366 (error when passing two directories on the command
line).
* libnautilus-extensions/nautilus-directory.c:
(nautilus_directory_remove_file): Change code that was doing "==
FALSE" which is not such good style.
(nautilus_directory_notify_files_moved): Change to properly update
file names in all cases and to update the directory with a new
nautilus_file_set_directory function.
* libnautilus-extensions/nautilus-file-private.h: Moved the
Knowledge enum up here. I was going to make a change that required
it, and now I don't feel like moving it back.
* libnautilus-extensions/nautilus-file.h: Add
nautilus_file_set_directory (and reformat).
* libnautilus-extensions/nautilus-file.c: (is_self_owned),
(destroy): Moved is_self_owned so the destroy function can use it.
(update_info_internal): Call the update_links functions before
(nautilus_file_set_directory): New function that changes the
parent directory and updates everything appropriately.
(nautilus_file_mark_gone): Added a check that the file is not
already marked gone.
* src/nautilus-main.c: (main): Sort the command-line options, add
some single-character versions, add code to initialize the
"geometry" variable for the case where the option is not passed,
removed some unused code that sets start_desktop twice.
Fix bug 4919 (Tree view crashes when you expand and collapse the
root node). I did this by changing the design of file attribute
forgetting, which I implemented recently - now when you forget an
attribute, it is merely marked out of date, not thrown away; the
old value is still available until the fresh value is actually
loaded. This fixes other potential UI problems with the old
approach but I am not sure if bugs were filed for those.
* libnautilus-extensions/nautilus-file-private.h: Added new
is_up_to_date booleans, converted all booleans and the
RequestStatus enum to bitfields. This saved 200-300k or so for me
on runs of Nautilus with the tree view on and expanded a lot.
* libnautilus-extensions/nautilus-file.h,
libnautilus-extensions/nautilus-file.c:
(nautilus_file_invalidate_attributes_internal,
nautilus_file_invalidate_attributes,
nautilus_file_invalidate_all_attributes): Renamed to match new
semantics.
(update_info_internal): Mark file info up to date.
(invalidate_directory_count), (invalidate_deep_counts),
(invalidate_mime_list), (invalidate_top_left_text),
(invalidate_file_info), (invalidate_activation_uri): renamed from
forget_*, and changed to only mark the attributes invalid, not
actually throw them out.
* libnautilus-extensions/nautilus-directory-async.c:
(lacks_directory_count, lacks_top_left, lacks_info,
lacks_mime_list, lacks_activation_uri): Check _is_up_to_date bit
for relevant attribute, not got_ or _failed bits. If the info is
out of date, we want to retry eve if we already got it or it
already failed.
(directory_count_callback, mime_list_callback,
top_left_read_callback, get_info_callback,
activation_uri_read_done): Mark corresponding attributes up to
date.
(dequeue_pending_idle_callback): Mark directory_count and
mime_list up to date if appropriate.
(file_info_start): Mark file info up to date on invalid URI error.
(nautilus_directory_invalidate_counts): Mark directory count and
mime list out of date, but do not forget them.
(nautilus_directory_invalidate_file_attributes): Renamed.
(nautilus_directory_force_reload): Deal with rename.
(cancel_loading_attributes,
nautilus_directory_cancel_loading_file_attributes): Replace forget
with invalidate in some comments.
* libnautilus-extensions/nautilus-link.c
(forget_file_activation_uri): Handle function renames.
* src/nautilus-window-manage-views.c
(nautilus_window_begin_location_change): Likewise
Fixed bugs 4385 (Nautilus doesn't gracefully handle deleting
in-use image file), 3240 (reloading a directory doesn't update
directory counts of the entries) and 4683 (embedded text on icon
isn't updated when text changes) by implementing forgetting of
file attributes and using it when appropriate.
Also fixed various other bugs cought by testing of these fixes or
reading the code.
* libnautilus-extensions/nautilus-file.c:
(nautilus_file_forget_attributes): New function that makes the
file forget the specified attributes, including cancelling
possible in-progress I/O for them, and kicking off new I/O if
anyone is monitoring any of the attributes or has a pending
call_when_ready.
(nautilus_file_forget_attributes_internal): Forget all attributes
of this file, *not* including cancelling in-progress I/O, or
kicking off new I/O. This is for the benefit of NautilusDirectory
being able to forget the attributes of all files it is monitoring
at one go.
(nautilus_file_forget_all_attributes): Forget all attributes of
this file, including cancelling in-progress I/O, and kicking off
new I/O.
(forget_directory_count, forget_deep_counts, forget_mime_list,
forget_top_left_text, forget_file_info, forget_activation_uri):
Helper functions to forget individual attributes.
(nautilus_file_forget_activation_uri): Removed as obsolete.
(destroy): use `nautilus_g_list_free_deep' to free the mime list.
* libnautilus-extensions/nautilus-directory-notify.h: Remove
prototype for `nautilus_file_forget_activation_uri'.
* libnautilus-extensions/nautilus-file-private.h: Prototype
`nautilus_file_forget_attributes_internal'.
* libnautilus-extensions/nautilus-file.h:
`nautilus_file_forget_attributes' and
`nautilus_file_forget_all_attributes'.
* libnautilus-extensions/nautilus-link.c
(nautilus_link_local_set_link_uri): Use
`nautilus_file_forget_attributes', not
`nautilus_file_forget_activation_uri' to ensure reload of the
activation URI.
(forget_file_activation_uri): Helper function for the above.
* libnautilus-extensions/nautilus-directory-async.c
(nautilus_directory_cancel_loading_file_attributes): Function to
cancel in-progress I/O for a given set of attributes but only if
it is in progress for the specified file. This function is used to
implement part of `nautilus_file_forget_attributes'.
(cancel_directory_count_for_file, cancel_deep_counts_for_file,
cancel_mime_list_for_file, cancel_top_left_text_for_file,
cancel_file_info_for_file, cancel_activation_uri_for_file): Helper
functions for the above.
(nautilus_directory_force_reload): Add a `file_attributes'
argument and make sure to forget the specified
attributes. Forgetting the attributes fixes bugs 3240 and 4683.
(nautilus_directory_forget_file_attributes): Function to forget
the specified attributes for all files. It makes sure to only
cancel and kick off new I/O once.
(cancel_loading_attributes): helper function for the above that
cancels in-progress loads for the specified attributes, regardless
of for what file.
(request_is_satisfied): The request is not satisfied if the
request calls for top left text and the file lacks it.
(top_left_read_callback): Set 1got_top_left_text' field of the
NautilusFile to TRUE. This problem was masked by the problem with
`request_is_satisfied' fixed above.
(set_up_request_by_file_attributes): Make sure to request the
file_info as well if top left text is requested, since
applicability of top left text depends on the mime type.
(get_info_callback): Mark the file gone if we get
GNOME_VFS_ERROR_NOT_FOUND; we can only get this error for files
gnome-vfs should know about but that do not exist. This is needed
to detect files that are removed on a reload.
* libnautilus-extensions/nautilus-directory-private.h: Update
prototype for `nautilus_directory_force_reload'; Prototype
`nautilus_directory_cancel_loading_file_attributes'
* libnautilus-extensions/nautilus-vfs-directory.c
(vfs_file_monitor_add): Pass the file attributes to
`nautilus_directory_force_reload' since it now wants them.
* src/nautilus-window-manage-views.c
(viewed_file_changed_callback): Cancel location change before
closing the window, since detecting the file is gone is now likely
to happen in the middle of an in-progress reload, and we get
crashes if this is not done.
(nautilus_window_begin_location_change): If we're doing a reload,
forget all file attributes of the NautilusFile for the currently
viewed location. This is to make sure we detect if the file is
gone, and also update the sidebar panel icon and other info
appropriately. This fixes bug 4385.
URL). As Mike Fleming and Pavel suggested, changed NautilusFile to
keep relative URIs around instead of file names. This may also fix
two other Mozilla-component-related bugs, bug 3438 and 4220. I'll
check that later.
Also fix bugs 4128, 4311, and 4344, which are all about a hash
table NULL critical assertion.
* libnautilus-extensions/nautilus-directory-async.c:
(dequeue_pending_idle_callback): Handle info in the order it gets
queued. That requires a call to g_list_reverse since we add things
with g_list_prepend. Check for NULL to handle case where the info
is not part of a directory load. Use the new
nautilus_directory_find_file_by_name to keep it clearly separate
from code that would find files given relative URIs.
* libnautilus-extensions/nautilus-directory-private.h: RIP
nautilus_compare_file_with_name. We haven't used it since we've
been using a hash table.
* libnautilus-extensions/nautilus-directory.c:
(add_to_hash_table): Put the relative URI in the hash table, not
the name.
(extract_from_hash_table): Look up in the hash table by relative
URI, not name.
(nautilus_directory_add_file), (nautilus_directory_remove_file):
Assertions are based on the relative URI, not the name.
(nautilus_directory_find_file_by_name): Turn the name into a
relative URI and search for that.
(nautilus_directory_find_file_by_relative_uri): Look up in the
hash table by relative URI, not name.
* libnautilus-extensions/nautilus-file-private.h: Replace the name
field with a relative_uri field. There aren't always names for
files.
* libnautilus-extensions/nautilus-file.c:
(nautilus_file_new_from_relative_uri): Mechanical changes to make
it create a file given a directory and relative_uri. Uses the new
update_info_and_name instead of the old nautilus_update_file_info
(which no longer updates names).
(nautilus_file_new_from_info). Use the new update_info_and_name
instead of the old nautilus_update_file_info (which no longer
updates names).
(nautilus_file_get_internal): Call nautilus_uri_make_canonical on
the URI before using it. This is needed now to make the escaping
of characters in the relative URI uniform. Also made mechanical
changes to deal with relative URIs instead of file names.
(destroy): Always free the relative URI. We no longer share the
name inside the file info, so the logic is now simpler.
(nautilus_file_get_gnome_vfs_uri): Append the relative URI instead
of appending a file name to make the full URI.
(rename_callback): Use the new update_info_and_name instead of the
old nautilus_update_file_info (which no longer updates
names). Also call nautilus_find_file_by_name under its new name.
(name_is): New helper function for checking the file name quickly
without requiring a local variable.
(nautilus_file_rename): Use name_is instead of strcmp since the
name is no longer so readily available.
(update_info_internal): Moved the guts of nautilus_file_update_info
in here and made the name-updating part optional. Logic is a bit
simpler since we don't share the name in the file info any more.
(update_info_and_name), (nautilus_file_update_info): Covers that
call the internal call with the "update_name" flag set.
(nautilus_file_update_name): Use name_is and update_info_and_name.
Also fix the info == NULL case to handle relative URIs, not names.
(nautilus_file_compare_for_sort): Add a FIXME about using the name
in the info when sorting. Also change the info == NULL case to get
the names with nautilus_file_get_name.
(nautilus_file_compare_name): Use nautilus_file_get_name to get
the names to compare.
(nautilus_file_get_metadata), (nautilus_file_get_metadata_list),
(nautilus_file_set_metadata), (nautilus_file_set_metadata_list),
(nautilus_file_get_boolean_metadata),
(nautilus_file_get_integer_metadata),
(nautilus_file_set_boolean_metadata),
(nautilus_file_set_integer_metadata): Store metadata using the
relative URI as the key instead of the name. This amounts to a
minor metadata file format change.
(nautilus_file_get_name): Create the name by unescaping the
relative URI. If this fails, just return the relative URI
itself. In some cases the URI instead of the name would represent
a terrible error (but the unescaping will not fail in those
cases), but in other cases we just need some kind of name.
(nautilus_file_get_uri): Some broken code in here was just
appending the name to the parent URI. Now it appends the relative
URI so it's no longer broken.
(get_description): Use the relative URI instead of the name in the
warning message.
(nautilus_file_mark_gone): Since we always keep the relative URI
around now, can get rid of the logic that copies the name out of
the file info for this case.
(nautilus_file_dump): Since we already dump the URI, don't bother
dumping the name any more.