Move AsyncSignals from app.py to async_signals.py (no behavior change)

Step 10 of the gui/app.py + gui/preview.py structural refactor. Pure
copy: the QObject signal hub that BooruApp uses to marshal async
worker results back to the GUI thread moves to its own module. All
14 signals are preserved verbatim. app.py grows another shim line
so internal `AsyncSignals()` references in BooruApp keep working.
Shim removed in commit 14.
This commit is contained in:
pax 2026-04-08 14:36:57 -05:00
parent 702fd5ca7b
commit 9d99ecfcb5
2 changed files with 30 additions and 24 deletions

View File

@ -51,30 +51,6 @@ from .settings import SettingsDialog
log = logging.getLogger("booru")
class AsyncSignals(QObject):
"""Signals for async worker results."""
search_done = Signal(list)
search_append = Signal(list)
search_error = Signal(str)
thumb_done = Signal(int, str)
image_done = Signal(str, str)
image_error = Signal(str)
# Fast-path for uncached video posts: emit the remote URL directly
# so mpv can start streaming + decoding immediately instead of
# waiting for download_image to write the whole file to disk first.
# download_image still runs in parallel to populate the cache for
# next time. Args: (url, info, width, height) — width/height come
# from post.width/post.height for the popout pre-fit optimization.
video_stream = Signal(str, str, int, int)
bookmark_done = Signal(int, str)
bookmark_error = Signal(str)
autocomplete_done = Signal(list)
batch_progress = Signal(int, int) # current, total
batch_done = Signal(str)
download_progress = Signal(int, int) # bytes_downloaded, total_bytes
prefetch_progress = Signal(int, float) # index, progress (0-1 or -1 to hide)
# -- Info Panel --
class InfoPanel(QWidget):
@ -3577,3 +3553,4 @@ def run() -> None:
# -- Refactor compatibility shims (deleted in commit 14) --
from .search_state import SearchState # re-export for refactor compat
from .log_handler import LogHandler # re-export for refactor compat
from .async_signals import AsyncSignals # re-export for refactor compat

View File

@ -0,0 +1,29 @@
"""Qt signal hub for async worker results."""
from __future__ import annotations
from PySide6.QtCore import QObject, Signal
class AsyncSignals(QObject):
"""Signals for async worker results."""
search_done = Signal(list)
search_append = Signal(list)
search_error = Signal(str)
thumb_done = Signal(int, str)
image_done = Signal(str, str)
image_error = Signal(str)
# Fast-path for uncached video posts: emit the remote URL directly
# so mpv can start streaming + decoding immediately instead of
# waiting for download_image to write the whole file to disk first.
# download_image still runs in parallel to populate the cache for
# next time. Args: (url, info, width, height) — width/height come
# from post.width/post.height for the popout pre-fit optimization.
video_stream = Signal(str, str, int, int)
bookmark_done = Signal(int, str)
bookmark_error = Signal(str)
autocomplete_done = Signal(list)
batch_progress = Signal(int, int) # current, total
batch_done = Signal(str)
download_progress = Signal(int, int) # bytes_downloaded, total_bytes
prefetch_progress = Signal(int, float) # index, progress (0-1 or -1 to hide)