Commit 957f93fd authored by Cosimo Cecchi's avatar Cosimo Cecchi Committed by Cosimo Cecchi

Add new APIs for extensions to NautilusFileInfo (can_write, get_mount and

2008-04-04  Cosimo Cecchi  <cosimoc@gnome.org>

	* libnautilus-extension/nautilus-file-info.c:
	(nautilus_file_info_get_parent_info),
	(nautilus_file_info_get_mount), (nautilus_file_info_can_write):
	* libnautilus-extension/nautilus-file-info.h:
	* libnautilus-private/nautilus-file.c:
	(nautilus_file_info_iface_init):
	Add new APIs for extensions to NautilusFileInfo (can_write, get_mount
	and get_parent_info). (#521612).

svn path=/trunk/; revision=14036
parent 00a42fe8
2008-04-04 Cosimo Cecchi <cosimoc@gnome.org>
* libnautilus-extension/nautilus-file-info.c:
(nautilus_file_info_get_parent_info),
(nautilus_file_info_get_mount), (nautilus_file_info_can_write):
* libnautilus-extension/nautilus-file-info.h:
* libnautilus-private/nautilus-file.c:
(nautilus_file_info_iface_init):
Add new APIs for extensions to NautilusFileInfo (can_write, get_mount
and get_parent_info). (#521612).
2008-04-04 Christian Neumair <cneumair@gnome.org>
* libnautilus-private/nautilus-file-operations.c (volume_mount_cb),
......
......@@ -152,6 +152,24 @@ nautilus_file_info_get_parent_uri (NautilusFileInfo *file)
return NAUTILUS_FILE_INFO_GET_IFACE (file)->get_parent_uri (file);
}
NautilusFileInfo *
nautilus_file_info_get_parent_info (NautilusFileInfo *file)
{
g_return_val_if_fail (NAUTILUS_IS_FILE_INFO (file), NULL);
g_return_val_if_fail (NAUTILUS_FILE_INFO_GET_IFACE (file)->get_parent_info != NULL, NULL);
return NAUTILUS_FILE_INFO_GET_IFACE (file)->get_parent_info (file);
}
GMount *
nautilus_file_info_get_mount (NautilusFileInfo *file)
{
g_return_val_if_fail (NAUTILUS_IS_FILE_INFO (file), NULL);
g_return_val_if_fail (NAUTILUS_FILE_INFO_GET_IFACE (file)->get_mount != NULL, NULL);
return NAUTILUS_FILE_INFO_GET_IFACE (file)->get_mount (file);
}
char *
nautilus_file_info_get_uri_scheme (NautilusFileInfo *file)
{
......@@ -191,6 +209,15 @@ nautilus_file_info_is_directory (NautilusFileInfo *file)
return NAUTILUS_FILE_INFO_GET_IFACE (file)->is_directory (file);
}
gboolean
nautilus_file_info_can_write (NautilusFileInfo *file)
{
g_return_val_if_fail (NAUTILUS_IS_FILE_INFO (file), FALSE);
g_return_val_if_fail (NAUTILUS_FILE_INFO_GET_IFACE (file)->can_write != NULL, FALSE);
return NAUTILUS_FILE_INFO_GET_IFACE (file)->can_write (file);
}
void
nautilus_file_info_add_emblem (NautilusFileInfo *file,
const char *emblem_name)
......
......@@ -78,6 +78,9 @@ struct _NautilusFileInfoIface
GFileType (*get_file_type) (NautilusFileInfo *file);
GFile * (*get_location) (NautilusFileInfo *file);
GFile * (*get_parent_location) (NautilusFileInfo *file);
NautilusFileInfo* (*get_parent_info) (NautilusFileInfo *file);
GMount * (*get_mount) (NautilusFileInfo *file);
gboolean (*can_write) (NautilusFileInfo *file);
};
......@@ -96,13 +99,19 @@ char * nautilus_file_info_get_uri (NautilusFileInfo *fil
char * nautilus_file_info_get_activation_uri (NautilusFileInfo *file);
GFile * nautilus_file_info_get_parent_location (NautilusFileInfo *file);
char * nautilus_file_info_get_parent_uri (NautilusFileInfo *file);
GMount * nautilus_file_info_get_mount (NautilusFileInfo *file);
char * nautilus_file_info_get_uri_scheme (NautilusFileInfo *file);
/* It's not safe to call this recursively multiple times, as it works
* only for files already cached by Nautilus.
*/
NautilusFileInfo* nautilus_file_info_get_parent_info (NautilusFileInfo *file);
/* File Type */
char * nautilus_file_info_get_mime_type (NautilusFileInfo *file);
gboolean nautilus_file_info_is_mime_type (NautilusFileInfo *file,
const char *mime_type);
gboolean nautilus_file_info_is_directory (NautilusFileInfo *file);
gboolean nautilus_file_info_can_write (NautilusFileInfo *file);
/* Modifying the NautilusFileInfo */
......
......@@ -7036,11 +7036,14 @@ nautilus_file_info_iface_init (NautilusFileInfoIface *iface)
iface->get_uri = nautilus_file_get_uri;
iface->get_parent_location = nautilus_file_get_parent_location;
iface->get_parent_uri = nautilus_file_get_parent_uri;
iface->get_parent_info = nautilus_file_get_parent;
iface->get_mount = nautilus_file_get_mount;
iface->get_uri_scheme = nautilus_file_get_uri_scheme;
iface->get_activation_uri = nautilus_file_get_activation_uri;
iface->get_mime_type = nautilus_file_get_mime_type;
iface->is_mime_type = nautilus_file_is_mime_type;
iface->is_directory = nautilus_file_is_directory;
iface->can_write = nautilus_file_can_write;
iface->add_emblem = nautilus_file_add_emblem;
iface->get_string_attribute = nautilus_file_get_string_attribute;
iface->add_string_attribute = nautilus_file_add_string_attribute;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment