[glib] Add G_VOLUME_IDENTIFIER_KIND_CLASS identifier



commit 10fbfcf09010e423cfc79c54e8da50b62a0f4b8a
Author: David Zeuthen <davidz redhat com>
Date:   Thu Mar 1 14:06:43 2012 -0500

    Add G_VOLUME_IDENTIFIER_KIND_CLASS identifier
    
    If an application (such as Nautilus) wants to show a sidebar with
    devices group into different groups such as "Devices" and "Network",
    it's currently up to the application itself to do the classification
    (for example by looking at the URI scheme for the activation root,
    e.g. smb://).
    
    This patch adds a new identifier G_VOLUME_IDENTIFIER_KIND_CLASS that
    can be set by volume monitors and used by applications.
    
    See https://bugzilla.gnome.org/show_bug.cgi?id=668295
    
    Signed-off-by: David Zeuthen <davidz redhat com>

 docs/reference/gio/gio-sections.txt |    1 +
 gio/gvolume.h                       |   18 ++++++++++++++++++
 2 files changed, 19 insertions(+), 0 deletions(-)
---
diff --git a/docs/reference/gio/gio-sections.txt b/docs/reference/gio/gio-sections.txt
index b72b37d..fc4a48b 100644
--- a/docs/reference/gio/gio-sections.txt
+++ b/docs/reference/gio/gio-sections.txt
@@ -1098,6 +1098,7 @@ G_VOLUME_IDENTIFIER_KIND_LABEL
 G_VOLUME_IDENTIFIER_KIND_NFS_MOUNT
 G_VOLUME_IDENTIFIER_KIND_UNIX_DEVICE
 G_VOLUME_IDENTIFIER_KIND_UUID
+G_VOLUME_IDENTIFIER_KIND_CLASS
 g_volume_enumerate_identifiers
 g_volume_get_identifier
 g_volume_get_sort_key
diff --git a/gio/gvolume.h b/gio/gvolume.h
index c707059..faa34e8 100644
--- a/gio/gvolume.h
+++ b/gio/gvolume.h
@@ -67,6 +67,24 @@ G_BEGIN_DECLS
  */
 #define G_VOLUME_IDENTIFIER_KIND_NFS_MOUNT "nfs-mount"
 
+/**
+ * G_VOLUME_IDENTIFIER_KIND_CLASS:
+ *
+ * The string used to obtain the volume <emphasis>class</emphasis>
+ * with g_volume_get_identifier().
+ *
+ * Known volume classes include <literal>device</literal> and
+ * <literal>network</literal>. Other classes may be added in the
+ * future.
+ *
+ * This is intended to be used by applications to classify #GVolume
+ * instances into different sections - for example a file manager or
+ * file chooser can use this information to show
+ * <literal>network</literal> volumes under a "Network" heading and
+ * <literal>device</literal> volumes under a "Devices" heading.
+ */
+#define G_VOLUME_IDENTIFIER_KIND_CLASS "class"
+
 
 #define G_TYPE_VOLUME            (g_volume_get_type ())
 #define G_VOLUME(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), G_TYPE_VOLUME, GVolume))



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]