1
0
Fork 0
mirror of synced 2024-06-26 10:11:19 +12:00

Use QStandardPaths instead of guessing ~/Desktop

This commit is contained in:
MultisampledNight 2022-03-30 20:34:49 +02:00
parent 0ba2ce8fdc
commit 30361eb4bb
No known key found for this signature in database
GPG key ID: 02B1BAF6A675FF9B

View file

@ -16,6 +16,7 @@ from PyQt5.QtCore import (
QObject,
QRunnable,
QSettings,
QStandardPaths,
Qt,
QFile,
QDir,
@ -282,7 +283,7 @@ def create_rare_desktop_link(type_of_link):
elif platform.system() == "Windows":
# Target of shortcut
if type_of_link == "desktop":
target_folder = os.path.expanduser("~/Desktop/")
target_folder = QStandardPaths.writableLocation(QStandardPaths.DesktopLocation)
elif type_of_link == "start_menu":
target_folder = os.path.expandvars("%appdata%/Microsoft/Windows/Start Menu")
else: