From 67c108a32080eb54097ad852ccdde7175cd622c2 Mon Sep 17 00:00:00 2001 From: Jay Kamat Date: Sat, 22 Sep 2018 23:47:41 -0700 Subject: [PATCH] Get pinned status from parent --- qutebrowser/mainwindow/tabwidget.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/qutebrowser/mainwindow/tabwidget.py b/qutebrowser/mainwindow/tabwidget.py index 0064b8479..154c93bfd 100644 --- a/qutebrowser/mainwindow/tabwidget.py +++ b/qutebrowser/mainwindow/tabwidget.py @@ -108,10 +108,7 @@ class TabWidget(QTabWidget): tab: The tab to pin pinned: Pinned tab state to set. """ - bar = self.tabBar() idx = self.indexOf(tab) - - bar.set_tab_data(idx, 'pinned', pinned) tab.data.pinned = pinned self.update_tab_favicon(tab) self.update_tab_title(idx) @@ -570,10 +567,10 @@ class TabBar(QTabBar): def _tab_pinned(self, index: int) -> bool: """Return True if tab is pinned.""" - try: - return self.tab_data(index, 'pinned') - except KeyError: - return False + if not 0 <= index < self.count(): + raise IndexError("Tab index ({}) out of range ({})!".format( + index, self.count())) + return self.parent().widget(index).data.pinned def tabSizeHint(self, index: int): """Override tabSizeHint to customize qb's tab size.