[gnome-disk-utility] allow passing options to gdu_device_op_filesystem_mount()



commit f72872109fea7c0ee5e3ad52cb71f498e55384f9
Author: David Zeuthen <davidz redhat com>
Date:   Wed Apr 15 14:40:37 2009 -0400

    allow passing options to gdu_device_op_filesystem_mount()
    
    We need this for the gvfs monitor to pass the 'flush' option for vfat.
---
 src/gdu/gdu-device.c       |    8 ++++++--
 src/gdu/gdu-device.h       |    1 +
 src/palimpsest/gdu-shell.c |    1 +
 3 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/gdu/gdu-device.c b/src/gdu/gdu-device.c
index c74cd21..045441c 100644
--- a/src/gdu/gdu-device.c
+++ b/src/gdu/gdu-device.c
@@ -1512,11 +1512,12 @@ op_mount_cb (DBusGProxy *proxy, char *mount_path, GError *error, gpointer user_d
 
 void
 gdu_device_op_filesystem_mount (GduDevice                   *device,
+                                gchar                      **options,
                                 GduDeviceFilesystemMountCompletedFunc  callback,
                                 gpointer                     user_data)
 {
         const char *fstype;
-        char *options[16];
+        gchar *null_options[16];
         FilesystemMountData *data;
 
         data = g_new0 (FilesystemMountData, 1);
@@ -1524,9 +1525,12 @@ gdu_device_op_filesystem_mount (GduDevice                   *device,
         data->callback = callback;
         data->user_data = user_data;
 
-        options[0] = NULL;
         fstype = NULL;
 
+        null_options[0] = NULL;
+        if (options == NULL)
+                options = null_options;
+
         org_freedesktop_DeviceKit_Disks_Device_filesystem_mount_async (device->priv->proxy,
                                                                        fstype,
                                                                        (const char **) options,
diff --git a/src/gdu/gdu-device.h b/src/gdu/gdu-device.h
index bb7d1ae..9ed4e95 100644
--- a/src/gdu/gdu-device.h
+++ b/src/gdu/gdu-device.h
@@ -214,6 +214,7 @@ GduAtaSmartAttribute *gdu_device_drive_ata_smart_get_attribute (GduDevice *devic
 /* ---------------------------------------------------------------------------------------------------- */
 
 void gdu_device_op_filesystem_mount                   (GduDevice                             *device,
+                                                       gchar                                **options,
                                                        GduDeviceFilesystemMountCompletedFunc  callback,
                                                        gpointer                               user_data);
 
diff --git a/src/palimpsest/gdu-shell.c b/src/palimpsest/gdu-shell.c
index 3b9433c..79cef08 100644
--- a/src/palimpsest/gdu-shell.c
+++ b/src/palimpsest/gdu-shell.c
@@ -1074,6 +1074,7 @@ mount_action_callback (GtkAction *action, gpointer user_data)
         device = gdu_presentable_get_device (shell->priv->presentable_now_showing);
         if (device != NULL) {
                 gdu_device_op_filesystem_mount (device,
+                                                NULL,
                                                 mount_op_callback,
                                                 shell_presentable_new (shell, shell->priv->presentable_now_showing));
                 g_object_unref (device);



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