fix wrong spaces and priority for session restore

This commit is contained in:
Cosmin Popescu 2016-11-09 19:27:48 +01:00
parent c590a37043
commit 89e6ff6599
2 changed files with 7 additions and 7 deletions

View File

@ -211,16 +211,16 @@ def _load_session(name):
""" """
state_config = objreg.get('state-config') state_config = objreg.get('state-config')
session_manager = objreg.get('session-manager') session_manager = objreg.get('session-manager')
if name is None: if name is None and session_manager.exists('_autosave'):
name = '_autosave'
elif name is None:
try: try:
name = state_config['general']['session'] name = state_config['general']['session']
except KeyError: except KeyError:
# No session given as argument and none in the session file -> # No session given as argument and none in the session file ->
# start without loading a session # start without loading a session
if session_manager.exists('_autosave'):
name = '_autosave'
else:
return return
try: try:
session_manager.load(name) session_manager.load(name)
except sessions.SessionNotFoundError: except sessions.SessionNotFoundError: