From a886b037618b06659e3ddecdbfb0b962134e2a2a Mon Sep 17 00:00:00 2001 From: Tomeu Vizoso Date: Thu, 17 Jan 2008 22:03:59 +0000 Subject: #1396: Use the bundle path to check if we should suspend on idle. (rwh) --- diff --git a/NEWS b/NEWS index 28c4e60..b3f4d0c 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,5 @@ +* #1396: Use the bundle path to check if we should suspend on idle. (rwh) + 40 * Fix zoom to width (tomeu), #5866 diff --git a/readactivity.py b/readactivity.py index c742a42..4db55ea 100644 --- a/readactivity.py +++ b/readactivity.py @@ -124,7 +124,8 @@ class ReadActivity(activity.Activity): self.unused_download_tubes = set() self._want_document = True - if os.path.exists(os.path.expanduser("~/ebook-enable-sleep")): + fname = os.path.join(activity.get_bundle_path(), 'ebook-enable-sleep') + if os.path.exists(fname): try: bus = dbus.SystemBus() proxy = bus.get_object(_HARDWARE_MANAGER_SERVICE, @@ -135,8 +136,12 @@ class ReadActivity(activity.Activity): self.connect("focus-in-event", self._focus_in_event_cb) self.connect("focus-out-event", self._focus_out_event_cb) self.connect("notify::active", self._now_active_cb) + + logging.debug('Suspend on idle enabled') except dbus.DBusException, e: _logger.info('Hardware manager service not found, no idle suspend.') + else: + logging.debug('Suspend on idle disabled') self.connect("shared", self._shared_cb) -- cgit v0.9.1