Skip to content

Commit 8a8352a

Browse files
applied patch from Sönke Schwardt for Qt notifier and set version to 0.9.7
1 parent cfb5827 commit 8a8352a

File tree

3 files changed

+21
-4
lines changed

3 files changed

+21
-4
lines changed

ChangeLog

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
2014-12-25 Andreas Büsching <crunchy@bitkipper.net>
2+
3+
* notifier/version.py: set version to 0.9.7
4+
5+
2014-12-25 Andreas Büsching <crunchy@bitkipper.net>
6+
7+
* notifier/nf_qt.py: applied patch from Sönke Schwardt-Krummrich
8+
<schwardt@univention.de> fixing problems with timer_add if there
9+
is no QCoreApplication instance
10+
111
2014-07-03 Andreas Büsching <crunchy@bitkipper.net>
212

313
* examples/test-twisted.py: demonstrate usage of dispatcher and
@@ -20,7 +30,7 @@
2030
remove unneeded globals; fix check for None (== None → is None)
2131
fix stopping of loop when timer returns falsy value
2232
fix typo in example script
23-
33+
2434
2012-03-31 Andreas Büsching <crunchy@bitkipper.net>
2535

2636
* notifier/version.py: set version to 0.9.5

notifier/nf_qt.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#
66
# QT notifier wrapper
77
#
8-
# Copyright (C) 2004, 2005, 2006, 2007
8+
# Copyright (C) 2004, 2005, 2006, 2007, 2014
99
# Andreas Büsching <crunchy@bitkipper.net>
1010
#
1111
# This library is free software; you can redistribute it and/or modify
@@ -43,6 +43,9 @@
4343
__min_timer = None
4444
__exit = None
4545

46+
class NotifierErrorQtApplicationUnset(Exception):
47+
pass
48+
4649
def _get_fd( obj ):
4750
"""Returns a file descriptor. obj can be a file descriptor or an
4851
object of type socket.socket, file or socket._socketobject"""
@@ -69,7 +72,11 @@ def notified( self, socket ):
6972

7073
class Timer( qt.QTimer ):
7174
def __init__( self, ms, method ):
72-
qt.QTimer.__init__( self )
75+
if qt.QCoreApplication.instance() is None:
76+
# create a new Qt Application instance before calling timer_add, e.g.
77+
# app = qt.QCoreApplication([])
78+
raise NotifierErrorQtApplicationUnset()
79+
qt.QTimer.__init__(self, qt.QCoreApplication.instance())
7380
self.method = method
7481
self.timeout.connect( self.slotTick )
7582
self.start( ms )

notifier/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
major_number = 0
2626
minor_number = 9
27-
revision_number = 6
27+
revision_number = 7
2828
extension = ''
2929

3030
VERSION = "%d.%d.%d%s" % ( major_number, minor_number,

0 commit comments

Comments
 (0)