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

EGLSync: Don't test input in egl_path_edit on Windows

This commit is contained in:
Stelios Tsampas 2021-11-21 18:59:37 +02:00
parent e6b67f50f7
commit bcae6cb7fd
No known key found for this signature in database
GPG key ID: 2FAEBF7B5BE5FD7C

View file

@ -81,13 +81,12 @@ class EGLSyncGroup(QGroupBox, Ui_EGLSyncGroup):
def egl_path_edit_edit_cb(path) -> Tuple[bool, str]:
if not path:
return True, path
if platform.system() != "Windows":
if os.path.exists(os.path.join(path, 'system.reg')) and os.path.exists(os.path.join(path, 'dosdevices/c:')):
# path is a wine prefix
path = os.path.join(path, 'dosdevices/c:', 'ProgramData/Epic/EpicGamesLauncher/Data/Manifests')
elif not path.rstrip('/').endswith('ProgramData/Epic/EpicGamesLauncher/Data/Manifests'):
# lower() might or might not be needed in the check
return False, path
if os.path.exists(os.path.join(path, 'system.reg')) and os.path.exists(os.path.join(path, 'dosdevices/c:')):
# path is a wine prefix
path = os.path.join(path, 'dosdevices/c:', 'ProgramData/Epic/EpicGamesLauncher/Data/Manifests')
elif not path.rstrip('/').endswith('ProgramData/Epic/EpicGamesLauncher/Data/Manifests'):
# lower() might or might not be needed in the check
return False, path
if os.path.exists(path):
return True, path
return False, path