Skip to content

Commit

Permalink
Use commandline config path if provided when opening in explorer (PR #…
Browse files Browse the repository at this point in the history
…10911)

If NVDA config path is overridden on the command line and the user tries to open configuration directory via globalCommands the wrong profile is opened.

Fix:
globalVars.appArgs.configPath is used to retrieve actual config path falling back to config.getUserDefaultConfigPath() if the argument is not available. 
It may not be available if NVDA_slave is trying to open the directory.
  • Loading branch information
lukaszgo1 authored Mar 30, 2020
1 parent e27e907 commit 47bf1df
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions source/systemUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,18 @@
import winUser
import os


def openUserConfigurationDirectory():
"""Opens directory containing config files for the current user"""
import config
path = config.getUserDefaultConfigPath()
if not path:
raise ValueError("no user default config path")
config.initConfigPath(path)
import globalVars
try:
# configPath is guaranteed to be correct for NVDA, however it will not exist for NVDA_slave.
path = globalVars.appArgs.configPath
except AttributeError:
import config
path = config.getUserDefaultConfigPath()
if not path:
raise ValueError("no user default config path")
config.initConfigPath(path)
shellapi.ShellExecute(0, None, path, None, None, winUser.SW_SHOWNORMAL)


Expand Down

0 comments on commit 47bf1df

Please sign in to comment.