[gnome-boxes] util-app: Make copy_file() available to other classes



commit 22d3cb1c199168166c072a6d6f74b4f9c43c45c8
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Wed Jan 16 03:57:28 2013 +0200

    util-app: Make copy_file() available to other classes
    
    https://bugzilla.gnome.org/show_bug.cgi?id=691823

 src/unattended-installer.vala |    8 --------
 src/util-app.vala             |    8 ++++++++
 2 files changed, 8 insertions(+), 8 deletions(-)
---
diff --git a/src/unattended-installer.vala b/src/unattended-installer.vala
index 6557464..4c556b2 100644
--- a/src/unattended-installer.vala
+++ b/src/unattended-installer.vala
@@ -580,14 +580,6 @@ private class Boxes.UnattendedInstaller: InstallerMedia {
         yield copy_file (src_file, initrd_file, cancellable);
     }
 
-    private async void copy_file (File src_file, File dest_file, Cancellable cancellable) throws GLib.Error {
-        try {
-            debug ("Copying '%s' to '%s'..", src_file.get_path (), dest_file.get_path ());
-            yield src_file.copy_async (dest_file, 0, Priority.DEFAULT, cancellable);
-            debug ("Copied '%s' to '%s'.", src_file.get_path (), dest_file.get_path ());
-        } catch (IOError.EXISTS error) {}
-    }
-
     private string? get_product_key_format () {
         // FIXME: We don't support the case of multiple scripts requiring different kind of product keys.
         foreach (var s in scripts.get_elements ()) {
diff --git a/src/util-app.vala b/src/util-app.vala
index 3b69efc..674a137 100644
--- a/src/util-app.vala
+++ b/src/util-app.vala
@@ -386,6 +386,14 @@ namespace Boxes {
          });
     }
 
+    public async void copy_file (File src_file, File dest_file, Cancellable? cancellable = null) throws GLib.Error {
+        try {
+            debug ("Copying '%s' to '%s'..", src_file.get_path (), dest_file.get_path ());
+            yield src_file.copy_async (dest_file, 0, Priority.DEFAULT, cancellable);
+            debug ("Copied '%s' to '%s'.", src_file.get_path (), dest_file.get_path ());
+        } catch (IOError.EXISTS error) {}
+    }
+
     namespace UUID {
         [CCode (cname = "uuid_generate", cheader_filename = "uuid/uuid.h")]
         internal extern static void generate ([CCode (array_length = false)] uchar[] uuid);



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