avatar reset bug fixed

This commit is contained in:
ingvar1995 2016-05-02 21:54:32 +03:00
parent 89c4b2cdf6
commit ac1800703f

View File

@ -16,7 +16,7 @@ TOX_FILE_TRANSFER_STATE = {
class StateSignal(QtCore.QObject): class StateSignal(QtCore.QObject):
signal = QtCore.Signal(int, float) signal = QtCore.Signal(int, float) # state and progress
class FileTransfer(QtCore.QObject): class FileTransfer(QtCore.QObject):
@ -98,6 +98,7 @@ class SendTransfer(FileTransfer):
self._done += size self._done += size
self._state_changed.signal.emit(self.state, self._done / self._size) self._state_changed.signal.emit(self.state, self._done / self._size)
else: else:
if hasattr(self, '_file'):
self._file.close() self._file.close()
self.state = TOX_FILE_TRANSFER_STATE['FINISHED'] self.state = TOX_FILE_TRANSFER_STATE['FINISHED']
self._state_changed.signal.emit(self.state, 1) self._state_changed.signal.emit(self.state, 1)