Adjustment to make pyflakes happy re: timer
All checks were successful
CI / test (push) Successful in 5m48s
Lint / test (push) Successful in 33s
Trivy / test (push) Successful in 24s

This commit is contained in:
Miguel Jacq 2025-12-03 17:44:25 +11:00
parent 9ded9b4a10
commit 28c0dd761f
Signed by: mig5
GPG key ID: 59B3F0C24135C6A9

View file

@ -3,7 +3,7 @@ from __future__ import annotations
import math import math
from typing import Optional from typing import Optional
from PySide6.QtCore import Qt, QTimer, Signal, Slot, QSignalBlocker from PySide6.QtCore import Qt, QTimer, Signal, Slot
from PySide6.QtWidgets import ( from PySide6.QtWidgets import (
QFrame, QFrame,
QVBoxLayout, QVBoxLayout,
@ -167,9 +167,12 @@ class PomodoroManager:
# Untoggle the toolbar button without retriggering the slot # Untoggle the toolbar button without retriggering the slot
tool_bar = getattr(self._parent, "toolBar", None) tool_bar = getattr(self._parent, "toolBar", None)
if tool_bar is not None and hasattr(tool_bar, "actTimer"): if tool_bar is not None and hasattr(tool_bar, "actTimer"):
blocker = QSignalBlocker(tool_bar.actTimer) action = tool_bar.actTimer
tool_bar.actTimer.setChecked(False) was_blocked = action.blockSignals(True)
del blocker try:
action.setChecked(False)
finally:
action.blockSignals(was_blocked)
# Remove the embedded widget # Remove the embedded widget
self.cancel_timer() self.cancel_timer()