mirror of
https://gitlab.com/openlp/openlp.git
synced 2024-12-09 14:42:50 +00:00
Merge branch 'deadlock-issue-in-api' into 'master'
Fix deadlock issue in Web API. See merge request openlp/openlp!777
This commit is contained in:
commit
d57cfd816b
@ -109,7 +109,6 @@ def login():
|
||||
def main_image():
|
||||
live_controller = Registry().get('live_controller')
|
||||
img_data = live_controller.staticMetaObject.invokeMethod(
|
||||
live_controller, 'grab_maindisplay', QtCore.Qt.ConnectionType.BlockingQueuedConnection,
|
||||
QtCore.Q_RETURN_ARG(str))
|
||||
live_controller, 'grab_maindisplay', QtCore.Qt.ConnectionType.DirectConnection, QtCore.Q_RETURN_ARG(str))
|
||||
img = 'data:image/jpeg;base64,{}'.format(img_data)
|
||||
return jsonify({'binary_image': img})
|
||||
|
@ -46,7 +46,7 @@ def search(plugin_name, text):
|
||||
if hasattr(plugin.media_item.search, '__pyqtSignature__'):
|
||||
# If this method has a signature, it means that it should be called from the parent thread
|
||||
results = plugin.media_item.staticMetaObject.invokeMethod(
|
||||
plugin.media_item, 'search', QtCore.Qt.ConnectionType.BlockingQueuedConnection,
|
||||
plugin.media_item, 'search', QtCore.Qt.ConnectionType.DirectConnection,
|
||||
QtCore.Q_RETURN_ARG(list), QtCore.Q_ARG(str, text), QtCore.Q_ARG(bool, False))
|
||||
else:
|
||||
# Fall back to original behaviour
|
||||
|
@ -54,7 +54,7 @@ def test_search_threaded(registry, settings):
|
||||
invoke_call = mocked_songs_plugin.media_item.staticMetaObject.invokeMethod.call_args_list[0]
|
||||
assert invoke_call.args[0] is mocked_songs_plugin.media_item
|
||||
assert invoke_call.args[1] == 'search'
|
||||
assert invoke_call.args[2] == QtCore.Qt.ConnectionType.BlockingQueuedConnection
|
||||
assert invoke_call.args[2] == QtCore.Qt.ConnectionType.DirectConnection
|
||||
|
||||
|
||||
def test_search_unthreaded(registry, settings):
|
||||
|
Loading…
Reference in New Issue
Block a user