use GLib.format_size

This commit is contained in:
guinux
2015-10-03 12:57:10 +02:00
parent 859f2de6c1
commit ad89473d32
4 changed files with 5 additions and 27 deletions

View File

@@ -37,11 +37,6 @@ namespace Pamac {
}
}
public enum Mode {
MANAGER,
UPDATER
}
public struct ErrorInfos {
public string message;
public string[] details;
@@ -51,14 +46,3 @@ namespace Pamac {
}
}
}
public string format_size (uint64 size) {
float KiB_size = size / 1024;
if (KiB_size < 1000) {
string size_string = dgettext ("pamac", "%.0f KiB").printf (KiB_size);
return size_string;
} else {
string size_string = dgettext ("pamac", "%.2f MiB").printf (KiB_size / 1024);
return size_string;
}
}

View File

@@ -89,6 +89,11 @@ namespace Pamac {
BUILD = (1 << 2)
}
public enum Mode {
MANAGER,
UPDATER
}
public class Transaction: Object {
public Daemon daemon;