Commit 2840365b authored by Darin Adler's avatar Darin Adler

Changed to do both rename and set permissions with an interface that will

	* libnautilus-extensions/nautilus-file.h:
	* libnautilus-extensions/nautilus-file.c: (nautilus_file_rename):
	(nautilus_file_set_permissions): Changed to do both rename and set
	permissions with an interface that will work for async. Also
	improved the handling of deleted files, empty-string names, and
	files you can't change permissions on: they are considering
	runtime errors instead of coding mistakes now. Also send out
	file_changed even if the call fails.

	* src/file-manager/fm-error-reporting.h:
	* src/file-manager/fm-error-reporting.c: (show_error_message_box),
	(fm_report_error_renaming_file),
	(fm_report_error_setting_permissions): Simplified interface to
	these calls. Now we don't require the caller to pass anything we
	can compute ourselves and you can call these with GNOME_VFS_OK
	and they will do nothing. Also merged common code to put up the
	error message box into a helper function.

	* src/file-manager/fm-icon-view.c: (rename_callback),
	(fm_icon_view_icon_text_changed_callback):
	* src/file-manager/fm-properties-window.c: (rename_callback),
	(name_field_done_editing), (permission_change_callback),
	(permissions_check_button_toggled):
	Updated callers to use the new calls.
