remove unneeded "finished" signal in QThread

QThread already sends a "finished" signal when it ends. This also
solves a previously introduced bug where the signal had a signature
of one bool argument representing if there was an error or not.

This arg's inclusion was introduced in commit ea47a2e92c
but seems it was added by mistake as the slot that catches the
signal (ConvertWidget.all_done) doesn't have any arguments.

This last part in particular was introducing an error in Qt6
since the signal became a private signal, whereas Qt 5 had
defined it as a just a signal [1].

[1]: https://github.com/freedomofpress/dangerzone/pull/164#discussion_r896373680
This commit is contained in:
deeplow 2022-07-12 15:02:05 +01:00
parent bdc08d79cd
commit 7d61508099
No known key found for this signature in database
GPG key ID: 577982871529A52A

View file

@ -486,7 +486,6 @@ class SettingsWidget(QtWidgets.QWidget):
class ConvertThread(QtCore.QThread): class ConvertThread(QtCore.QThread):
is_finished = QtCore.Signal(bool)
update = QtCore.Signal(bool, str, int) update = QtCore.Signal(bool, str, int)
def __init__(self, global_common, common): def __init__(self, global_common, common):
@ -503,13 +502,12 @@ class ConvertThread(QtCore.QThread):
else: else:
ocr_lang = None ocr_lang = None
if convert( convert(
self.common.input_filename, self.common.input_filename,
self.common.output_filename, self.common.output_filename,
ocr_lang, ocr_lang,
self.stdout_callback, self.stdout_callback,
): )
self.is_finished.emit(self.error)
def stdout_callback(self, line): def stdout_callback(self, line):
try: try: