mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
I messed up widgetForAction(). list.index() raises an exception, not returning -1.
This commit is contained in:
parent
140e9cd164
commit
0f822adf73
@ -667,10 +667,11 @@ class SearchToolBar(QHBoxLayout):
|
|||||||
self.setup_tool_button(self, qact, act.popup_type)
|
self.setup_tool_button(self, qact, act.popup_type)
|
||||||
|
|
||||||
def widgetForAction(self, action):
|
def widgetForAction(self, action):
|
||||||
dex = self.search_tool_bar_actions.index(action)
|
try:
|
||||||
if dex < 0:
|
dex = self.search_tool_bar_actions.index(action)
|
||||||
|
return self.search_tool_bar_widgets[dex]
|
||||||
|
except Exception:
|
||||||
return None
|
return None
|
||||||
return self.search_tool_bar_widgets[dex]
|
|
||||||
|
|
||||||
def setup_tool_button(self, bar, ac, menu_mode=None):
|
def setup_tool_button(self, bar, ac, menu_mode=None):
|
||||||
widget = self.widgetForAction(ac)
|
widget = self.widgetForAction(ac)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user