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

@ -1,4 +1,3 @@
../src/common.vala
../src/daemon.vala ../src/daemon.vala
../src/transaction.vala ../src/transaction.vala
../src/installer.vala ../src/installer.vala

View File

@ -21,16 +21,6 @@ msgstr ""
msgid "Authentication is required" msgid "Authentication is required"
msgstr "" msgstr ""
#: ../src/common.vala
#, c-format
msgid "%.0f KiB"
msgstr ""
#: ../src/common.vala
#, c-format
msgid "%.2f MiB"
msgstr ""
#: ../src/daemon.vala #: ../src/daemon.vala
msgid "Failed to initialize alpm library" msgid "Failed to initialize alpm library"
msgstr "" msgstr ""

View File

@ -37,11 +37,6 @@ namespace Pamac {
} }
} }
public enum Mode {
MANAGER,
UPDATER
}
public struct ErrorInfos { public struct ErrorInfos {
public string message; public string message;
public string[] details; 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) BUILD = (1 << 2)
} }
public enum Mode {
MANAGER,
UPDATER
}
public class Transaction: Object { public class Transaction: Object {
public Daemon daemon; public Daemon daemon;