windows igen
This commit is contained in:
@@ -368,12 +368,18 @@ class LibraryWatcher:
|
|||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error(f"Scan fejl: {library_path}: {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."""
|
"""Tjek om en sti er tilgængelig inden for timeout."""
|
||||||
import threading
|
|
||||||
result = [False]
|
result = [False]
|
||||||
def check():
|
def check():
|
||||||
try:
|
try:
|
||||||
|
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()
|
result[0] = path.exists() and path.is_dir()
|
||||||
except Exception:
|
except Exception:
|
||||||
result[0] = False
|
result[0] = False
|
||||||
|
|||||||
@@ -20,6 +20,16 @@ def main():
|
|||||||
app.setApplicationName("LineDance Player")
|
app.setApplicationName("LineDance Player")
|
||||||
app.setOrganizationName("LineDance")
|
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
|
# Indlæs sprog fra indstillinger
|
||||||
from ui.settings_dialog import load_settings
|
from ui.settings_dialog import load_settings
|
||||||
from translations import load_language
|
from translations import load_language
|
||||||
|
|||||||
Reference in New Issue
Block a user