summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--qutebrowser/mainwindow/tabbedbrowser.py10
-rw-r--r--qutebrowser/misc/sessions.py4
2 files changed, 7 insertions, 7 deletions
diff --git a/qutebrowser/mainwindow/tabbedbrowser.py b/qutebrowser/mainwindow/tabbedbrowser.py
index c07b9e1ad..741123ed9 100644
--- a/qutebrowser/mainwindow/tabbedbrowser.py
+++ b/qutebrowser/mainwindow/tabbedbrowser.py
@@ -377,7 +377,7 @@ class TabbedBrowser(QWidget):
tab.history_item_triggered.connect(
history.web_history.add_from_tab)
- def _current_tab(self) -> browsertab.AbstractTab:
+ def current_tab(self) -> browsertab.AbstractTab:
"""Get the current browser tab.
Note: The assert ensures the current tab is never None.
@@ -586,7 +586,7 @@ class TabbedBrowser(QWidget):
if newtab or self.widget.currentWidget() is None:
self.tabopen(url, background=False)
else:
- self._current_tab().load_url(url)
+ self.current_tab().load_url(url)
@pyqtSlot(int)
def on_tab_close_requested(self, idx):
@@ -672,7 +672,7 @@ class TabbedBrowser(QWidget):
# Make sure the background tab has the correct initial size.
# With a foreground tab, it's going to be resized correctly by the
# layout anyways.
- current_widget = self._current_tab()
+ current_widget = self.current_tab()
tab.resize(current_widget.size())
self.widget.tab_index_changed.emit(self.widget.currentIndex(),
self.widget.count())
@@ -1087,7 +1087,7 @@ class TabbedBrowser(QWidget):
if key != "'":
message.error("Failed to set mark: url invalid")
return
- point = self._current_tab().scroller.pos_px()
+ point = self.current_tab().scroller.pos_px()
if key.isupper():
self._global_marks[key] = point, url
@@ -1108,7 +1108,7 @@ class TabbedBrowser(QWidget):
except qtutils.QtValueError:
urlkey = None
- tab = self._current_tab()
+ tab = self.current_tab()
if key.isupper():
if key in self._global_marks:
diff --git a/qutebrowser/misc/sessions.py b/qutebrowser/misc/sessions.py
index 3bf2b99c9..9f7254958 100644
--- a/qutebrowser/misc/sessions.py
+++ b/qutebrowser/misc/sessions.py
@@ -330,8 +330,8 @@ class SessionManager(QObject):
]
else:
tabs = tabbed_browser.widgets()
- for i, tab in enumerate(tabs):
- active = i == tabbed_browser.widget.currentIndex()
+ for tab in tabs:
+ active = tab == tabbed_browser.current_tab()
tab_data = self._save_tab(tab,
active,
with_history=with_history)