[glibmm] implement Gio::Volume::eject_with_operation()



commit 5b120b5592c1176d703f9ae3f6c60d29f2d112fc
Author: Jonathon Jongsma <jonathon quotidian org>
Date:   Thu Jul 9 22:51:04 2009 +0100

    implement Gio::Volume::eject_with_operation()
    
    	* gio/src/volume.ccg:
    	* gio/src/volume.hg: implement eject_with_operation()
    	  similarly to the GDrive methods mentioned below

 ChangeLog          |    6 ++++
 gio/src/volume.ccg |   73 +++++++++++++++++++++++++++++++++++++++++----------
 gio/src/volume.hg  |   27 ++++---------------
 3 files changed, 70 insertions(+), 36 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 7b56c60..375e4a5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2009-07-09  Jonathon Jongsma  <jonathon quotidian org>
 
+	* gio/src/volume.ccg:
+	* gio/src/volume.hg: implement eject_with_operation()
+	  similarly to the GDrive methods mentioned below
+
+2009-07-09  Jonathon Jongsma  <jonathon quotidian org>
+
 	* gio/src/mount.ccg:
 	* gio/src/mount.hg: implement eject_with_operation() and
 	  mount_with_operation similarly to the GDrive methods mentioned
diff --git a/gio/src/volume.ccg b/gio/src/volume.ccg
index 1e7d093..3bdd957 100644
--- a/gio/src/volume.ccg
+++ b/gio/src/volume.ccg
@@ -90,11 +90,12 @@ void Volume::eject(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>&
   // and deleted in the callback.
   SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
 
-  g_volume_eject(gobj(),
-                 static_cast<GMountUnmountFlags>(flags), 
-                 cancellable->gobj(),
-                 &SignalProxy_async_callback,
-                 slot_copy);
+  g_volume_eject_with_operation(gobj(),
+                                static_cast<GMountUnmountFlags>(flags), 
+                                0, // mount_operation
+                                cancellable->gobj(),
+                                &SignalProxy_async_callback,
+                                slot_copy);
 }
 
 void Volume::eject(const SlotAsyncReady& slot, MountUnmountFlags flags)
@@ -104,20 +105,62 @@ void Volume::eject(const SlotAsyncReady& slot, MountUnmountFlags flags)
   // and deleted in the callback.
   SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
 
-  g_volume_eject(gobj(),
-                 static_cast<GMountUnmountFlags>(flags), 
-                 NULL,
-                 &SignalProxy_async_callback,
-                 slot_copy);
+  g_volume_eject_with_operation(gobj(),
+                                static_cast<GMountUnmountFlags>(flags), 
+                                0, // mount_operation
+                                0, // cancellable
+                                &SignalProxy_async_callback,
+                                slot_copy);
 }
 
 void Volume::eject(MountUnmountFlags flags)
 {
-  g_volume_eject(gobj(),
-                 static_cast<GMountUnmountFlags>(flags), 
-                 NULL,
-                 NULL,
-                 NULL);
+  g_volume_eject_with_operation(gobj(),
+                                static_cast<GMountUnmountFlags>(flags), 
+                                0, // mount_operation
+                                0, // cancellable
+                                0, // callback
+                                0); // data
+}
+
+void Volume::eject(const Glib::RefPtr<MountOperation>& mount_operation, const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, MountUnmountFlags flags)
+{
+  // Create a copy of the slot.
+  // A pointer to it will be passed through the callback's data parameter
+  // and deleted in the callback.
+  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+
+  g_volume_eject_with_operation(gobj(),
+                                static_cast<GMountUnmountFlags>(flags), 
+                                mount_operation->gobj(),
+                                cancellable->gobj(),
+                                &SignalProxy_async_callback,
+                                slot_copy);
+}
+
+void Volume::eject(const Glib::RefPtr<MountOperation>& mount_operation, const SlotAsyncReady& slot, MountUnmountFlags flags)
+{
+  // Create a copy of the slot.
+  // A pointer to it will be passed through the callback's data parameter
+  // and deleted in the callback.
+  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+
+  g_volume_eject_with_operation(gobj(),
+                                static_cast<GMountUnmountFlags>(flags), 
+                                mount_operation->gobj(),
+                                0, // cancellable
+                                &SignalProxy_async_callback,
+                                slot_copy);
+}
+
+void Volume::eject(const Glib::RefPtr<MountOperation>& mount_operation, MountUnmountFlags flags)
+{
+    g_volume_eject_with_operation(gobj(),
+                                  static_cast<GMountUnmountFlags>(flags), 
+                                  mount_operation->gobj(),
+                                  0, // cancellable
+                                  0, // callback
+                                  0); // data
 }
 
 } // namespace Gio
diff --git a/gio/src/volume.hg b/gio/src/volume.hg
index d192d6d..7752ba1 100644
--- a/gio/src/volume.hg
+++ b/gio/src/volume.hg
@@ -117,34 +117,19 @@ public:
                g_volume_mount_finish,
                errthrow)
 
-  /** Ejects a volume. 
-   * This is an asynchronous operation, and is finished by calling eject_finish() with the AsyncResult data returned in the callback slot.
-   *
-   * @param slot A callback which will be called when the operation is completed or canceled.
-   * @param cancellable A cancellable object which can be used to cancel the operation.
-   * @param flags Flags affecting the unmount if required for eject.
-   */
   void eject(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, MountUnmountFlags flags = MOUNT_UNMOUNT_NONE);
-
-  /** Ejects a volume. 
-   * This is an asynchronous operation, and is finished by calling eject_finish() with the AsyncResult data returned in the callback slot.
-   *
-   * @param slot A callback which will be called when the operation is completed or canceled.
-   * @param flags Flags affecting the unmount if required for eject.
-   */
   void eject(const SlotAsyncReady& slot, MountUnmountFlags flags = MOUNT_UNMOUNT_NONE);
-
-  /** Ejects a volume. 
-   * This is an asynchronous operation, and is finished by calling eject_finish() with the AsyncResult data returned in the callback slot.
-   *
-   * @param flags Flags affecting the unmount if required for eject.
-   */
   void eject(MountUnmountFlags flags = MOUNT_UNMOUNT_NONE);
+  void eject(const Glib::RefPtr<MountOperation>& mount_operation, const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, MountUnmountFlags flags = MOUNT_UNMOUNT_NONE);
+  void eject(const Glib::RefPtr<MountOperation>& mount_operation, const SlotAsyncReady& slot, MountUnmountFlags flags = MOUNT_UNMOUNT_NONE);
+  void eject(const Glib::RefPtr<MountOperation>& mount_operation, MountUnmountFlags flags = MOUNT_UNMOUNT_NONE);
   _IGNORE(g_volume_eject)
+  _IGNORE(g_volume_eject_with_operation)
 
   _WRAP_METHOD(bool eject_finish(const Glib::RefPtr<AsyncResult>& result),
-               g_volume_eject_finish,
+               g_volume_eject_with_operation_finish,
                errthrow)
+  _IGNORE(g_volume_eject_finish)
 
   _WRAP_METHOD(std::string get_identifier(const std::string& kind) const,
                g_volume_get_identifier)



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