Fix compat for older versions of GObject

Older versions of GObject had the "user data" parameter of most signal
handlers marked as required, some value had to be passed in, even if it
wasn't necessary.
master
Dustin C. Hatch 2014-08-06 16:02:38 -05:00
parent feadbbdcbb
commit 40e7f99aa3
1 changed files with 4 additions and 4 deletions

View File

@ -166,7 +166,7 @@ class Notifier(object):
'XF86AudioPrev': self.client.previous, 'XF86AudioPrev': self.client.previous,
'XF86AudioStop': self.client.stop, 'XF86AudioStop': self.client.stop,
} }
def callback(keystring): def callback(keystring, data=None):
self.client.noidle() self.client.noidle()
try: try:
handlers[keystring]() handlers[keystring]()
@ -175,7 +175,7 @@ class Notifier(object):
self.client.send_idle('player') self.client.send_idle('player')
Keybinder.init() Keybinder.init()
for key in handlers.keys(): for key in handlers.keys():
Keybinder.bind(key, callback) Keybinder.bind(key, callback, None)
def connect(self): def connect(self):
self.client._sock = None self.client._sock = None
@ -305,12 +305,12 @@ def main():
notifier.bind_keys() notifier.bind_keys()
notifier.start() notifier.start()
def quit(): def quit(data=None):
notifier.stop() notifier.stop()
Gtk.main_quit() Gtk.main_quit()
raise SystemExit raise SystemExit
for s in (signal.SIGINT, signal.SIGTERM): for s in (signal.SIGINT, signal.SIGTERM):
GLib.unix_signal_add(GLib.PRIORITY_DEFAULT, s, quit) GLib.unix_signal_add(GLib.PRIORITY_DEFAULT, s, quit, None)
Gtk.main() Gtk.main()