From 358aeca7c824507f81ce250473e71d826ecf31c3 Mon Sep 17 00:00:00 2001 From: Carsten Kvist Date: Sun, 12 Apr 2026 12:15:48 +0200 Subject: [PATCH] windows igen --- linedance-app/local/file_watcher.py | 12 +++++++++--- linedance-app/main.py | 10 ++++++++++ 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/linedance-app/local/file_watcher.py b/linedance-app/local/file_watcher.py index f47ef0e0..c13bad85 100644 --- a/linedance-app/local/file_watcher.py +++ b/linedance-app/local/file_watcher.py @@ -368,13 +368,19 @@ class LibraryWatcher: except Exception as e: logger.error(f"Scan fejl: {library_path}: {e}") - def _path_accessible(self, path: Path, timeout_sec: float = 5.0) -> bool: + def _path_accessible(self, path: Path, timeout_sec: float = 8.0) -> bool: """Tjek om en sti er tilgængelig inden for timeout.""" - import threading result = [False] def check(): try: - result[0] = path.exists() and path.is_dir() + import os, sys + p = str(path) + if sys.platform == "win32" and (p.startswith("\\\\") or p.startswith("//")): + # UNC-stier på Windows — brug listdir der fungerer bedre + os.listdir(p) + result[0] = True + else: + result[0] = path.exists() and path.is_dir() except Exception: result[0] = False t = threading.Thread(target=check, daemon=True) diff --git a/linedance-app/main.py b/linedance-app/main.py index 879ad6fa..bca49377 100644 --- a/linedance-app/main.py +++ b/linedance-app/main.py @@ -20,6 +20,16 @@ def main(): app.setApplicationName("LineDance Player") app.setOrganizationName("LineDance") + # Undertrryk ufarlige Qt Windows-advarsler i konsollen + import sys as _sys + if _sys.platform == "win32": + from PyQt6.QtCore import qInstallMessageHandler, QtMsgType + def _qt_msg_handler(msg_type, context, message): + if "registerTimer" in message or "Unhandled scheme" in message: + return # ignorer + print(message) + qInstallMessageHandler(_qt_msg_handler) + # Indlæs sprog fra indstillinger from ui.settings_dialog import load_settings from translations import load_language