After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 327234 - Refactor: Move all the dbus stuff out of gpm-main
Refactor: Move all the dbus stuff out of gpm-main
Status: RESOLVED FIXED
Product: gnome-power-manager
Classification: Deprecated
Component: gnome-power-manager
unspecified
Other Linux
: Normal enhancement
: ---
Assigned To: GNOME Power Manager Maintainer(s)
GNOME Power Manager Maintainer(s)
Depends on:
Blocks: 330831
 
 
Reported: 2006-01-16 17:12 UTC by Jaap A. Haitsma
Modified: 2006-02-13 23:37 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Jaap A. Haitsma 2006-01-16 17:12:43 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)
Comment 1 Richard Hughes 2006-01-16 21:05:32 UTC
Certainly the gpm_signal_handler_nlost type stuff belongs in a hal module, and gpm_object_register probably belongs in the manager class somewhere.
Comment 2 Richard Hughes 2006-02-13 21:40:21 UTC
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.
Comment 3 Richard Hughes 2006-02-13 23:37:47 UTC
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.