summaryrefslogtreecommitdiff
path: root/libnautilus-private/nautilus-directory-metafile.c
diff options
context:
space:
mode:
authorDarin Adler <darin@src.gnome.org>2000-09-29 00:51:54 +0000
committerDarin Adler <darin@src.gnome.org>2000-09-29 00:51:54 +0000
commit9a30d3b0b0d3cfc2203c1b8bc8f20ff2b0dbad69 (patch)
treeda0002a314f74b8629b61ad6fe9b4b7e09e8da6c /libnautilus-private/nautilus-directory-metafile.c
parent4e182105537e14b66b769b41cf38acbe8d696ebf (diff)
downloadnautilus-9a30d3b0b0d3cfc2203c1b8bc8f20ff2b0dbad69.tar.gz
Fixed renaming bug with names with unusual characters and problems
caused by the clipboard code, and started work on metadata copying and removing implementation and cleanup. * libnautilus-extensions/nautilus-file-operations.c: (nautilus_file_operations_new_folder): Use gnome_vfs_uri_append_file_name instead of gnome_vfs_uri_append_path, since we are appending a file name, not a path in URI format. * libnautilus-extensions/nautilus-file-utilities.c: (nautilus_get_user_main_directory): Use gnome_vfs_uri_append_file_name instead of gnome_vfs_uri_append_path, since we are appending a file name, not a path in URI format. * libnautilus-extensions/nautilus-file.c: (rename_update_info_and_metafile): Use metadata call by new name. (nautilus_file_rename): Use gnome_vfs_uri_append_file_name instead of gnome_vfs_uri_append_path, since we are appending a file name, not a path in URI format. This should fix the renaming problems we were seeing. * libnautilus/nautilus-clipboard.h: * libnautilus/nautilus-clipboard.c: (set_paste_sensitive_if_clipboard_contains_data), (set_clipboard_menu_items_sensitive), (set_clipboard_menu_items_insensitive): Removed unused window parameter. (menu_activated_callback): Changed this function to find the window using gtk_widget_toplevel instead of from a global. This works in all the cases where the old code would have worked, and doesn't have the problem with multiple windows. (menu_deactivated_callback): Removed unused window parameter. (nautilus_clipboard_set_up_editable_from_bonobo_control): Added check for NULL menubar. This shows a design problem too, but at least it (nautilus_clipboard_set_up_host_ui_handler): Got rid of global. * src/nautilus-window.c: (nautilus_window_constructed): Use clipboard call by new name. * libnautilus-extensions/nautilus-directory.c: (nautilus_directory_schedule_metadata_copy), (nautilus_directory_schedule_metadata_move), (nautilus_directory_schedule_metadata_remove), (nautilus_directory_schedule_position_setting): Tighten up these routines a bit and have them do as much work as possible through functions in nautilus-directory-metafile.[ch]. This is preparation for doing full implementation of the actual metadata copying. * libnautilus-extensions/nautilus-directory-metafile.h: * libnautilus-extensions/nautilus-directory-metafile.c: (nautilus_directory_rename_file_metadata), (copy_file_metadata_for_key), (nautilus_directory_copy_file_metadata), (nautilus_directory_remove_file_metadata): New functions to doteh metadata copying, and a new name for an old function. Now I have to actually make them work better. * nautilus.spec.in: Do a "make check" instead of a "make" when building RPMs.
Diffstat (limited to 'libnautilus-private/nautilus-directory-metafile.c')
-rw-r--r--libnautilus-private/nautilus-directory-metafile.c68
1 files changed, 63 insertions, 5 deletions
diff --git a/libnautilus-private/nautilus-directory-metafile.c b/libnautilus-private/nautilus-directory-metafile.c
index 85804a226..1e205e6cd 100644
--- a/libnautilus-private/nautilus-directory-metafile.c
+++ b/libnautilus-private/nautilus-directory-metafile.c
@@ -25,12 +25,13 @@
#include <config.h>
#include "nautilus-directory-metafile.h"
-#include <stdlib.h>
-#include <xmlmemory.h>
-#include "nautilus-string.h"
+#include "nautilus-directory-private.h"
#include "nautilus-glib-extensions.h"
+#include "nautilus-metadata.h"
+#include "nautilus-string.h"
#include "nautilus-xml-extensions.h"
-#include "nautilus-directory-private.h"
+#include <stdlib.h>
+#include <xmlmemory.h>
#define METAFILE_XML_VERSION "1.0"
@@ -736,7 +737,7 @@ nautilus_directory_set_file_metadata_list (NautilusDirectory *directory,
}
void
-nautilus_directory_update_file_metadata (NautilusDirectory *directory,
+nautilus_directory_rename_file_metadata (NautilusDirectory *directory,
const char *old_file_name,
const char *new_file_name)
{
@@ -915,3 +916,60 @@ nautilus_directory_set_integer_metadata (NautilusDirectory *directory,
g_free (value_as_string);
g_free (default_as_string);
}
+
+static void
+copy_file_metadata_for_key (NautilusDirectory *source_directory,
+ const char *source_file_name,
+ NautilusDirectory *destination_directory,
+ const char *destination_file_name,
+ const char *key)
+{
+ char *data;
+
+ data = nautilus_directory_get_file_metadata
+ (source_directory, source_file_name,
+ key, NULL);
+ nautilus_directory_set_file_metadata
+ (destination_directory, destination_file_name,
+ key, NULL, data);
+ g_free (data);
+}
+
+void
+nautilus_directory_copy_file_metadata (NautilusDirectory *source_directory,
+ const char *source_file_name,
+ NautilusDirectory *destination_directory,
+ const char *destination_file_name)
+{
+ /* FIXME bugzilla.eazel.com 2808: This hard-coded set of keys is not right. */
+ /* FIXME bugzilla.eazel.com 3343: This does nothing to ensure
+ * the source directory metadata is read in.
+ */
+ copy_file_metadata_for_key
+ (source_directory, source_file_name,
+ destination_directory, destination_file_name,
+ NAUTILUS_METADATA_KEY_NOTES);
+ copy_file_metadata_for_key
+ (source_directory, source_file_name,
+ destination_directory, destination_file_name,
+ NAUTILUS_METADATA_KEY_ICON_SCALE);
+ copy_file_metadata_for_key
+ (source_directory, source_file_name,
+ destination_directory, destination_file_name,
+ NAUTILUS_METADATA_KEY_ICON_POSITION);
+ copy_file_metadata_for_key
+ (source_directory, source_file_name,
+ destination_directory, destination_file_name,
+ NAUTILUS_METADATA_KEY_ANNOTATION);
+ copy_file_metadata_for_key
+ (source_directory, source_file_name,
+ destination_directory, destination_file_name,
+ NAUTILUS_METADATA_KEY_CUSTOM_ICON);
+}
+
+void
+nautilus_directory_remove_file_metadata (NautilusDirectory *directory,
+ const char *file_name)
+{
+ /* FIXME bugzilla.eazel.com 2807: This is not implemented. */
+}