Replace some QTimers by named Timers.
This commit is contained in:
parent
370c182f48
commit
5ed592a447
@ -170,7 +170,7 @@ class DownloadItem(QObject):
|
|||||||
_redirects: How many time we were redirected already.
|
_redirects: How many time we were redirected already.
|
||||||
_buffer: A BytesIO object to buffer incoming data until we know the
|
_buffer: A BytesIO object to buffer incoming data until we know the
|
||||||
target file.
|
target file.
|
||||||
_read_timer: A QTimer which reads the QNetworkReply into self._buffer
|
_read_timer: A Timer which reads the QNetworkReply into self._buffer
|
||||||
periodically.
|
periodically.
|
||||||
_win_id: The window ID the DownloadItem runs in.
|
_win_id: The window ID the DownloadItem runs in.
|
||||||
|
|
||||||
@ -209,7 +209,7 @@ class DownloadItem(QObject):
|
|||||||
self.autoclose = True
|
self.autoclose = True
|
||||||
self.reply = None
|
self.reply = None
|
||||||
self._buffer = io.BytesIO()
|
self._buffer = io.BytesIO()
|
||||||
self._read_timer = QTimer()
|
self._read_timer = usertypes.Timer(self, name='download-read-timer')
|
||||||
self._read_timer.setInterval(500)
|
self._read_timer.setInterval(500)
|
||||||
self._read_timer.timeout.connect(self.on_read_timer_timeout)
|
self._read_timer.timeout.connect(self.on_read_timer_timeout)
|
||||||
self._redirects = 0
|
self._redirects = 0
|
||||||
|
@ -22,11 +22,11 @@
|
|||||||
import os.path
|
import os.path
|
||||||
import collections
|
import collections
|
||||||
|
|
||||||
from PyQt5.QtCore import pyqtSlot, QObject, QTimer
|
from PyQt5.QtCore import pyqtSlot, QObject
|
||||||
|
|
||||||
from qutebrowser.config import config
|
from qutebrowser.config import config
|
||||||
from qutebrowser.commands import cmdutils
|
from qutebrowser.commands import cmdutils
|
||||||
from qutebrowser.utils import utils, log, message, objreg
|
from qutebrowser.utils import utils, log, message, objreg, usertypes
|
||||||
|
|
||||||
|
|
||||||
class Saveable:
|
class Saveable:
|
||||||
@ -105,13 +105,13 @@ class SaveManager(QObject):
|
|||||||
|
|
||||||
Attributes:
|
Attributes:
|
||||||
saveables: A dict mapping names to Saveable instances.
|
saveables: A dict mapping names to Saveable instances.
|
||||||
_save_timer: The QTimer used to periodically auto-save things.
|
_save_timer: The Timer used to periodically auto-save things.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, parent=None):
|
def __init__(self, parent=None):
|
||||||
super().__init__(parent)
|
super().__init__(parent)
|
||||||
self.saveables = collections.OrderedDict()
|
self.saveables = collections.OrderedDict()
|
||||||
self._save_timer = QTimer(self)
|
self._save_timer = usertypes.Timer(self, name='save-timer')
|
||||||
self._save_timer.timeout.connect(self.autosave)
|
self._save_timer.timeout.connect(self.autosave)
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user