windows igen

This commit is contained in:
2026-04-12 12:15:48 +02:00
parent 564122df0a
commit 358aeca7c8
2 changed files with 19 additions and 3 deletions

View File

@@ -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)

View File

@@ -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