Commit d8b64c01 authored by guinux's avatar guinux

fix #485

parent 1f255c9d
......@@ -136,7 +136,7 @@ namespace Pamac {
var pkgs = new List<Package> ();
new Thread<int> ("get_installed_pkgs", () => {
pkgs = alpm_utils.get_installed_pkgs ();
get_installed_pkgs_async.callback ();
Idle.add (get_installed_pkgs_async.callback);
return 0;
});
yield;
......@@ -151,7 +151,7 @@ namespace Pamac {
var pkgs = new List<Package> ();
new Thread<int> ("get_installed_apps", () => {
pkgs = alpm_utils.get_installed_apps ();
get_installed_apps_async.callback ();
Idle.add (get_installed_apps_async.callback);
return 0;
});
yield;
......@@ -166,7 +166,7 @@ namespace Pamac {
var pkgs = new List<Package> ();
new Thread<int> ("get_explicitly_installed_pkgs", () => {
pkgs = alpm_utils.get_explicitly_installed_pkgs ();
get_explicitly_installed_pkgs_async.callback ();
Idle.add (get_explicitly_installed_pkgs_async.callback);
return 0;
});
yield;
......@@ -181,7 +181,7 @@ namespace Pamac {
var pkgs = new List<Package> ();
new Thread<int> ("get_foreign_pkgs", () => {
pkgs = alpm_utils.get_foreign_pkgs ();
get_foreign_pkgs_async.callback ();
Idle.add (get_foreign_pkgs_async.callback);
return 0;
});
yield;
......@@ -196,7 +196,7 @@ namespace Pamac {
var pkgs = new List<Package> ();
new Thread<int> ("get_orphans", () => {
pkgs = alpm_utils.get_orphans ();
get_orphans_async.callback ();
Idle.add (get_orphans_async.callback);
return 0;
});
yield;
......@@ -223,7 +223,7 @@ namespace Pamac {
var pkgs = new List<Package> ();
new Thread<int> ("search_pkgs", () => {
pkgs = alpm_utils.search_pkgs (search_string);
search_pkgs_async.callback ();
Idle.add (search_pkgs_async.callback);
return 0;
});
yield;
......@@ -246,7 +246,7 @@ namespace Pamac {
var pkgs = new List<AURPackage> ();
new Thread<int> ("search_in_aur", () => {
pkgs = alpm_utils.search_in_aur (search_string);
search_in_aur_async.callback ();
Idle.add (search_in_aur_async.callback);
return 0;
});
yield;
......@@ -269,7 +269,7 @@ namespace Pamac {
var pkgs = new List<Package> ();
new Thread<int> ("get_category_pkgs", () => {
pkgs = alpm_utils.get_category_pkgs (category);
get_category_pkgs_async.callback ();
Idle.add (get_category_pkgs_async.callback);
return 0;
});
yield;
......@@ -292,7 +292,7 @@ namespace Pamac {
var pkgs = new List<Package> ();
new Thread<int> ("get_repo_pkgs", () => {
pkgs = alpm_utils.get_repo_pkgs (repo);
get_repo_pkgs_async.callback ();
Idle.add (get_repo_pkgs_async.callback);
return 0;
});
yield;
......@@ -315,7 +315,7 @@ namespace Pamac {
var pkgs = new List<Package> ();
new Thread<int> ("get_group_pkgs", () => {
pkgs = alpm_utils.get_group_pkgs (group_name);
get_group_pkgs_async.callback ();
Idle.add (get_group_pkgs_async.callback);
return 0;
});
yield;
......@@ -342,7 +342,7 @@ namespace Pamac {
var files = new List<string> ();
new Thread<int> ("get_pkg_files", () => {
files = alpm_utils.get_pkg_files (pkgname);
get_pkg_files_async.callback ();
Idle.add (get_pkg_files_async.callback);
return 0;
});
yield;
......@@ -365,7 +365,7 @@ namespace Pamac {
var pkg = new AURPackage ();
new Thread<int> ("get_aur_pkg", () => {
pkg = alpm_utils.get_aur_pkg (pkgname);
get_aur_pkg_async.callback ();
Idle.add (get_aur_pkg_async.callback);
return 0;
});
yield;
......@@ -384,7 +384,7 @@ namespace Pamac {
var pkg = new AURPackageDetails ();
new Thread<int> ("get_aur_pkg_details", () => {
pkg = alpm_utils.get_aur_pkg_details (pkgname);
get_aur_pkg_details_async.callback ();
Idle.add (get_aur_pkg_details_async.callback);
return 0;
});
yield;
......@@ -403,7 +403,7 @@ namespace Pamac {
var updates = new Updates ();
new Thread<int> ("get_updates", () => {
updates = get_updates ();
get_updates_async.callback ();
Idle.add (get_updates_async.callback);
return 0;
});
yield;
......
......@@ -141,7 +141,7 @@ namespace Pamac {
bool authorized = false;
ulong handler_id = transaction_interface.get_authorization_finished.connect ((authorized_) => {
authorized = authorized_;
check_authorization.callback ();
Idle.add (check_authorization.callback);
});
transaction_interface.start_get_authorization ();
yield;
......
......@@ -139,27 +139,25 @@ namespace Pamac {
bool check_updates () {
if (database.config.refresh_period != 0) {
database.get_updates_async.begin ((obj, res) => {
var updates = database.get_updates_async.end (res);
updates_nb = updates.repos_updates.length () + updates.aur_updates.length ();
if (updates_nb == 0) {
set_icon (noupdate_icon_name);
set_tooltip (noupdate_info);
set_icon_visible (!database.config.no_update_hide_icon);
close_notification ();
} else {
if (!check_pamac_running () && database.config.download_updates) {
start_system_daemon ();
try {
system_daemon.start_download_updates ();
} catch (Error e) {
stderr.printf ("Error: %s\n", e.message);
}
} else {
show_or_update_notification ();
var updates = database.get_updates ();
updates_nb = updates.repos_updates.length () + updates.aur_updates.length ();
if (updates_nb == 0) {
set_icon (noupdate_icon_name);
set_tooltip (noupdate_info);
set_icon_visible (!database.config.no_update_hide_icon);
close_notification ();
} else {
if (!check_pamac_running () && database.config.download_updates) {
start_system_daemon ();
try {
system_daemon.start_download_updates ();
} catch (Error e) {
stderr.printf ("Error: %s\n", e.message);
}
} else {
show_or_update_notification ();
}
});
}
}
return true;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment