[Spice-devel] [PATCH spice-gtk 1/2] file-transfer: Add documentation for public functions

Pavel Grunt pgrunt at redhat.com
Thu Sep 1 09:33:13 UTC 2016


---
 doc/reference/spice-gtk-sections.txt |  2 ++
 src/spice-file-transfer-task.c       | 45 ++++++++++++++++++++++++++----------
 2 files changed, 35 insertions(+), 12 deletions(-)

diff --git a/doc/reference/spice-gtk-sections.txt b/doc/reference/spice-gtk-sections.txt
index df58297..386e737 100644
--- a/doc/reference/spice-gtk-sections.txt
+++ b/doc/reference/spice-gtk-sections.txt
@@ -511,6 +511,8 @@ SpiceWebdavChannelPrivate
 <SUBSECTION>
 spice_file_transfer_task_get_progress
 spice_file_transfer_task_get_filename
+spice_file_transfer_task_get_total_bytes
+spice_file_transfer_task_get_transferred_bytes
 spice_file_transfer_task_cancel
 <SUBSECTION Standard>
 SPICE_FILE_TRANSFER_TASK
diff --git a/src/spice-file-transfer-task.c b/src/spice-file-transfer-task.c
index aa9d95b..96aef9f 100644
--- a/src/spice-file-transfer-task.c
+++ b/src/spice-file-transfer-task.c
@@ -352,18 +352,6 @@ GCancellable *spice_file_transfer_task_get_cancellable(SpiceFileTransferTask *se
     return self->cancellable;
 }
 
-guint64 spice_file_transfer_task_get_total_bytes(SpiceFileTransferTask *self)
-{
-    g_return_val_if_fail(self != NULL, 0);
-    return self->file_size;
-}
-
-guint64 spice_file_transfer_task_get_transferred_bytes(SpiceFileTransferTask *self)
-{
-    g_return_val_if_fail(self != NULL, 0);
-    return self->read_bytes;
-}
-
 /* Helper function which only creates a SpiceFileTransferTask per GFile
  * in @files and returns a HashTable mapping task-id to the task itself
  * The SpiceFileTransferTask created here has two references, one should be
@@ -552,6 +540,39 @@ char* spice_file_transfer_task_get_filename(SpiceFileTransferTask *self)
     return g_file_get_basename(self->file);
 }
 
+/**
+ * spice_file_transfer_task_get_total_bytes:
+ * @self: a file transfer task
+ *
+ * Gets the total size in bytes of the file transfer.
+ *
+ * Returns: The total size of the file transfer 
+ *
+ * Since: 0.33
+ **/
+guint64 spice_file_transfer_task_get_total_bytes(SpiceFileTransferTask *self)
+{
+    g_return_val_if_fail(self != NULL, 0);
+    return self->file_size;
+}
+
+
+/**
+ * spice_file_transfer_task_get_transferred_bytes:
+ * @self: a file transfer task
+ *
+ * Gets the number of bytes that have been transferred so far.
+ *
+ * Returns: The number of transferred bytes
+ *
+ * Since: 0.33
+ **/
+guint64 spice_file_transfer_task_get_transferred_bytes(SpiceFileTransferTask *self)
+{
+    g_return_val_if_fail(self != NULL, 0);
+    return self->read_bytes;
+}
+
 /*******************************************************************************
  * GObject
  ******************************************************************************/
-- 
2.9.3



More information about the Spice-devel mailing list