shutdown stats update timer on close

This commit is contained in:
Kovid Goyal 2022-04-29 11:26:27 +05:30
parent e40731ab34
commit efc599f328
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -4,7 +4,7 @@
import os
from qt.core import (
QCheckBox, QHBoxLayout, QLabel, QSpinBox, QTimer, QVBoxLayout, QWidget
QCheckBox, QDialog, QHBoxLayout, QLabel, QSpinBox, QTimer, QVBoxLayout, QWidget
)
from calibre import detect_ncpus
@ -88,6 +88,8 @@ class ScanStatus(QWidget):
def __init__(self, parent=None):
super().__init__(parent)
if isinstance(parent, QDialog):
parent.finished.connect(self.shutdown)
self.indexing_progress = IndexingProgress()
self.l = l = QVBoxLayout(self)
l.setContentsMargins(0, 0, 0, 0)
@ -137,6 +139,9 @@ class ScanStatus(QWidget):
def db(self):
return get_db()
def shutdown(self):
self.indexing_status_timer.stop()
if __name__ == '__main__':
from calibre.gui2 import Application
@ -146,3 +151,4 @@ if __name__ == '__main__':
w = ScanStatus()
w.show()
app.exec_()
w.shutdown()