From 6db67ee4458b7699e29dad7a9688dd36878a7464 Mon Sep 17 00:00:00 2001 From: claudi Date: Wed, 28 Jan 2026 11:43:31 +0100 Subject: [PATCH] bugfixes --- src/webdrop_bridge/core/drag_interceptor.py | 6 ++---- src/webdrop_bridge/main.py | 4 ++-- src/webdrop_bridge/ui/main_window.py | 6 +++--- src/webdrop_bridge/ui/restricted_web_view.py | 2 +- tests/unit/test_logging.py | 1 + 5 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/webdrop_bridge/core/drag_interceptor.py b/src/webdrop_bridge/core/drag_interceptor.py index d3c1dc0..14502b5 100644 --- a/src/webdrop_bridge/core/drag_interceptor.py +++ b/src/webdrop_bridge/core/drag_interceptor.py @@ -3,8 +3,8 @@ from pathlib import Path from typing import List, Optional -from PySide6.QtCore import Qt, Signal -from PySide6.QtGui import QDrag, QMimeData +from PySide6.QtCore import QMimeData, Qt, QUrl, Signal +from PySide6.QtGui import QDrag from PySide6.QtWidgets import QWidget from webdrop_bridge.core.validator import PathValidator, ValidationError @@ -102,5 +102,3 @@ class DragInterceptor(QWidget): return False -# Import QUrl here to avoid circular import at module level -from PySide6.QtCore import QUrl # noqa: E402, F401 diff --git a/src/webdrop_bridge/main.py b/src/webdrop_bridge/main.py index e2941c2..4c6e69a 100644 --- a/src/webdrop_bridge/main.py +++ b/src/webdrop_bridge/main.py @@ -25,8 +25,8 @@ def main() -> int: # Set up logging log_file = None - if config.log_file_path: - log_file = Path(config.log_file_path) + if config.log_file: + log_file = config.log_file setup_logging( name="webdrop_bridge", diff --git a/src/webdrop_bridge/ui/main_window.py b/src/webdrop_bridge/ui/main_window.py index 19002c3..41adb2d 100644 --- a/src/webdrop_bridge/ui/main_window.py +++ b/src/webdrop_bridge/ui/main_window.py @@ -151,13 +151,13 @@ class MainWindow(QMainWindow): # Back button back_action = self.web_view.pageAction( - self.web_view.WebAction.Back + self.web_view.WebAction.Back # type: ignore ) toolbar.addAction(back_action) # Forward button forward_action = self.web_view.pageAction( - self.web_view.WebAction.Forward + self.web_view.WebAction.Forward # type: ignore ) toolbar.addAction(forward_action) @@ -170,7 +170,7 @@ class MainWindow(QMainWindow): # Refresh button refresh_action = self.web_view.pageAction( - self.web_view.WebAction.Reload + self.web_view.WebAction.Reload # type: ignore ) toolbar.addAction(refresh_action) diff --git a/src/webdrop_bridge/ui/restricted_web_view.py b/src/webdrop_bridge/ui/restricted_web_view.py index d61045f..0ef6db2 100644 --- a/src/webdrop_bridge/ui/restricted_web_view.py +++ b/src/webdrop_bridge/ui/restricted_web_view.py @@ -39,7 +39,7 @@ class RestrictedWebEngineView(QWebEngineView): Args: request: Navigation request to process """ - url = request.url + url = request.url() # If no restrictions, allow all URLs if not self.allowed_urls: diff --git a/tests/unit/test_logging.py b/tests/unit/test_logging.py index d2c7d52..ab9c316 100644 --- a/tests/unit/test_logging.py +++ b/tests/unit/test_logging.py @@ -1,6 +1,7 @@ """Unit tests for logging module.""" import logging +import logging.handlers from pathlib import Path from tempfile import TemporaryDirectory