Add g_volume_should_automount. Docs needed.
authorAlexander Larsson <alexl@redhat.com>
Fri, 8 Feb 2008 16:12:55 +0000 (16:12 +0000)
committerAlexander Larsson <alexl@src.gnome.org>
Fri, 8 Feb 2008 16:12:55 +0000 (16:12 +0000)
2008-02-08  Alexander Larsson  <alexl@redhat.com>

* gio.symbols:
        * gunixvolume.c:
        * gvolume.[ch]:
        Add g_volume_should_automount.
Docs needed.

svn path=/trunk/; revision=6484

gio/ChangeLog
gio/gio.symbols
gio/gunixvolume.c
gio/gvolume.c
gio/gvolume.h

index 6eaa960fca39c3351a7bfa139b6be2e59b716733..97f83b494b6eb702a43899cb3f88c09da0e447f1 100644 (file)
@@ -1,3 +1,11 @@
+2008-02-08  Alexander Larsson  <alexl@redhat.com>
+
+       * gio.symbols: 
+        * gunixvolume.c:
+        * gvolume.[ch]:
+        Add g_volume_should_automount.
+       Docs needed.
+
 2008-02-07  Tor Lillqvist  <tml@novell.com>
 
        * tests/Makefile.am (TEST_PROGS): live-g-file won't build on
index 482844989afff5c8de66d7e754c920bc97fa8d10..fec2c1024232085c084fd579ed9f08e335d763f6 100644 (file)
@@ -713,6 +713,7 @@ g_volume_get_icon
 g_volume_get_uuid 
 g_volume_get_drive 
 g_volume_get_mount
+g_volume_should_automount
 g_volume_can_mount
 g_volume_can_eject
 g_volume_mount 
index 6b126255c14a6be1cf116b58a16851817cd8eaa4..0b9f16a694ce48806cebb4b7d6c04afc3484d585 100644 (file)
@@ -244,6 +244,14 @@ g_unix_volume_can_eject (GVolume *volume)
   return unix_volume->can_eject;
 }
 
+static gboolean
+g_unix_volume_should_automount (GVolume *volume)
+{
+  /* We automount all local volumes because we don't even
+     make the internal stuff visible */
+  return TRUE;
+}
+
 static GDrive *
 g_unix_volume_get_drive (GVolume *volume)
 {
@@ -462,7 +470,6 @@ g_unix_volume_enumerate_identifiers (GVolume *volume)
   return res;
 }
 
-
 static void
 g_unix_volume_volume_iface_init (GVolumeIface *iface)
 {
@@ -473,6 +480,7 @@ g_unix_volume_volume_iface_init (GVolumeIface *iface)
   iface->get_mount = g_unix_volume_get_mount;
   iface->can_mount = g_unix_volume_can_mount;
   iface->can_eject = g_unix_volume_can_eject;
+  iface->should_automount = g_unix_volume_should_automount;
   iface->mount_fn = g_unix_volume_mount;
   iface->mount_finish = g_unix_volume_mount_finish;
   iface->eject = g_unix_volume_eject;
index 9eb0703b6bbf9c19fc40fb1eccb7333f1c391eb0..28bf63520495fc48d033dab65598612160622ad0 100644 (file)
@@ -288,6 +288,22 @@ g_volume_can_eject (GVolume *volume)
   return (* iface->can_eject) (volume);
 }
 
+gboolean
+g_volume_should_automount (GVolume *volume)
+{
+  GVolumeIface *iface;
+
+  g_return_val_if_fail (G_IS_VOLUME (volume), FALSE);
+
+  iface = G_VOLUME_GET_IFACE (volume);
+
+  if (iface->should_automount == NULL)
+    return FALSE;
+
+  return (* iface->should_automount) (volume);
+}
+
+
 /**
  * g_volume_mount:
  * @volume: a #GVolume.
index 656a242559dd60da6da4c753f20f39305506a7b1..c5b8c564d1f592c9d87726067abe0f0d930862c8 100644 (file)
@@ -109,6 +109,9 @@ struct _GVolumeIface
   char *   (*get_identifier)           (GVolume             *volume,
                                        const char          *kind);
   char **  (*enumerate_identifiers)    (GVolume             *volume);
+
+  gboolean (*should_automount)         (GVolume             *volume);
+  
 };
 
 GType     g_volume_get_type       (void) G_GNUC_CONST;
@@ -120,6 +123,7 @@ GDrive * g_volume_get_drive             (GVolume              *volume);
 GMount * g_volume_get_mount             (GVolume              *volume);
 gboolean g_volume_can_mount             (GVolume              *volume);
 gboolean g_volume_can_eject             (GVolume              *volume);
+gboolean g_volume_should_automount      (GVolume              *volume);
 void     g_volume_mount                 (GVolume              *volume,
                                         GMountOperation      *mount_operation,
                                         GCancellable         *cancellable,