From b3fb6aa1828a81c9f7fc19e45ebbc8344c1674d1 Mon Sep 17 00:00:00 2001 From: Carsten Tinggaard Date: Mon, 5 Jan 2009 12:33:15 +0000 Subject: [PATCH] Corrected the way application data folder is retrieved on Windows XP and Vista. Using LinRegistry on Windows bzr-revno: 267 --- openlp/core/utils/confighelper.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/openlp/core/utils/confighelper.py b/openlp/core/utils/confighelper.py index 26e764473..c9ef17fe5 100644 --- a/openlp/core/utils/confighelper.py +++ b/openlp/core/utils/confighelper.py @@ -27,8 +27,9 @@ class ConfigHelper(object): @staticmethod def get_data_path(): if os.name == 'nt': - default = os.path.join(os.path.expanduser(u'~'), - u'Application Data', u'.openlp', u'data') + # ask OS for path to application data, set on Windows XP and Vista + appdata = os.getenv('APPDATA') + default = os.path.join(appdata, u'.openlp', u'data') else: default = os.path.expanduser(u'~/.openlp/data') @@ -70,8 +71,10 @@ class ConfigHelper(object): """ reg = None if os.name == 'nt': - from winregistry import WinRegistry - reg = WinRegistry(r'\Software\openlp') + #from winregistry import WinRegistry + #reg = WinRegistry(r'\Software\openlp') + from linregistry import LinRegistry + reg = LinRegistry(os.path.join(os.getenv('APPDATA'), '.openlp')) else: from linregistry import LinRegistry reg = LinRegistry(os.path.join(os.getenv('HOME'), '.openlp'))