Reset last view defaults if number of categories changes

svn: r15053
This commit is contained in:
Nick Hall 2010-04-07 18:23:45 +00:00
parent 8e0381b64e
commit 483d2dd7ff

View File

@ -172,6 +172,9 @@ class CategorySidebar(BaseSidebar):
view_id = self.views[cat_num][view_num][0].id
config.set('preferences.last-view', view_id)
last_views = config.get('preferences.last-views')
if len(last_views) != len(self.views):
# If the number of categories has changed then reset the defaults
last_views = [''] * len(self.views)
last_views[cat_num] = view_id
config.set('preferences.last-views', last_views)
config.save()