summaryrefslogtreecommitdiff
path: root/libnautilus-extension
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2005-10-03 13:44:48 +0000
committerAlexander Larsson <alexl@src.gnome.org>2005-10-03 13:44:48 +0000
commit63b1cb172c1d3fa463bdc705d3222e5f33216b92 (patch)
tree989e1c2d95c1c07036cc1ca1b839cccd5d9bd595 /libnautilus-extension
parentd4012bb003eb1d274d4160916e9734135df478c3 (diff)
downloadnautilus-63b1cb172c1d3fa463bdc705d3222e5f33216b92.tar.gz
Add new functions for extensions: nautilus_file_info_has_volume,
2005-10-03 Alexander Larsson <alexl@redhat.com> * libnautilus-extension/nautilus-file-info.c: * libnautilus-extension/nautilus-file-info.h: * libnautilus-private/nautilus-file.c: Add new functions for extensions: nautilus_file_info_has_volume, nautilus_file_info_has_drive, nautilus_file_info_get_volume, nautilus_file_info_get_drive Patch from Trevor Davenport
Diffstat (limited to 'libnautilus-extension')
-rw-r--r--libnautilus-extension/nautilus-file-info.c36
-rw-r--r--libnautilus-extension/nautilus-file-info.h12
2 files changed, 48 insertions, 0 deletions
diff --git a/libnautilus-extension/nautilus-file-info.c b/libnautilus-extension/nautilus-file-info.c
index bbc446611..7cad31f31 100644
--- a/libnautilus-extension/nautilus-file-info.c
+++ b/libnautilus-extension/nautilus-file-info.c
@@ -209,3 +209,39 @@ nautilus_file_info_invalidate_extension_info (NautilusFileInfo *file)
NAUTILUS_FILE_INFO_GET_IFACE (file)->invalidate_extension_info (file);
}
+
+gboolean
+nautilus_file_info_has_volume (NautilusFileInfo *file)
+{
+ g_return_val_if_fail (NAUTILUS_IS_FILE_INFO (file), FALSE);
+ g_return_val_if_fail (NAUTILUS_FILE_INFO_GET_IFACE (file)->has_volume != NULL, FALSE);
+
+ return NAUTILUS_FILE_INFO_GET_IFACE (file)->has_volume (file);
+}
+
+gboolean
+nautilus_file_info_has_drive (NautilusFileInfo *file)
+{
+ g_return_val_if_fail (NAUTILUS_IS_FILE_INFO (file), FALSE);
+ g_return_val_if_fail (NAUTILUS_FILE_INFO_GET_IFACE (file)->has_drive != NULL, FALSE);
+
+ return NAUTILUS_FILE_INFO_GET_IFACE (file)->has_drive (file);
+}
+
+GnomeVFSVolume*
+nautilus_file_info_get_volume (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_volume != NULL,NULL);
+
+ return NAUTILUS_FILE_INFO_GET_IFACE (file)->get_volume (file);
+}
+
+GnomeVFSDrive*
+nautilus_file_info_get_drive (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_drive != NULL,NULL);
+
+ return NAUTILUS_FILE_INFO_GET_IFACE (file)->get_drive (file);
+}
diff --git a/libnautilus-extension/nautilus-file-info.h b/libnautilus-extension/nautilus-file-info.h
index ab44b09ad..2ba0ae47a 100644
--- a/libnautilus-extension/nautilus-file-info.h
+++ b/libnautilus-extension/nautilus-file-info.h
@@ -28,6 +28,7 @@
#include <glib-object.h>
#include <libgnomevfs/gnome-vfs-file-info.h>
+#include <libgnomevfs/gnome-vfs-volume.h>
G_BEGIN_DECLS
@@ -74,6 +75,11 @@ struct _NautilusFileInfoIface
const char *attribute_name,
const char *value);
void (*invalidate_extension_info) (NautilusFileInfo *file);
+
+ gboolean (*has_volume) (NautilusFileInfo *file);
+ gboolean (*has_drive) (NautilusFileInfo *file);
+ GnomeVFSVolume* (*get_volume) (NautilusFileInfo *file);
+ GnomeVFSDrive* (*get_drive) (NautilusFileInfo *file);
};
GList *nautilus_file_info_list_copy (GList *files);
@@ -114,6 +120,12 @@ void nautilus_file_info_add_string_attribute (NautilusFileInfo *fil
/* Invalidating file info */
void nautilus_file_info_invalidate_extension_info (NautilusFileInfo *file);
+/* Volumes and Drives */
+gboolean nautilus_file_info_has_volume (NautilusFileInfo *file);
+gboolean nautilus_file_info_has_drive (NautilusFileInfo *file);
+GnomeVFSVolume* nautilus_file_info_get_volume (NautilusFileInfo *file);
+GnomeVFSDrive* nautilus_file_info_get_drive (NautilusFileInfo *file);
+
G_END_DECLS
#endif