Minor style fixes.

This commit is contained in:
Florian Bruhin 2015-01-24 18:10:24 +01:00
parent 6ab65eb9d3
commit 0d93d1eaff
2 changed files with 10 additions and 7 deletions

View File

@ -532,7 +532,8 @@ class ConfigManager(QObject):
if isinstance(val, bool): if isinstance(val, bool):
self.set(layer, sectname, optname[:-1], str(not val)) self.set(layer, sectname, optname[:-1], str(not val))
else: else:
raise cmdexc.CommandError("set: Attempted inversion of non-boolean value.") raise cmdexc.CommandError("set: Attempted inversion of "
"non-boolean value.")
else: else:
if value is None: if value is None:
raise cmdexc.CommandError("set: The following arguments " raise cmdexc.CommandError("set: The following arguments "

View File

@ -105,17 +105,19 @@ class TabBar(QTabBar):
@config.change_filter('tabs', 'hide-auto') @config.change_filter('tabs', 'hide-auto')
def autohide(self): def autohide(self):
self.tabhide() """Hide tabbar if needed when tabs->hide-auto got changed."""
self._tabhide()
@config.change_filter('tabs', 'hide-always') @config.change_filter('tabs', 'hide-always')
def alwayshide(self): def alwayshide(self):
self.tabhide() """Hide tabbar if needed when tabs->hide-always got changed."""
self._tabhide()
def tabhide(self): def _tabhide(self):
"""Auto-hide the tabbar if needed.""" """Hide the tabbar if needed."""
hide_auto = config.get('tabs', 'hide-auto') hide_auto = config.get('tabs', 'hide-auto')
hide_always = config.get('tabs', 'hide-always') hide_always = config.get('tabs', 'hide-always')
if hide_always or hide_auto and self.count() == 1: if hide_always or (hide_auto and self.count() == 1):
self.hide() self.hide()
else: else:
self.show() self.show()