Fix problem with plugin registration. If a plugin disappears without being correctly removed, then building the current action set threw an exception. The only way around it was to hack the preferences. The fix simply ignores missing actions.

This commit is contained in:
Charles Haley 2011-01-12 11:13:14 +00:00
parent bf183471ea
commit b09b3fc993

View File

@ -37,7 +37,10 @@ class BaseModel(QAbstractListModel):
dont_remove_from=set(['toolbar-device']))
if name is None:
return FakeAction('--- '+_('Separator')+' ---', None)
try:
return gui.iactions[name]
except:
return None
def rowCount(self, parent):
return len(self._data)
@ -125,6 +128,7 @@ class CurrentModel(BaseModel):
self.gprefs_name = 'action-layout-'+key
current = gprefs[self.gprefs_name]
self._data = [self.name_to_action(x, gui) for x in current]
self._data = [x for x in self._data if x is not None]
self.key = key
self.gui = gui