Avoid duplicate studio appeared notification

When upon ladishd autoactivation studio is created and the autoactivation is caused
by the IsStudioLoaded() signal, two studio appeared notifications were sent
This commit is contained in:
Nedko Arnaudov 2009-08-22 15:05:15 +03:00
parent 7ef81de696
commit 9b4058f7a7
1 changed files with 11 additions and 6 deletions

View File

@ -81,22 +81,27 @@ bool control_proxy_init(void)
{
bool studio_present;
if (!dbus_register_object_signal_handler(g_dbus_connection, SERVICE_NAME, CONTROL_OBJECT_PATH, IFACE_CONTROL, g_signals, message_hook, NULL))
{
return false;
}
if (!control_proxy_is_studio_loaded(&studio_present))
{
dbus_unregister_object_signal_handler(g_dbus_connection, SERVICE_NAME, CONTROL_OBJECT_PATH, IFACE_CONTROL, g_signals, message_hook, NULL);
return false;
}
if (studio_present)
{
lash_info("Initial studio appear");
control_proxy_on_studio_appeared();
}
if (!dbus_register_object_signal_handler(g_dbus_connection, SERVICE_NAME, CONTROL_OBJECT_PATH, IFACE_CONTROL, g_signals, message_hook, NULL))
{
if (studio_present)
{
control_proxy_on_studio_disappeared();
}
return false;
}
return true;
}