Fix starting with -c "".

This is a regression introduced in 9b1729c77e.
This commit is contained in:
Florian Bruhin 2015-02-12 13:24:17 +01:00
parent 5a73f5d2c1
commit 0b55f4df77

View File

@ -140,11 +140,12 @@ def init(args):
sys.exit(1)
else:
objreg.register('config', config_obj)
filename = os.path.join(confdir, 'qutebrowser.conf')
save_manager.add_saveable('config', config_obj.save,
config_obj.changed,
config_opt=('general', 'auto-save-config'),
filename=filename)
if confdir is not None:
filename = os.path.join(confdir, 'qutebrowser.conf')
save_manager.add_saveable('config', config_obj.save,
config_obj.changed,
config_opt=('general', 'auto-save-config'),
filename=filename)
try:
key_config = keyconf.KeyConfigParser(confdir, 'keys.conf')
except (keyconf.KeyConfigError, UnicodeDecodeError) as e:
@ -160,11 +161,12 @@ def init(args):
sys.exit(1)
else:
objreg.register('key-config', key_config)
filename = os.path.join(confdir, 'keys.conf')
save_manager.add_saveable('key-config', key_config.save,
key_config.changed,
config_opt=('general', 'auto-save-config'),
filename=filename)
if confdir is not None:
filename = os.path.join(confdir, 'keys.conf')
save_manager.add_saveable('key-config', key_config.save,
key_config.changed,
config_opt=('general', 'auto-save-config'),
filename=filename)
datadir = standarddir.get(QStandardPaths.DataLocation, args)
state_config = ini.ReadWriteConfigParser(datadir, 'state')