diff options
author | Christophe Fergeau <cfergeau@redhat.com> | 2012-05-24 16:20:03 +0200 |
---|---|---|
committer | Zeeshan Ali (Khattak) <zeeshanak@gnome.org> | 2012-07-03 19:48:41 +0300 |
commit | a88b7b8239e47dcaa692fc39db78b91cddafc60b (patch) | |
tree | 3bd6590743a5bf5d7d35ed6a7b5a3a7c0f4c0662 | |
parent | f1043b8f326cdc572b2b5827a00baf5a1c608142 (diff) |
Pass UnattendedFile to add_unattended_file
This makes add_unattended_file usable with any class inheriting
from UnattendedFile, not only with UnattendedTextFile instances.
https://bugzilla.gnome.org/show_bug.cgi?id=677038
-rw-r--r-- | src/unattended-installer.vala | 8 | ||||
-rw-r--r-- | src/winxp-installer.vala | 5 |
2 files changed, 6 insertions, 7 deletions
diff --git a/src/unattended-installer.vala b/src/unattended-installer.vala index 2bb0cc4..f83dabb 100644 --- a/src/unattended-installer.vala +++ b/src/unattended-installer.vala @@ -101,7 +101,7 @@ private abstract class Boxes.UnattendedInstaller: InstallerMedia { newline_type = DataStreamNewlineType.LF; unattended_files = new GLib.List<UnattendedFile> (); - unattended_files.append (new UnattendedTextFile (this, unattended_src_path, unattended_dest_name)); + add_unattended_file (new UnattendedTextFile (this, unattended_src_path, unattended_dest_name)); var time = TimeVal (); var date = new DateTime.from_timeval_local (time); @@ -274,8 +274,8 @@ private abstract class Boxes.UnattendedInstaller: InstallerMedia { protected virtual async void prepare_direct_boot (Cancellable? cancellable) throws GLib.Error {} - protected void add_unattended_text_file (string unattended_src_path, string unattended_dest_name) { - unattended_files.append (new UnattendedTextFile (this, unattended_src_path, unattended_dest_name)); + protected void add_unattended_file (UnattendedFile file) { + unattended_files.append (file); } private async void create_disk_image (Cancellable? cancellable) throws GLib.Error { @@ -320,7 +320,7 @@ private abstract class Boxes.UnattendedInstaller: InstallerMedia { var file = File.new_for_path (avatar_path); if (file.query_exists ()) { avatar.file = avatar_path; - unattended_files.append (new UnattendedAvatarFile (this, avatar_path, avatar_format)); + add_unattended_file (new UnattendedAvatarFile (this, avatar_path, avatar_format)); } } } diff --git a/src/winxp-installer.vala b/src/winxp-installer.vala index 810eb21..1aa1ab4 100644 --- a/src/winxp-installer.vala +++ b/src/winxp-installer.vala @@ -28,12 +28,11 @@ private class Boxes.WinXPInstaller: WindowsInstaller { var name = media.os.short_id + ".cmd"; unattended_source = get_unattended (name); - add_unattended_text_file (unattended_source, name); + add_unattended_file (new UnattendedTextFile (this, unattended_source, name)); name = media.os.short_id + ".reg"; unattended_source = get_unattended (name); - add_unattended_text_file (unattended_source, name); - + add_unattended_file (new UnattendedTextFile (this, unattended_source, name)); newline_type = DataStreamNewlineType.CR_LF; } |