Seprate data/config dirs on Windows.

See #21.
This commit is contained in:
Florian Bruhin 2014-10-02 22:12:45 +02:00
parent 086de1b508
commit e74fa71a0a

View File

@ -213,6 +213,14 @@ def get_standard_dir(typ, args=None):
# WORKAROUND - see # WORKAROUND - see
# https://bugreports.qt-project.org/browse/QTBUG-38872 # https://bugreports.qt-project.org/browse/QTBUG-38872
path = os.path.join(path, appname) path = os.path.join(path, appname)
if typ == QStandardPaths.DataLocation and os.name == 'nt':
# Under windows, config/data might end up in the same directory.
data_path = QStandardPaths.writableLocation(
QStandardPaths.DataLocation)
config_path = QStandardPaths.writableLocation(
QStandardPaths.ConfigLocation)
if data_path == config_path:
path = os.path.join(path, 'data')
if not os.path.exists(path): if not os.path.exists(path):
os.makedirs(path) os.makedirs(path)
return path return path