Original bug report: https://bugzilla.gnome.org/show_bug.cgi?id=549606 By wathcing this D-Bus signal MC could disconnect all accounts when computer is about to suspend and so avoid data loss. MC should probably remeber the requested presence and restore it when the computer wakes up.
See also bug #40131 which is about using a similar signal with network changes.
Well. I think this branch works given a quick smoke test. I'll try it harder after lunch!
Why G_CONNECT_AFTER?
(In reply to comment #3) > Why G_CONNECT_AFTER? No good reason. Branch updated! (It still depends on bug 38978, of course.)
Maybe we should factor out this code: + g_signal_emit (self, signals[STATE_CHANGE], 0, + priv->connected && priv->awake); Especially, you check if priv->awake actually changed before firing this signal, but if priv->connected is still FALSE, you actually didn't change the state. The opposite is probably true as well: connected changing but awake being FALSE.
(In reply to comment #5) > Maybe we should factor out this code: > + g_signal_emit (self, signals[STATE_CHANGE], 0, > + priv->connected && priv->awake); > > Especially, you check if priv->awake actually changed before firing this > signal, but if priv->connected is still FALSE, you actually didn't change the > state. > > The opposite is probably true as well: connected changing but awake being > FALSE. Right you are. I've pushed a patch that addresses this.
Looks good! Go go merge and the original bug, initally opened by Daf on 2008-08-27 will be finally closed. :)
It is merged! The feature will be in MC 5.9.3.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.