mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
...
This commit is contained in:
parent
e3bbb4a0de
commit
40b05944c2
@ -37,7 +37,10 @@ class BaseModel(QAbstractListModel):
|
|||||||
dont_remove_from=set(['toolbar-device']))
|
dont_remove_from=set(['toolbar-device']))
|
||||||
if name is None:
|
if name is None:
|
||||||
return FakeAction('--- '+_('Separator')+' ---', None)
|
return FakeAction('--- '+_('Separator')+' ---', None)
|
||||||
|
try:
|
||||||
return gui.iactions[name]
|
return gui.iactions[name]
|
||||||
|
except:
|
||||||
|
return None
|
||||||
|
|
||||||
def rowCount(self, parent):
|
def rowCount(self, parent):
|
||||||
return len(self._data)
|
return len(self._data)
|
||||||
@ -125,6 +128,7 @@ class CurrentModel(BaseModel):
|
|||||||
self.gprefs_name = 'action-layout-'+key
|
self.gprefs_name = 'action-layout-'+key
|
||||||
current = gprefs[self.gprefs_name]
|
current = gprefs[self.gprefs_name]
|
||||||
self._data = [self.name_to_action(x, gui) for x in current]
|
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.key = key
|
||||||
self.gui = gui
|
self.gui = gui
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user