GNOME Bugzilla – Bug 327234
Refactor: Move all the dbus stuff out of gpm-main
Last modified: 2006-02-13 23:37:47 UTC
gpm-main.c now contains code to setup and handle the dbus It would be more appropriate to move this to the modules that need this functionality (I think gpm-manager and gpm-hal-callback)
Certainly the gpm_signal_handler_nlost type stuff belongs in a hal module, and gpm_object_register probably belongs in the manager class somewhere.
2006-02-13 Richard Hughes <richard@hughsie.com> * src/gpm-main.c: Remove gpm_dbus_init_nlost, signalhandler_noc and all the accompanying n-o-c and name-lost stuff as it's not being used, and does not belong here. And it was rubbish code. This is all to begin to fix #327234, so we can restart hald without killing g-p-m. * src/gpm-hal-monitor.c: Rename proxy to proxy_hal. Add a second proxy called proxy_dbus that will let us get n-o-c signals. (gpm_hal_monitor_class_init): Add hal-connected and hal-disconnected signal types and descriptions. (hal_disconnect_signals): Free the proxy also here, as it's useless. (hal_connect_signals): Create the proxy, and reconnect the signals to the new proxy. (coldplug_all, un_coldplug_all): Begin to do the reconnection infrastructure so that devices get the signals from the new proxy. THIS IS WORK IN PROGRESS. Restarting hald will appear to work then segfault g-p-m. (hal_name_owner_changed): Add new callback for name-owner-changed signals from the new proxy_dbus objects. (hal_monitor_stop): call un_coldplug (), as currently we are just loosing memory. un_coldplug is TOFIX.
Works for me. 2006-02-13 Richard Hughes <richard@hughsie.com> * src/gpm-hal-monitor.c (gpm_hash_new_devices_cache, gpm_hash_free_devices_cache): Add these so we can simplify our memory management. We need to be more careful that what we were, as hal could be restarted many times and we could loose lots of memory. (hal_monitor_stop): Inline into _finalize, as not called elsewhere. * src/gpm-hal.c (gpm_hal_enable_power_save): valgrind (quite rightly) warns of use before set. Just initialise ret to zero. * src/gpm-power.c (battery_device_cache_entry_free) remove, as broken. (gpm_hash_new_kind_cache, gpm_hash_free_kind_cache, gpm_hash_new_device_cache, gpm_hash_free_device_cache): Add these so we can simplify our memory management, and not forget to free. (gpm_power_init): Listen for the hal-disconnected signal so we can clear the caches, else the devices think they are initialised. Fixes bug #327234.