Revert change to _count
Adds a specific check for only -1 in _current_index
This commit is contained in:
parent
dbfd9c1f2e
commit
b7bb774bee
|
|
@ -62,10 +62,7 @@ class CommandDispatcher:
|
|||
|
||||
def _count(self) -> int:
|
||||
"""Convenience method to get the widget count."""
|
||||
count = self._tabbed_browser.widget.count()
|
||||
if count < 0:
|
||||
raise cmdutils.CommandError("No WebView available yet!")
|
||||
return count
|
||||
return self._tabbed_browser.widget.count()
|
||||
|
||||
def _set_current_index(self, idx):
|
||||
"""Convenience method to set the current widget index."""
|
||||
|
|
@ -75,7 +72,7 @@ class CommandDispatcher:
|
|||
def _current_index(self):
|
||||
"""Convenience method to get the current widget index."""
|
||||
current_index = self._tabbed_browser.widget.currentIndex()
|
||||
if current_index < 0:
|
||||
if current_index == -1:
|
||||
raise cmdutils.CommandError("No WebView available yet!")
|
||||
return current_index
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue