Commit e4704499 authored by guinux's avatar guinux

little optimization

parent 9a2a6be0
......@@ -1848,20 +1848,24 @@ namespace Pamac {
}
void connecting_user_daemon () {
try {
user_daemon = Bus.get_proxy_sync (BusType.SESSION, "org.manjaro.pamac.user", "/org/manjaro/pamac/user");
} catch (Error e) {
stderr.printf ("Error: %s\n", e.message);
if (user_daemon == null) {
try {
user_daemon = Bus.get_proxy_sync (BusType.SESSION, "org.manjaro.pamac.user", "/org/manjaro/pamac/user");
} catch (Error e) {
stderr.printf ("Error: %s\n", e.message);
}
}
}
void connecting_system_daemon () {
try {
system_daemon = Bus.get_proxy_sync (BusType.SYSTEM, "org.manjaro.pamac.system", "/org/manjaro/pamac/system");
// Set environment variables
system_daemon.set_environment_variables (pamac_config.environment_variables);
} catch (Error e) {
stderr.printf ("Error: %s\n", e.message);
if (system_daemon == null) {
try {
system_daemon = Bus.get_proxy_sync (BusType.SYSTEM, "org.manjaro.pamac.system", "/org/manjaro/pamac/system");
// Set environment variables
system_daemon.set_environment_variables (pamac_config.environment_variables);
} catch (Error e) {
stderr.printf ("Error: %s\n", e.message);
}
}
}
......
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