add clean cache feature in preferences (as paccache frontend)

This commit is contained in:
guinux
2016-08-25 12:33:16 +02:00
parent eb57d65876
commit 412d1f9a02
6 changed files with 192 additions and 26 deletions

View File

@@ -29,6 +29,7 @@ namespace Pamac {
public abstract void start_write_alpm_config (HashTable<string,Variant> new_alpm_conf) throws IOError;
public abstract void start_write_mirrors_config (HashTable<string,Variant> new_mirrors_conf) throws IOError;
public abstract void start_generate_mirrors_list () throws IOError;
public abstract void clean_cache (uint keep_nb, bool only_uninstalled) throws IOError;
public abstract void start_set_pkgreason (string pkgname, uint reason) throws IOError;
public abstract AlpmPackage get_installed_pkg (string pkgname) throws IOError;
public abstract void start_refresh (bool force) throws IOError;
@@ -351,6 +352,14 @@ namespace Pamac {
}
}
public void clean_cache (uint keep_nb, bool only_uninstalled) {
try {
daemon.clean_cache (keep_nb, only_uninstalled);
} catch (IOError e) {
stderr.printf ("IOError: %s\n", e.message);
}
}
public void start_set_pkgreason (string pkgname, uint reason) {
try {
daemon.start_set_pkgreason (pkgname, reason);