summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZeeshan Ali (Khattak) <zeeshanak@gnome.org>2012-07-11 11:13:08 +0300
committerZeeshan Ali (Khattak) <zeeshanak@gnome.org>2012-07-11 20:00:04 +0300
commit76263713d876656a1d54e0d66540be1b440825b8 (patch)
tree7b064cbee15e9fc6c3116ddf58898c9e5ad43d44
parent8d300cedaa5fb663f73a54c847899a07e0426569 (diff)
UnattendedInstaller.setup -> InstallerMedia.prepare_for_installation
Move setup from UnattendedInstaller to parent InstallerMedia as a virtual function so that users of this function don't need type checks and casting to be able to use it. Also give it a more specific/descriptive name. https://bugzilla.gnome.org/show_bug.cgi?id=679706
-rw-r--r--src/installer-media.vala1
-rw-r--r--src/unattended-installer.vala2
-rw-r--r--src/vm-creator.vala3
3 files changed, 3 insertions, 3 deletions
diff --git a/src/installer-media.vala b/src/installer-media.vala
index 8b5dd65..b65448c 100644
--- a/src/installer-media.vala
+++ b/src/installer-media.vala
@@ -59,6 +59,7 @@ private class Boxes.InstallerMedia : GLib.Object {
}
public virtual void set_direct_boot_params (DomainOs os) {}
+ public virtual async void prepare_for_installation (string vm_name, Cancellable? cancellable) throws GLib.Error {}
public bool is_architecture_compatible (string architecture) {
return os_media == null || // Unknown media
diff --git a/src/unattended-installer.vala b/src/unattended-installer.vala
index 93315e6..de94877 100644
--- a/src/unattended-installer.vala
+++ b/src/unattended-installer.vala
@@ -114,7 +114,7 @@ private abstract class Boxes.UnattendedInstaller: InstallerMedia {
setup_ui ();
}
- public async void setup (string vm_name, Cancellable? cancellable) throws GLib.Error {
+ public override async void prepare_for_installation (string vm_name, Cancellable? cancellable) throws GLib.Error {
if (!express_toggle.active) {
debug ("Unattended installation disabled.");
diff --git a/src/vm-creator.vala b/src/vm-creator.vala
index eeb2837..f03dd60 100644
--- a/src/vm-creator.vala
+++ b/src/vm-creator.vala
@@ -34,8 +34,7 @@ private class Boxes.VMCreator {
string title;
var name = yield create_domain_name_and_title_from_media (out title);
- if (install_media is UnattendedInstaller)
- yield (install_media as UnattendedInstaller).setup (name, cancellable);
+ yield install_media.prepare_for_installation (name, cancellable);
var volume = yield create_target_volume (name, install_media.resources.storage);
var caps = yield connection.get_capabilities_async (cancellable);