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):
self.set(layer, sectname, optname[:-1], str(not val))
else:
raise cmdexc.CommandError("set: Attempted inversion of non-boolean value.")
raise cmdexc.CommandError("set: Attempted inversion of "
"non-boolean value.")
else:
if value is None:
raise cmdexc.CommandError("set: The following arguments "

View File

@ -105,17 +105,19 @@ class TabBar(QTabBar):
@config.change_filter('tabs', 'hide-auto')
def autohide(self):
self.tabhide()
"""Hide tabbar if needed when tabs->hide-auto got changed."""
self._tabhide()
@config.change_filter('tabs', 'hide-always')
def alwayshide(self):
self.tabhide()
"""Hide tabbar if needed when tabs->hide-always got changed."""
self._tabhide()
def tabhide(self):
"""Auto-hide the tabbar if needed."""
def _tabhide(self):
"""Hide the tabbar if needed."""
hide_auto = config.get('tabs', 'hide-auto')
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()
else:
self.show()