Catch empty standard paths

This commit is contained in:
Florian Bruhin 2014-05-27 16:28:01 +02:00
parent 161b2ef7af
commit 0253dd6977

View File

@ -217,8 +217,9 @@ def get_standard_dir(typ):
# but we don't want that to happen. # but we don't want that to happen.
qapp.setOrganizationName(None) qapp.setOrganizationName(None)
try: try:
# FIXME RuntimeLocation "can be empty on some systems", wat.
path = QStandardPaths.writableLocation(typ) path = QStandardPaths.writableLocation(typ)
if not path:
raise ValueError("QStandardPaths returned an empty value!")
# Qt seems to use '/' as path separator even on Windows... # Qt seems to use '/' as path separator even on Windows...
path = path.replace('/', os.sep) path = path.replace('/', os.sep)
appname = qapp.applicationName() appname = qapp.applicationName()