Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit010eb94

Browse files
committed
fix(windows-desktops): add error handling for wallpaper setting functions
Added try-except blocks to handle exceptions when setting wallpapers for individual and all desktops. This improves robustness by logging errors without crashing the application.
1 parent8488f4f commit010eb94

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

‎src/core/widgets/yasb/windows_desktops.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,10 @@ def set_wallpaper(self):
108108
"Images (*.png *.jpg *.jpeg *.bmp *.gif)"
109109
)
110110
ifimage_path:
111-
VirtualDesktop(self.workspace_index).set_wallpaper(image_path)
111+
try:
112+
VirtualDesktop(self.workspace_index).set_wallpaper(image_path)
113+
exceptExceptionase:
114+
logging.exception(f"Failed to set wallpaper:{e}")
112115

113116
defset_wallpaper_all(self):
114117
image_path,_=QFileDialog.getOpenFileName(
@@ -118,7 +121,10 @@ def set_wallpaper_all(self):
118121
"Images (*.png *.jpg *.jpeg *.bmp *.gif)"
119122
)
120123
ifimage_path:
121-
set_wallpaper_for_all_desktops(image_path)
124+
try:
125+
set_wallpaper_for_all_desktops(image_path)
126+
exceptExceptionase:
127+
logging.exception(f"Failed to set wallpaper for all desktops:{e}")
122128

123129
defrename_desktop(self):
124130
dialog=QInputDialog(self)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp