Skip to content
Snippets Groups Projects
Commit e4704499 authored by guinux's avatar guinux
Browse files

little optimization

parent 9a2a6be0
No related branches found
No related tags found
No related merge requests found
...@@ -1848,20 +1848,24 @@ namespace Pamac { ...@@ -1848,20 +1848,24 @@ namespace Pamac {
} }
void connecting_user_daemon () { void connecting_user_daemon () {
try { if (user_daemon == null) {
user_daemon = Bus.get_proxy_sync (BusType.SESSION, "org.manjaro.pamac.user", "/org/manjaro/pamac/user"); try {
} catch (Error e) { user_daemon = Bus.get_proxy_sync (BusType.SESSION, "org.manjaro.pamac.user", "/org/manjaro/pamac/user");
stderr.printf ("Error: %s\n", e.message); } catch (Error e) {
stderr.printf ("Error: %s\n", e.message);
}
} }
} }
void connecting_system_daemon () { void connecting_system_daemon () {
try { if (system_daemon == null) {
system_daemon = Bus.get_proxy_sync (BusType.SYSTEM, "org.manjaro.pamac.system", "/org/manjaro/pamac/system"); try {
// Set environment variables system_daemon = Bus.get_proxy_sync (BusType.SYSTEM, "org.manjaro.pamac.system", "/org/manjaro/pamac/system");
system_daemon.set_environment_variables (pamac_config.environment_variables); // Set environment variables
} catch (Error e) { system_daemon.set_environment_variables (pamac_config.environment_variables);
stderr.printf ("Error: %s\n", e.message); } catch (Error e) {
stderr.printf ("Error: %s\n", e.message);
}
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment