[gnome-boxes] installer-media: Add installed_size property



commit 05530c133cfeb1c63c3ea6a1df54cb44e83a371c
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Mon Aug 20 22:30:51 2012 +0300

    installer-media: Add installed_size property
    
    It represents the storage allocation of the OS immediately after
    installation. We only know the value of this property for express
    installations. This information should really come from libosinfo and
    hopefully it soon will be, along with the rest of the OS-specific express
    installation code/data.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=682300

 src/fedora-installer.vala |    6 ++++++
 src/installer-media.vala  |    3 +++
 src/win7-installer.vala   |    6 ++++++
 src/winxp-installer.vala  |    6 ++++++
 4 files changed, 21 insertions(+), 0 deletions(-)
---
diff --git a/src/fedora-installer.vala b/src/fedora-installer.vala
index fa22e30..641cb72 100644
--- a/src/fedora-installer.vala
+++ b/src/fedora-installer.vala
@@ -1,6 +1,12 @@
 // This file is part of GNOME Boxes. License: LGPLv2+
 
 private class Boxes.FedoraInstaller: UnattendedInstaller {
+    public override uint64 installed_size {
+        get {
+            return express_install? 2922930176 : 0;
+        }
+    }
+
     private bool mounted;
 
     private File source_dir;
diff --git a/src/installer-media.vala b/src/installer-media.vala
index 4c4e8f8..5dc57d8 100644
--- a/src/installer-media.vala
+++ b/src/installer-media.vala
@@ -13,6 +13,9 @@ private class Boxes.InstallerMedia : GLib.Object {
     public string mount_point;
     public bool from_image;
 
+    // FIXME: Currently our OS-specific subclasses provide this info but once we start using libosinfo's API for
+    //        express installation, this info should come from there.
+    public virtual uint64 installed_size { get { return 0; } }
     public virtual bool need_user_input_for_vm_creation { get { return false; } }
     public virtual bool user_data_for_vm_creation_available { get { return true; } }
 
diff --git a/src/win7-installer.vala b/src/win7-installer.vala
index 75fbf6d..7722a5c 100644
--- a/src/win7-installer.vala
+++ b/src/win7-installer.vala
@@ -5,6 +5,12 @@
 private class Boxes.Win7Installer: WindowsInstaller {
     private static Regex arch_regex;
 
+    public override uint64 installed_size {
+        get {
+            return express_install? 7554351104 : 0;
+        }
+    }
+
     static construct {
         try {
             arch_regex = new Regex ("BOXES_CPU");
diff --git a/src/winxp-installer.vala b/src/winxp-installer.vala
index 20cb490..4ff19cf 100644
--- a/src/winxp-installer.vala
+++ b/src/winxp-installer.vala
@@ -17,6 +17,12 @@ private class Boxes.WinXPInstaller: WindowsInstaller {
         }
     }
 
+    public override uint64 installed_size {
+        get {
+            return express_install? 1169436672 : 0;
+        }
+    }
+
     static construct {
         try {
             key_regex = new Regex ("BOXES_PRODUCT_KEY");



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