Missing arguments in some event handler functions

Bug #1296574 reported by Samuel Mehrbrodt
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenLP
Fix Released
High
Samuel Mehrbrodt

Bug Description

I recently upgraded to Ubuntu 14.04 (Python 3.4, Qt 4.8, PyQt 4.10) and now get exceptions on certain actions.
For example when sending a song to live, I get the following exception:

Traceback (most recent call last):
  File "/home/samuel/programming/openlp/trunk/openlp/core/common/openlpmixin.py", line 67, in wrapped
    raise e
  File "/home/samuel/programming/openlp/trunk/openlp/core/common/openlpmixin.py", line 63, in wrapped
    return func(*args, **kwargs)
TypeError: on_go_live() takes 1 positional argument but 2 were given

The same happens with some other functions that are bound to Qt Events and don't expect any parameters.

Related branches

Revision history for this message
Samuel Mehrbrodt (sam92) wrote :

This happens in trunk btw.

Revision history for this message
Tim Bentley (trb143) wrote :

just add "field=none" to the method. That fixes it.

Revision history for this message
Samuel Mehrbrodt (sam92) wrote :

Hm this happens only when I start OpenLP with "./openlp.py -l debug".
Without the debug option I don't have any problems.

Any idea why?

Revision history for this message
Tim Bentley (trb143) wrote :

No it has baffled. me.

OpenLPMixin dynamically adds debug wrappers to all (except black list) methods in the class.
No more Log.debug.

This only happens if debug is enabled. This works fine for all methods except pyqt ones which need the extra parameter.
You must have found the odd one I messed in testing.

Tim Bentley (trb143)
Changed in openlp:
importance: Undecided → High
status: New → Fix Committed
assignee: nobody → Samuel Mehrbrodt (sam92)
milestone: none → 2.1.1
Revision history for this message
Erik Lundin (erik-lundin) wrote :

The problem seems to be that the signal QAction::triggered emits with one argument (checked):

http://qt-project.org/doc/qt-4.8/qaction.html#triggered

Tim Bentley (trb143)
Changed in openlp:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.