Browse Source

use GLib.format_size

tags/v5.1.2
guinux 4 years ago
parent
commit
ad89473d32
4 changed files with 5 additions and 27 deletions
  1. +0
    -1
      po/files_to_translate
  2. +0
    -10
      po/pamac.pot
  3. +0
    -16
      src/common.vala
  4. +5
    -0
      src/transaction.vala

+ 0
- 1
po/files_to_translate View File

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


+ 0
- 10
po/pamac.pot View File

@@ -21,16 +21,6 @@ msgstr ""
msgid "Authentication is required"
msgstr ""

#: ../src/common.vala
#, c-format
msgid "%.0f KiB"
msgstr ""

#: ../src/common.vala
#, c-format
msgid "%.2f MiB"
msgstr ""

#: ../src/daemon.vala
msgid "Failed to initialize alpm library"
msgstr ""


+ 0
- 16
src/common.vala 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;
}
}

+ 5
- 0
src/transaction.vala View File

@@ -89,6 +89,11 @@ namespace Pamac {
BUILD = (1 << 2)
}

public enum Mode {
MANAGER,
UPDATER
}

public class Transaction: Object {
public Daemon daemon;



Loading…
Cancel
Save