[gnome-boxes] wizard, libvirt-machine: Don't use IEC units for storage



commit b8c2d4c9fd51412b80a225b02aa7828389028afe
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Fri Feb 15 17:14:06 2013 +0200

    wizard,libvirt-machine: Don't use IEC units for storage
    
    https://bugzilla.gnome.org/show_bug.cgi?id=693207

 src/libvirt-machine-properties.vala |    7 +++++--
 src/wizard.vala                     |    2 +-
 2 files changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/src/libvirt-machine-properties.vala b/src/libvirt-machine-properties.vala
index 3e79da7..944ea8e 100644
--- a/src/libvirt-machine-properties.vala
+++ b/src/libvirt-machine-properties.vala
@@ -3,6 +3,8 @@ using GVir;
 using Gtk;
 
 private class Boxes.LibvirtMachineProperties: GLib.Object, Boxes.IPropertiesProvider {
+    private const uint64 MEGABYTES = 1000 * 1000;
+
     private weak LibvirtMachine machine; // Weak ref for avoiding cyclic ref */
     private uint shutdown_timeout;
 
@@ -384,7 +386,8 @@ private class Boxes.LibvirtMachineProperties: GLib.Object, Boxes.IPropertiesProv
                                               machine.domain_config.memory,
                                               64 * Osinfo.MEBIBYTES,
                                               max_ram * Osinfo.KIBIBYTES,
-                                              64 * Osinfo.MEBIBYTES);
+                                              64 * Osinfo.MEBIBYTES,
+                                              FormatSizeFlags.IEC_UNITS);
             property.changed.connect (on_ram_changed);
 
             this.notify["state"].connect (() => {
@@ -495,7 +498,7 @@ private class Boxes.LibvirtMachineProperties: GLib.Object, Boxes.IPropertiesProv
                                               volume_info.capacity,
                                               volume_info.capacity,
                                               max_storage,
-                                              256 * Osinfo.MEBIBYTES);
+                                              256 * MEGABYTES);
             property.changed.connect (on_storage_changed);
 
             return property;
diff --git a/src/wizard.vala b/src/wizard.vala
index 723922e..8094a9e 100644
--- a/src/wizard.vala
+++ b/src/wizard.vala
@@ -441,7 +441,7 @@ private class Boxes.Wizard: Boxes.UI {
             if (libvirt_machine.storage_volume != null) {
                 try {
                     var volume_info = libvirt_machine.storage_volume.get_info ();
-                    var capacity = format_size (volume_info.capacity, FormatSizeFlags.IEC_UNITS);
+                    var capacity = format_size (volume_info.capacity);
                     summary.add_property (_("Disk"),  _("%s maximum".printf (capacity)));
                 } catch (GLib.Error error) {
                     warning ("Failed to get information on volume '%s': %s",


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