diff options
author | Darin Adler <darin@src.gnome.org> | 2000-12-14 23:17:36 +0000 |
---|---|---|
committer | Darin Adler <darin@src.gnome.org> | 2000-12-14 23:17:36 +0000 |
commit | ced5102634eb3d547531b7d800b8ba694c2336f0 (patch) | |
tree | 8bc61a2e06a55631572260d171e5a0fd9e1aff51 /libnautilus-extensions/nautilus-directory.c | |
parent | 7d699bbccc04b34e180ffd6d832f3de0ed5f8b95 (diff) | |
download | nautilus-ced5102634eb3d547531b7d800b8ba694c2336f0.tar.gz |
reviewed by: John Sullivan <sullivan@eazel.com>
Fix bug 2807 (support metadata removal for cases where we
move/delete files) by implementing metadata removal.
Fix bug 2199 (Saved icon positions ruin desktop layout features)
by testing and fixing other bugs now that metadata removal is
implemented.
Fix bug 5164 (exception trying to drag file) by fixing a few
placeholders in XML files that were still transparent and should
not be.
Fix bug where we don't reveal the New Folder icon (reintroduced by
my changes yesterday) by computing the icon position in a way that
works even before the canvas item is updated.
* libnautilus-extensions/nautilus-directory-metafile.c:
(get_file_node): Small change (not used for now) that might
help unify the "before metafile is read" case with the code
after the metafile is read.
(nautilus_directory_rename_file_metadata): Remove the old
file metadata before renaming the new data. Also change code
to avoid looking up things in the hash table twice.
(nautilus_directory_copy_file_metadata): Updated and added
FIXME comments.
(nautilus_directory_remove_file_metadata): Add code to
remove metadata, similar to the existing rename code.
* libnautilus-extensions/nautilus-directory.c:
(nautilus_directory_schedule_metadata_copy),
(nautilus_directory_schedule_metadata_move),
(nautilus_directory_schedule_metadata_remove): Fix code that was
using file names instead of relative URIs (essentially escaped
file names). This code was missed when we made the
switchover. Without this, changes to files with spaces in their
names didn't update metadata properly.
* libnautilus-extensions/nautilus-file-operations.c:
(build_error_string): Added blank line between the intro sentence
and the rest of the error message.
(handle_xfer_overwrite): Added blank line between the intro
sentence and the rest of the error message.
(sync_xfer_callback): Fix metadata code to remove the metadata
when creating a new file, just as it copies metadata when copying
a file. This change helps the New Folder case, but requires a fix
in gnome-vfs to set the top level boolean for the New Folder case.
(handle_new_folder_vfs_error): Added blank line between the intro
sentence and the rest of the error message.
(nautilus_self_check_file_operations): Changed the self-check to
use the standard way of testing functions that return text instead
of rolling its own.
* libnautilus-extensions/nautilus-gnome-extensions.h:
* libnautilus-extensions/nautilus-gnome-extensions.c:
(nautilus_gnome_canvas_item_get_canvas_bounds): Added a function
that's like nautilus_gnome_canvas_item_get_current_canvas_bounds
but is accurate even before the icon is updated.
* libnautilus-extensions/nautilus-icon-container.c: (reveal_icon):
Use nautilus_gnome_canvas_item_get_canvas_bounds instead of
nautilus_gnome_canvas_item_get_current_canvas_bounds. Fixes the
bug I reintroduced where New Folder icons would not be revealed.
* libnautilus-extensions/nautilus-xml-extensions.h:
* libnautilus-extensions/nautilus-xml-extensions.c:
(nautilus_xml_remove_node): Add a remove-node function. This is
needed because gnome-xml doesn't have xmlRemoveNode
implemented. This implementation is not quite complete, but
probably good enough for our purposes. A complete implementation
might have to have some handling for removing the root node and
perhaps some stuff to remove unused namespaces. Maybe this can be
rolled into gnome-xml.
* src/file-manager/nautilus-directory-view-ui.xml:
* src/nautilus-shell-ui.xml:
Added some more delimit="none" entries to make it so that the
actual placeholder definitions are not "transparent".
* libnautilus-extensions/nautilus-glib-extensions.c
(nautilus_self_check_glib_extensions): Marked some strings that
are part of a test translatable since the result might be
different in some locales. Translating the strings to the right
result makes "make check" work properly in that locale.
Diffstat (limited to 'libnautilus-extensions/nautilus-directory.c')
-rw-r--r-- | libnautilus-extensions/nautilus-directory.c | 35 |
1 files changed, 14 insertions, 21 deletions
diff --git a/libnautilus-extensions/nautilus-directory.c b/libnautilus-extensions/nautilus-directory.c index 7f3b9c26f..f60311069 100644 --- a/libnautilus-extensions/nautilus-directory.c +++ b/libnautilus-extensions/nautilus-directory.c @@ -1129,7 +1129,7 @@ nautilus_directory_schedule_metadata_copy (GList *uri_pairs) GList *p; URIPair *pair; NautilusDirectory *source_directory, *destination_directory; - char *source_file_name, *destination_file_name; + const char *source_relative_uri, *destination_relative_uri; for (p = uri_pairs; p != NULL; p = p->next) { pair = (URIPair *) p->data; @@ -1137,16 +1137,13 @@ nautilus_directory_schedule_metadata_copy (GList *uri_pairs) source_directory = get_parent_directory (pair->from_uri); destination_directory = get_parent_directory (pair->to_uri); - source_file_name = nautilus_uri_get_basename (pair->from_uri); - destination_file_name = nautilus_uri_get_basename (pair->to_uri); + source_relative_uri = g_basename (pair->from_uri); + destination_relative_uri = g_basename (pair->to_uri); nautilus_directory_copy_file_metadata (source_directory, - source_file_name, + source_relative_uri, destination_directory, - destination_file_name); - - g_free (destination_file_name); - g_free (source_file_name); + destination_relative_uri); nautilus_directory_unref (source_directory); nautilus_directory_unref (destination_directory); @@ -1159,7 +1156,7 @@ nautilus_directory_schedule_metadata_move (GList *uri_pairs) GList *p; URIPair *pair; NautilusDirectory *source_directory, *destination_directory; - char *source_file_name, *destination_file_name; + const char *source_relative_uri, *destination_relative_uri; for (p = uri_pairs; p != NULL; p = p->next) { pair = (URIPair *) p->data; @@ -1167,18 +1164,15 @@ nautilus_directory_schedule_metadata_move (GList *uri_pairs) source_directory = get_parent_directory (pair->from_uri); destination_directory = get_parent_directory (pair->to_uri); - source_file_name = nautilus_uri_get_basename (pair->from_uri); - destination_file_name = nautilus_uri_get_basename (pair->to_uri); + source_relative_uri = g_basename (pair->from_uri); + destination_relative_uri = g_basename (pair->to_uri); nautilus_directory_copy_file_metadata (source_directory, - source_file_name, + source_relative_uri, destination_directory, - destination_file_name); + destination_relative_uri); nautilus_directory_remove_file_metadata (source_directory, - source_file_name); - - g_free (destination_file_name); - g_free (source_file_name); + source_relative_uri); nautilus_directory_unref (source_directory); nautilus_directory_unref (destination_directory); @@ -1191,18 +1185,17 @@ nautilus_directory_schedule_metadata_remove (GList *uris) GList *p; const char *uri; NautilusDirectory *directory; - char *file_name; + const char *relative_uri; for (p = uris; p != NULL; p = p->next) { uri = (const char *) p->data; directory = get_parent_directory (uri); - file_name = nautilus_uri_get_basename (uri); + relative_uri = g_basename (uri); nautilus_directory_remove_file_metadata (directory, - file_name); + relative_uri); - g_free (file_name); nautilus_directory_unref (directory); } } |