Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions Orange/widgets/data/owcsvimport.py
Original file line number Diff line number Diff line change
Expand Up @@ -831,8 +831,8 @@ def commit(self):
task = state = TaskState()
state.future = ...
state.watcher = qconcurrent.FutureWatcher()
state.progressChanged.connect(self.__set_read_progress,
Qt.QueuedConnection)
state.progressChanged.connect(
self.__set_read_progress, Qt.DirectConnection)

def progress_(i, j):
task.emitProgressChangedOrCancel(i, j)
Expand Down Expand Up @@ -1298,9 +1298,16 @@ class UserCancelException(BaseException):
#: progress state, second value is the total progress to complete
#: (-1 if unknown)
progressChanged = Signal('qint64', 'qint64')
__progressChanged = Signal('qint64', 'qint64')
#: Was cancel requested.
cancel = False

def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
# route the signal via this object's queue
self.__progressChanged.connect(
self.progressChanged, Qt.QueuedConnection)

def emitProgressChangedOrCancel(self, current, total):
# type: (int, int) -> None
"""
Expand All @@ -1309,7 +1316,7 @@ def emitProgressChangedOrCancel(self, current, total):
if self.cancel:
raise TaskState.UserCancelException()
else:
self.progressChanged.emit(current, total)
self.__progressChanged.emit(current, total)


class TextReadWrapper(io.TextIOWrapper):
Expand Down