1
0
Fork 0
mirror of synced 2024-06-28 11:11:15 +12:00

Fix missed path validity check

This commit is contained in:
Stelios Tsampas 2021-10-15 23:51:53 +03:00 committed by Dummerle
parent d0c676d44a
commit 3065105365
No known key found for this signature in database
GPG key ID: AB68CC59CA39F2F1

View file

@ -108,11 +108,10 @@ class EGLSyncGroup(QGroupBox, Ui_EGLSyncGroup):
if not path:
return True, path
if platform.system() != "Windows":
path = path.rstrip('/')
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.endswith('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):
@ -145,12 +144,12 @@ class EGLSyncGroup(QGroupBox, Ui_EGLSyncGroup):
self.core.lgd.config.remove_option('Legendary', 'egl_sync')
else:
self.core.lgd.config.set('Legendary', 'egl_sync', str(True))
self.core.egl_sync()
self.update_lists()
# self.core.egl_sync()
# self.update_lists()
self.core.lgd.save_config()
def update_lists(self):
have_path = bool(shared.core.egl.programdata_path)
have_path = bool(shared.core.egl.programdata_path) and self.egl_path_edit.is_valid
self.egl_sync_label.setEnabled(have_path)
self.egl_sync_check.setEnabled(have_path)