Merge lp:~osomon/elisa/gnome_screensaver_fixes into lp:elisa

Proposed by Olivier Tilloy
Status: Needs review
Proposed branch: lp:~osomon/elisa/gnome_screensaver_fixes
Merge into: lp:elisa
Diff against target: 36 lines (+10/-7)
1 file modified
elisa-plugins/elisa/plugins/gnome/gnome_screensaver_service.py (+10/-7)
To merge this branch: bzr merge lp:~osomon/elisa/gnome_screensaver_fixes
Reviewer Review Type Date Requested Status
Elisa Developers code functional Pending
Review via email: mp+25331@code.launchpad.net

Description of the change

This branch (originally submitted for merge against moovida) fixes bug #322719.

The issue was twofold:

1) A wrong assumption that a "status change" message and a "playback ended" message could not be received in a row. Adding a check fixes that.

2) A badly written condition to check whether to (un)inhibit which leaded in successive changes in the inhibition state when seeking in a file.

The careful reviewer will verify that the bug is fixed and that it doesn't introduce any regressions. Music and video playback as well as picture slideshow should be tested. In order to monitor (un)inhibition orders, one can run moovida with ELISA_DEBUG=gnome_screensaver_service:5

To post a comment you must log in.
Revision history for this message
Paul van Tilburg (paulvt) wrote :

I have not reviewed the code, but merged the branch and tested it out when Moovida was idle, playing video, music, pictures. It seems to be fixed!

Revision history for this message
Olivier Tilloy (osomon) wrote :

Thanks for the functional review Paul.
Code review, anyone?

Unmerged revisions

1618. By Olivier Tilloy

Do not try to un-inhibit if already un-inhibited. D'oh!

1617. By Olivier Tilloy

Do not try to un-inhibit twice.

1616. By Olivier Tilloy

More debug info.

1615. By Olivier Tilloy

Explicit is better than implicit.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'elisa-plugins/elisa/plugins/gnome/gnome_screensaver_service.py'
--- elisa-plugins/elisa/plugins/gnome/gnome_screensaver_service.py 2009-11-09 15:44:51 +0000
+++ elisa-plugins/elisa/plugins/gnome/gnome_screensaver_service.py 2010-05-14 14:39:29 +0000
@@ -106,9 +106,9 @@
106106
107 def cleaned(r):107 def cleaned(r):
108 common.application.bus.unregister(self._components_loaded)108 common.application.bus.unregister(self._components_loaded)
109 if self._pm_cookie:109 if self._pm_cookie is not None:
110 d = self._un_inhibit()110 return self._un_inhibit()
111 return d111
112 dfr.addCallback(cleaned)112 dfr.addCallback(cleaned)
113 return dfr113 return dfr
114114
@@ -153,12 +153,15 @@
153 self.debug("connected to players")153 self.debug("connected to players")
154154
155 def _playback_ended(self, player):155 def _playback_ended(self, player):
156 self.debug('%s ended playback' % player)
156 # just unInhibit157 # just unInhibit
157 self._un_inhibit()158 if self._pm_cookie is not None:
159 self._un_inhibit()
158160
159 def _player_status_cb(self, player, status):161 def _player_status_cb(self, player, status):
160 self.debug("%s changed state to %s" % (player, status))162 self.debug("%s changed state to %s" % (player, status))
161 if status == player.PLAYING and not self._pm_cookie:163 if status == player.PLAYING:
162 self._inhibit('playing media')164 if self._pm_cookie is None:
163 elif self._pm_cookie:165 self._inhibit('playing media')
166 elif self._pm_cookie is not None:
164 self._un_inhibit()167 self._un_inhibit()

Subscribers

People subscribed via source and target branches