parent fb95e9b2
2000-05-10 Darin Adler <darin@eazel.com>
* libnautilus-extensions/nautilus-file.h:
* libnautilus-extensions/nautilus-file.c: (nautilus_file_rename):
(nautilus_file_set_permissions): Changed to do both rename and set
permissions with an interface that will work for async. Also
improved the handling of deleted files, empty-string names, and
files you can't change permissions on: they are considering
runtime errors instead of coding mistakes now. Also send out
file_changed even if the call fails.
* src/file-manager/fm-error-reporting.h:
* src/file-manager/fm-error-reporting.c: (show_error_message_box),
(fm_report_error_renaming_file),
(fm_report_error_setting_permissions): Simplified interface to
these calls. Now we don't require the caller to pass anything we
can compute ourselves and you can call these with GNOME_VFS_OK
and they will do nothing. Also merged common code to put up the
error message box into a helper function.
* src/file-manager/fm-icon-view.c: (rename_callback),
(fm_icon_view_icon_text_changed_callback):
* src/file-manager/fm-properties-window.c: (rename_callback),
(name_field_done_editing), (permission_change_callback),
(permissions_check_button_toggled):
Updated callers to use the new calls.
2000-05-10 Darin Adler <darin@eazel.com>
* fm-icon-view.c: (update_layout_menus), (sort_callback),
......
......@@ -460,8 +460,11 @@ nautilus_file_can_rename (NautilusFile *file)
return result;
}
GnomeVFSResult
nautilus_file_rename (NautilusFile *file, const char *new_name)
void
nautilus_file_rename (NautilusFile *file,
const char *new_name,
NautilusFileOperationCallback callback,
gpointer callback_data)
{
GnomeVFSURI *new_uri;
char *old_uri_text;
......@@ -469,22 +472,28 @@ nautilus_file_rename (NautilusFile *file, const char *new_name)
GnomeVFSResult result;
xmlNode *file_node;
g_return_val_if_fail (NAUTILUS_IS_FILE (file), GNOME_VFS_ERROR_BADPARAMS);
g_return_val_if_fail (!nautilus_file_is_gone (file), GNOME_VFS_ERROR_BADPARAMS);
g_return_val_if_fail (nautilus_strlen (new_name) > 0, GNOME_VFS_ERROR_BADPARAMS);
g_return_if_fail (NAUTILUS_IS_FILE (file));
g_return_if_fail (new_name != NULL);
g_return_if_fail (callback != NULL);
/* Can't rename a file that's already gone. */
if (nautilus_file_is_gone (file)) {
(* callback) (file, GNOME_VFS_ERROR_NOTFOUND, callback_data);
return;
}
/* Test the name-hasn't-changed case explicitly, for two reasons.
* (1) gnome_vfs_move returns an error if new & old are same.
* (2) We don't want to send file-changed signal if nothing changed.
*/
if (strcmp (new_name, file->details->info->name) == 0) {
return GNOME_VFS_OK;
(* callback) (file, GNOME_VFS_OK, callback_data);
return;
}
old_uri_text = nautilus_file_get_uri (file);
new_uri = gnome_vfs_uri_append_path (file->details->directory->details->uri,
new_name);
new_uri = gnome_vfs_uri_append_path
(file->details->directory->details->uri, new_name);
new_uri_text = gnome_vfs_uri_to_string (new_uri, GNOME_VFS_URI_HIDE_NONE);
gnome_vfs_uri_unref (new_uri);
......@@ -509,14 +518,18 @@ nautilus_file_rename (NautilusFile *file, const char *new_name)
*/
g_free (file->details->info->name);
file->details->info->name = g_strdup (new_name);
nautilus_file_changed (file);
}
g_free (old_uri_text);
g_free (new_uri_text);
return result;
/* Claim that something changed even if the rename failed.
* This makes it easier for some clients who see the "reverting"
* to the old name as "changing back".
*/
nautilus_file_changed (file);
(* callback) (file, result, callback_data);
}
gboolean
......@@ -1214,18 +1227,19 @@ nautilus_file_get_permissions (NautilusFile *file) {
* trying to change the file's permissions.
*
**/
GnomeVFSResult
void
nautilus_file_set_permissions (NautilusFile *file,
GnomeVFSFilePermissions new_permissions) {
GnomeVFSFilePermissions new_permissions,
NautilusFileOperationCallback callback,
gpointer callback_data)
{
GnomeVFSResult result;
GnomeVFSFileInfo *partial_file_info;
char *uri;
g_return_val_if_fail (nautilus_file_can_set_permissions (file),
GNOME_VFS_ERROR_ACCESSDENIED);
if (new_permissions == file->details->info->permissions) {
return GNOME_VFS_OK;
(* callback) (file, GNOME_VFS_OK, callback_data);
return;
}
/* Change the file-on-disk permissions. */
......@@ -1240,10 +1254,15 @@ nautilus_file_set_permissions (NautilusFile *file,
/* Update the permissions in our NautilusFile object. */
if (result == GNOME_VFS_OK) {
file->details->info->permissions = new_permissions;
nautilus_file_changed (file);
}
return result;
/* Claim that something changed even if the permission change failed.
* This makes it easier for some clients who see the "reverting"
* to the old permissions as "changing back".
*/
nautilus_file_changed (file);
(* callback) (file, result, callback_data);
}
/**
......
......@@ -60,131 +60,145 @@ typedef enum {
NAUTILUS_FILE_SORT_BY_EMBLEMS
} NautilusFileSortType;
typedef void (*NautilusFileCallback) (NautilusFile *file,
gpointer callback_data);
typedef void (*NautilusFileCallback) (NautilusFile *file,
gpointer callback_data);
typedef void (*NautilusFileOperationCallback) (NautilusFile *file,
GnomeVFSResult result,
gpointer callback_data);
/* GtkObject requirements. */
GtkType nautilus_file_get_type (void);
GtkType nautilus_file_get_type (void);
/* Getting at a single file. */
NautilusFile * nautilus_file_get (const char *uri);
NautilusFile * nautilus_file_get (const char *uri);
/* Basic operations on file objects. */
NautilusFile * nautilus_file_ref (NautilusFile *file);
void nautilus_file_unref (NautilusFile *file);
void nautilus_file_delete (NautilusFile *file);
NautilusFile * nautilus_file_ref (NautilusFile *file);
void nautilus_file_unref (NautilusFile *file);
void nautilus_file_delete (NautilusFile *file);
/* Monitor the file. */
void nautilus_file_monitor_add (NautilusFile *file,
gconstpointer client,
GList *attributes,
GList *metadata_keys);
void nautilus_file_monitor_remove (NautilusFile *file,
gconstpointer client);
void nautilus_file_monitor_add (NautilusFile *file,
gconstpointer client,
GList *attributes,
GList *metadata_keys);
void nautilus_file_monitor_remove (NautilusFile *file,
gconstpointer client);
/* Waiting for data that's read asynchronously.
* This interface currently works only for metadata, but could be expanded
* to other attributes as well.
*/
void nautilus_file_call_when_ready (NautilusFile *file,
GList *attributes,
GList *metadata_keys,
NautilusFileCallback callback,
gpointer callback_data);
void nautilus_file_cancel_callback (NautilusFile *file,
NautilusFileCallback callback,
gpointer callback_data);
void nautilus_file_call_when_ready (NautilusFile *file,
GList *attributes,
GList *metadata_keys,
NautilusFileCallback callback,
gpointer callback_data);
void nautilus_file_cancel_callback (NautilusFile *file,
NautilusFileCallback callback,
gpointer callback_data);
/* Basic attributes for file objects. */
char * nautilus_file_get_name (NautilusFile *file);
char * nautilus_file_get_uri (NautilusFile *file);
char * nautilus_file_get_mapped_uri (NautilusFile *file);
GnomeVFSFileSize nautilus_file_get_size (NautilusFile *file);
GnomeVFSFileType nautilus_file_get_file_type (NautilusFile *file);
char * nautilus_file_get_mime_type (NautilusFile *file);
gboolean nautilus_file_is_mime_type (NautilusFile *file,
const char *mime_type);
gboolean nautilus_file_is_symbolic_link (NautilusFile *file);
gboolean nautilus_file_is_executable (NautilusFile *file);
gboolean nautilus_file_is_directory (NautilusFile *file);
gboolean nautilus_file_get_directory_item_count (NautilusFile *file,
guint *count,
gboolean *count_unreadable);
GList * nautilus_file_get_keywords (NautilusFile *file);
void nautilus_file_set_keywords (NautilusFile *file,
GList *keywords);
GList * nautilus_file_get_emblem_names (NautilusFile *file);
char * nautilus_file_get_top_left_text (NautilusFile *file);
char * nautilus_file_get_name (NautilusFile *file);
char * nautilus_file_get_uri (NautilusFile *file);
char * nautilus_file_get_mapped_uri (NautilusFile *file);
GnomeVFSFileSize nautilus_file_get_size (NautilusFile *file);
GnomeVFSFileType nautilus_file_get_file_type (NautilusFile *file);
char * nautilus_file_get_mime_type (NautilusFile *file);
gboolean nautilus_file_is_mime_type (NautilusFile *file,
const char *mime_type);
gboolean nautilus_file_is_symbolic_link (NautilusFile *file);
gboolean nautilus_file_is_executable (NautilusFile *file);
gboolean nautilus_file_is_directory (NautilusFile *file);
gboolean nautilus_file_get_directory_item_count (NautilusFile *file,
guint *count,
gboolean *count_unreadable);
GList * nautilus_file_get_keywords (NautilusFile *file);
void nautilus_file_set_keywords (NautilusFile *file,
GList *keywords);
GList * nautilus_file_get_emblem_names (NautilusFile *file);
char * nautilus_file_get_top_left_text (NautilusFile *file);
/* Permissions. */
gboolean nautilus_file_can_get_permissions (NautilusFile *file);
gboolean nautilus_file_can_set_permissions (NautilusFile *file);
GnomeVFSFilePermissions nautilus_file_get_permissions (NautilusFile *file);
GnomeVFSResult nautilus_file_set_permissions (NautilusFile *file,
GnomeVFSFilePermissions permissions);
gboolean nautilus_file_can_get_permissions (NautilusFile *file);
gboolean nautilus_file_can_set_permissions (NautilusFile *file);
GnomeVFSFilePermissions nautilus_file_get_permissions (NautilusFile *file);
/* "Capabilities". */
gboolean nautilus_file_can_read (NautilusFile *file);
gboolean nautilus_file_can_write (NautilusFile *file);
gboolean nautilus_file_can_execute (NautilusFile *file);
gboolean nautilus_file_can_rename (NautilusFile *file);
/* Basic operations for file objects. */
gboolean nautilus_file_can_read (NautilusFile *file);
gboolean nautilus_file_can_write (NautilusFile *file);
gboolean nautilus_file_can_execute (NautilusFile *file);
gboolean nautilus_file_can_rename (NautilusFile *file);
GnomeVFSResult nautilus_file_rename (NautilusFile *file,
const char *new_name);
void nautilus_file_set_permissions (NautilusFile *file,
GnomeVFSFilePermissions permissions,
NautilusFileOperationCallback callback,
gpointer callback_data);
void nautilus_file_rename (NautilusFile *file,
const char *new_name,
NautilusFileOperationCallback callback,
gpointer callback_data);
gboolean nautilus_file_is_rename_in_progress (NautilusFile *file,
char **old_name,
char **new_name);
void nautilus_file_cancel (NautilusFileOperationCallback callback,
gpointer callback_data);
/* Return true if this file has already been deleted.
This object will be unref'd after sending the files_removed signal,
but it could hang around longer if someone ref'd it.
*/
gboolean nautilus_file_is_gone (NautilusFile *file);
* This object will be unref'd after sending the files_removed signal,
* but it could hang around longer if someone ref'd it.
*/
gboolean nautilus_file_is_gone (NautilusFile *file);
/* Simple getting and setting top-level metadata. */
char * nautilus_file_get_metadata (NautilusFile *file,
const char *key,
const char *default_metadata);
GList * nautilus_file_get_metadata_list (NautilusFile *file,
const char *list_key,
const char *list_subkey,
GList *default_metadata_list);
void nautilus_file_set_metadata (NautilusFile *file,
const char *key,
const char *default_metadata,
const char *metadata);
char * nautilus_file_get_metadata (NautilusFile *file,
const char *key,
const char *default_metadata);
GList * nautilus_file_get_metadata_list (NautilusFile *file,
const char *list_key,
const char *list_subkey,
GList *default_metadata_list);
void nautilus_file_set_metadata (NautilusFile *file,
const char *key,
const char *default_metadata,
const char *metadata);
/* Attributes for file objects as user-displayable strings. */
char * nautilus_file_get_string_attribute (NautilusFile *file,
const char *attribute_name);
char * nautilus_file_get_string_attribute (NautilusFile *file,
const char *attribute_name);
/* Matching with another URI. */
gboolean nautilus_file_matches_uri (NautilusFile *file,
const char *uri);
gboolean nautilus_file_matches_uri (NautilusFile *file,
const char *uri);
/* 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 new state.
*/
gboolean nautilus_file_update (NautilusFile *file,
GnomeVFSFileInfo *info);
gboolean nautilus_file_update (NautilusFile *file,
GnomeVFSFileInfo *info);
/* Comparing two file objects for sorting */
int nautilus_file_compare_for_sort (NautilusFile *file_1,
NautilusFile *file_2,
NautilusFileSortType sort_type);
int nautilus_file_compare_for_sort_reversed (NautilusFile *file_1,
NautilusFile *file_2,
NautilusFileSortType sort_type);
int nautilus_file_compare_for_sort (NautilusFile *file_1,
NautilusFile *file_2,
NautilusFileSortType sort_type);
int nautilus_file_compare_for_sort_reversed (NautilusFile *file_1,
NautilusFile *file_2,
NautilusFileSortType sort_type);
/* Change notification hack.
* This is called when code modifies the file and it needs to trigger
* a notification. Eventually this should become private, but for now
* it needs to be used for code like the thumbnail generation.
*/
void nautilus_file_changed (NautilusFile *file);
void nautilus_file_changed (NautilusFile *file);
/* Convenience functions for dealing with a list of NautilusFile objects that each have a ref. */
GList * nautilus_file_list_ref (GList *file_list);
void nautilus_file_list_unref (GList *file_list);
void nautilus_file_list_free (GList *file_list);
GList * nautilus_file_list_copy (GList *file_list);
GList * nautilus_file_list_ref (GList *file_list);
void nautilus_file_list_unref (GList *file_list);
void nautilus_file_list_free (GList *file_list);
GList * nautilus_file_list_copy (GList *file_list);
typedef struct NautilusFileDetails NautilusFileDetails;
......
......@@ -460,8 +460,11 @@ nautilus_file_can_rename (NautilusFile *file)
return result;
}
GnomeVFSResult
nautilus_file_rename (NautilusFile *file, const char *new_name)
void
nautilus_file_rename (NautilusFile *file,
const char *new_name,
NautilusFileOperationCallback callback,
gpointer callback_data)
{
GnomeVFSURI *new_uri;
char *old_uri_text;
......@@ -469,22 +472,28 @@ nautilus_file_rename (NautilusFile *file, const char *new_name)
GnomeVFSResult result;
xmlNode *file_node;
g_return_val_if_fail (NAUTILUS_IS_FILE (file), GNOME_VFS_ERROR_BADPARAMS);
g_return_val_if_fail (!nautilus_file_is_gone (file), GNOME_VFS_ERROR_BADPARAMS);
g_return_val_if_fail (nautilus_strlen (new_name) > 0, GNOME_VFS_ERROR_BADPARAMS);
g_return_if_fail (NAUTILUS_IS_FILE (file));
g_return_if_fail (new_name != NULL);
g_return_if_fail (callback != NULL);
/* Can't rename a file that's already gone. */
if (nautilus_file_is_gone (file)) {
(* callback) (file, GNOME_VFS_ERROR_NOTFOUND, callback_data);
return;
}
/* Test the name-hasn't-changed case explicitly, for two reasons.
* (1) gnome_vfs_move returns an error if new & old are same.
* (2) We don't want to send file-changed signal if nothing changed.
*/
if (strcmp (new_name, file->details->info->name) == 0) {
return GNOME_VFS_OK;
(* callback) (file, GNOME_VFS_OK, callback_data);
return;
}
old_uri_text = nautilus_file_get_uri (file);
new_uri = gnome_vfs_uri_append_path (file->details->directory->details->uri,
new_name);
new_uri = gnome_vfs_uri_append_path
(file->details->directory->details->uri, new_name);
new_uri_text = gnome_vfs_uri_to_string (new_uri, GNOME_VFS_URI_HIDE_NONE);
gnome_vfs_uri_unref (new_uri);
......@@ -509,14 +518,18 @@ nautilus_file_rename (NautilusFile *file, const char *new_name)
*/
g_free (file->details->info->name);
file->details->info->name = g_strdup (new_name);
nautilus_file_changed (file);
}
g_free (old_uri_text);
g_free (new_uri_text);
return result;
/* Claim that something changed even if the rename failed.
* This makes it easier for some clients who see the "reverting"
* to the old name as "changing back".
*/
nautilus_file_changed (file);
(* callback) (file, result, callback_data);
}
gboolean
......@@ -1214,18 +1227,19 @@ nautilus_file_get_permissions (NautilusFile *file) {
* trying to change the file's permissions.
*
**/
GnomeVFSResult
void
nautilus_file_set_permissions (NautilusFile *file,
GnomeVFSFilePermissions new_permissions) {
GnomeVFSFilePermissions new_permissions,
NautilusFileOperationCallback callback,
gpointer callback_data)
{
GnomeVFSResult result;
GnomeVFSFileInfo *partial_file_info;
char *uri;
g_return_val_if_fail (nautilus_file_can_set_permissions (file),
GNOME_VFS_ERROR_ACCESSDENIED);
if (new_permissions == file->details->info->permissions) {
return GNOME_VFS_OK;
(* callback) (file, GNOME_VFS_OK, callback_data);
return;
}
/* Change the file-on-disk permissions. */
......@@ -1240,10 +1254,15 @@ nautilus_file_set_permissions (NautilusFile *file,
/* Update the permissions in our NautilusFile object. */
if (result == GNOME_VFS_OK) {
file->details->info->permissions = new_permissions;
nautilus_file_changed (file);
}
return result;
/* Claim that something changed even if the permission change failed.
* This makes it easier for some clients who see the "reverting"
* to the old permissions as "changing back".
*/
nautilus_file_changed (file);
(* callback) (file, result, callback_data);
}
/**
......
......@@ -60,131 +60,145 @@ typedef enum {
NAUTILUS_FILE_SORT_BY_EMBLEMS
} NautilusFileSortType;
typedef void (*NautilusFileCallback) (NautilusFile *file,
gpointer callback_data);
typedef void (*NautilusFileCallback) (NautilusFile *file,
gpointer callback_data);
typedef void (*NautilusFileOperationCallback) (NautilusFile *file,
GnomeVFSResult result,
gpointer callback_data);
/* GtkObject requirements. */
GtkType nautilus_file_get_type (void);
GtkType nautilus_file_get_type (void);
/* Getting at a single file. */
NautilusFile * nautilus_file_get (const char *uri);
NautilusFile * nautilus_file_get (const char *uri);
/* Basic operations on file objects. */
NautilusFile * nautilus_file_ref (NautilusFile *file);
void nautilus_file_unref (NautilusFile *file);
void nautilus_file_delete (NautilusFile *file);
NautilusFile * nautilus_file_ref (NautilusFile *file);
void nautilus_file_unref (NautilusFile *file);
void nautilus_file_delete (NautilusFile *file);
/* Monitor the file. */
void nautilus_file_monitor_add (NautilusFile *file,
gconstpointer client,
GList *attributes,
GList *metadata_keys);
void nautilus_file_monitor_remove (NautilusFile *file,
gconstpointer client);
void nautilus_file_monitor_add (NautilusFile *file,
gconstpointer client,
GList *attributes,
GList *metadata_keys);
void nautilus_file_monitor_remove (NautilusFile *file,
gconstpointer client);
/* Waiting for data that's read asynchronously.
* This interface currently works only for metadata, but could be expanded
* to other attributes as well.
*/
void nautilus_file_call_when_ready (NautilusFile *file,
GList *attributes,
GList *metadata_keys,
NautilusFileCallback callback,
gpointer callback_data);
void nautilus_file_cancel_callback (NautilusFile *file,
NautilusFileCallback callback,
gpointer callback_data);
void nautilus_file_call_when_ready (NautilusFile *file,
GList *attributes,
GList *metadata_keys,
NautilusFileCallback callback,
gpointer callback_data);
void nautilus_file_cancel_callback (NautilusFile *file,
NautilusFileCallback callback,
gpointer callback_data);
/* Basic attributes for file objects. */
char * nautilus_file_get_name (NautilusFile *file);
char * nautilus_file_get_uri (NautilusFile *file);
char * nautilus_file_get_mapped_uri (NautilusFile *file);
GnomeVFSFileSize nautilus_file_get_size (NautilusFile *file);
GnomeVFSFileType nautilus_file_get_file_type (NautilusFile *file);
char * nautilus_file_get_mime_type (NautilusFile *file);
gboolean nautilus_file_is_mime_type (NautilusFile *file,
const char *mime_type);
gboolean nautilus_file_is_symbolic_link (NautilusFile *file);
gboolean nautilus_file_is_executable (NautilusFile *file);
gboolean nautilus_file_is_directory (NautilusFile *file);
gboolean nautilus_file_get_directory_item_count (NautilusFile *file,
guint *count,
gboolean *count_unreadable);
GList * nautilus_file_get_keywords (NautilusFile *file);
void nautilus_file_set_keywords (NautilusFile *file,
GList *keywords);
GList * nautilus_file_get_emblem_names (NautilusFile *file);
char * nautilus_file_get_top_left_text (NautilusFile *file);
char * nautilus_file_get_name (NautilusFile *file);
char * nautilus_file_get_uri (NautilusFile *file);
char * nautilus_file_get_mapped_uri (NautilusFile *file);
GnomeVFSFileSize nautilus_file_get_size (NautilusFile *file);
GnomeVFSFileType nautilus_file_get_file_type (NautilusFile *file);
char * nautilus_file_get_mime_type (NautilusFile *file);
gboolean nautilus_file_is_mime_type (NautilusFile *file,
const char *mime_type);
gboolean nautilus_file_is_symbolic_link (NautilusFile *file);
gboolean nautilus_file_is_executable (NautilusFile *file);
gboolean nautilus_file_is_directory (NautilusFile *file);
gboolean nautilus_file_get_directory_item_count (NautilusFile *file,
guint *count,
gboolean *count_unreadable);
GList * nautilus_file_get_keywords (NautilusFile *file);
void nautilus_file_set_keywords (NautilusFile *file,
GList *keywords);
GList * nautilus_file_get_emblem_names (NautilusFile *file);
char * nautilus_file_get_top_left_text (NautilusFile *file);
/* Permissions. */
gboolean nautilus_file_can_get_permissions (NautilusFile *file);
gboolean nautilus_file_can_set_permissions (NautilusFile *file);
GnomeVFSFilePermissions nautilus_file_get_permissions (NautilusFile *file);
GnomeVFSResult nautilus_file_set_permissions (NautilusFile *file,
GnomeVFSFilePermissions permissions);
gboolean nautilus_file_can_get_permissions (NautilusFile *file);
gboolean nautilus_file_can_set_permissions (NautilusFile *file);
GnomeVFSFilePermissions nautilus_file_get_permissions (NautilusFile *file);
/* "Capabilities". */
gboolean nautilus_file_can_read (NautilusFile *file);
gboolean nautilus_file_can_write (NautilusFile *file);
gboolean nautilus_file_can_execute (NautilusFile *file);
gboolean nautilus_file_can_rename (NautilusFile *file);
/* Basic operations for file objects. */
gboolean nautilus_file_can_read (NautilusFile *file);
gboolean nautilus_file_can_write (NautilusFile *file);
gboolean nautilus_file_can_execute (NautilusFile *file);
gboolean nautilus_file_can_rename (NautilusFile *file);
GnomeVFSResult nautilus_file_rename (NautilusFile *file,
const char *new_name);
void nautilus_file_set_permissions (NautilusFile *file,
GnomeVFSFilePermissions permissions,
NautilusFileOperationCallback callback,
gpointer callback_data);
void nautilus_file_rename (NautilusFile *file,
const char *new_name,
NautilusFileOperationCallback callback,
gpointer callback_data);
gboolean nautilus_file_is_rename_in_progress (NautilusFile *file,
char **old_name,
char **new_name);
void nautilus_file_cancel (NautilusFileOperationCallback callback,
gpointer callback_data);
/* Return true if this file has already been deleted.
This object will be unref'd after sending the files_removed signal,
but it could hang around longer if someone ref'd it.
*/
gboolean nautilus_file_is_gone (NautilusFile *file);
* This object will be unref'd after sending the files_removed signal,
* but it could hang around longer if someone ref'd it.
*/
gboolean nautilus_file_is_gone (NautilusFile *file);
/* Simple getting and setting top-level metadata. */
char * nautilus_file_get_metadata (NautilusFile *file,
const char *key,
const char *default_metadata);
GList * nautilus_file_get_metadata_list (NautilusFile *file,
const char *list_key,
const char *list_subkey,
<