summaryrefslogtreecommitdiff
path: root/gio/gdrive.c
diff options
context:
space:
mode:
authorDavid Zeuthen <davidz@redhat.com>2011-10-13 16:53:44 -0400
committerDavid Zeuthen <davidz@redhat.com>2011-10-18 14:29:18 -0400
commit915e2238c478737def2f8919204ee10d06ecb98a (patch)
treedc3e8711d6eb690598baa4b7e1e9e57d18deb008 /gio/gdrive.c
parent4a25d21bd08b7dcf38f781bf678ee8fffe817203 (diff)
downloadglib-915e2238c478737def2f8919204ee10d06ecb98a.tar.gz
gio: Introduce get_sort_key() methods on GDrive, GVolume and GMount
This is needed to implement efficient and predictable proxy volume monitors, see https://bugzilla.gnome.org/show_bug.cgi?id=661711 for details. Signed-off-by: David Zeuthen <davidz@redhat.com>
Diffstat (limited to 'gio/gdrive.c')
-rw-r--r--gio/gdrive.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/gio/gdrive.c b/gio/gdrive.c
index 2eff3ca29..9aa99e622 100644
--- a/gio/gdrive.c
+++ b/gio/gdrive.c
@@ -869,3 +869,28 @@ g_drive_stop_finish (GDrive *drive,
return (* iface->stop_finish) (drive, result, error);
}
+
+/**
+ * g_drive_get_sort_key:
+ * @drive: A #GDrive.
+ *
+ * Gets the sort key for @drive, if any.
+ *
+ * Returns: Sorting key for @drive or %NULL if no such key is available.
+ *
+ * Since: 2.32
+ */
+const gchar *
+g_drive_get_sort_key (GDrive *drive)
+{
+ const gchar *ret = NULL;
+ GDriveIface *iface;
+
+ g_return_val_if_fail (G_IS_DRIVE (drive), NULL);
+
+ iface = G_DRIVE_GET_IFACE (drive);
+ if (iface->get_sort_key != NULL)
+ ret = iface->get_sort_key (drive);
+
+ return ret;
+}