summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZeeshan Ali (Khattak) <zeeshanak@gnome.org>2013-01-16 03:57:28 +0200
committerZeeshan Ali (Khattak) <zeeshanak@gnome.org>2013-01-23 16:10:52 +0200
commit22d3cb1c199168166c072a6d6f74b4f9c43c45c8 (patch)
tree4dc1df77c88f81cd615b119c96144c804d73ab87
parent356985a9bbbb114c7c6fda8bcc3335f2d3acbf3e (diff)
util-app: Make copy_file() available to other classes
https://bugzilla.gnome.org/show_bug.cgi?id=691823
-rw-r--r--src/unattended-installer.vala8
-rw-r--r--src/util-app.vala8
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);