remove config types special variable
This commit is contained in:
parent
d286f637d6
commit
b9aa40ea74
@ -421,10 +421,7 @@ class ConfigManager(QObject):
|
||||
for optname, option in sect.items():
|
||||
|
||||
lines.append('#')
|
||||
if option.typ.special:
|
||||
typestr = ''
|
||||
else:
|
||||
typestr = ' ({})'.format(option.typ.__class__.__name__)
|
||||
typestr = ' ({})'.format(option.typ.__class__.__name__)
|
||||
lines.append("# {}{}:".format(optname, typestr))
|
||||
|
||||
try:
|
||||
|
@ -117,12 +117,8 @@ class BaseType:
|
||||
Class attributes:
|
||||
valid_values: Possible values if they can be expressed as a fixed
|
||||
string. ValidValues instance.
|
||||
special: If set, the type is only used for one option and isn't
|
||||
mentioned in the config file.
|
||||
"""
|
||||
|
||||
special = False
|
||||
|
||||
def __init__(self, none_ok=False):
|
||||
self.none_ok = none_ok
|
||||
self.valid_values = None
|
||||
@ -658,8 +654,6 @@ class ColorSystem(MappingType):
|
||||
|
||||
"""Color systems for interpolation."""
|
||||
|
||||
special = True
|
||||
|
||||
def __init__(self, none_ok=False):
|
||||
super().__init__(
|
||||
none_ok,
|
||||
@ -1105,8 +1099,6 @@ class Proxy(BaseType):
|
||||
|
||||
"""A proxy URL or special value."""
|
||||
|
||||
special = True
|
||||
|
||||
PROXY_TYPES = {
|
||||
'http': QNetworkProxy.HttpProxy,
|
||||
'socks': QNetworkProxy.Socks5Proxy,
|
||||
@ -1165,8 +1157,6 @@ class SearchEngineName(BaseType):
|
||||
|
||||
"""A search engine name."""
|
||||
|
||||
special = True
|
||||
|
||||
def validate(self, value):
|
||||
self._basic_validation(value)
|
||||
|
||||
@ -1175,8 +1165,6 @@ class SearchEngineUrl(BaseType):
|
||||
|
||||
"""A search engine URL."""
|
||||
|
||||
special = True
|
||||
|
||||
def validate(self, value):
|
||||
self._basic_validation(value)
|
||||
if not value:
|
||||
@ -1268,8 +1256,6 @@ class UserStyleSheet(File):
|
||||
|
||||
"""QWebSettings UserStyleSheet."""
|
||||
|
||||
special = True
|
||||
|
||||
def transform(self, value):
|
||||
if not value:
|
||||
return None
|
||||
@ -1304,8 +1290,6 @@ class AutoSearch(BaseType):
|
||||
|
||||
"""Whether to start a search when something else than a URL is entered."""
|
||||
|
||||
special = True
|
||||
|
||||
def __init__(self, none_ok=False):
|
||||
super().__init__(none_ok)
|
||||
self.booltype = Bool(none_ok=none_ok)
|
||||
@ -1390,8 +1374,6 @@ class SessionName(BaseType):
|
||||
|
||||
"""The name of a session."""
|
||||
|
||||
special = True
|
||||
|
||||
def validate(self, value):
|
||||
self._basic_validation(value)
|
||||
if value.startswith('_'):
|
||||
@ -1402,8 +1384,6 @@ class SelectOnRemove(MappingType):
|
||||
|
||||
"""Which tab to select when the focused tab is removed."""
|
||||
|
||||
special = True
|
||||
|
||||
MAPPING = {
|
||||
'left': QTabBar.SelectLeftTab,
|
||||
'right': QTabBar.SelectRightTab,
|
||||
@ -1423,8 +1403,6 @@ class ConfirmQuit(FlagList):
|
||||
|
||||
"""Whether to display a confirmation when the window is closed."""
|
||||
|
||||
special = True
|
||||
|
||||
# Values that can be combined with commas
|
||||
combinable_values = ('multiple-tabs', 'downloads')
|
||||
|
||||
@ -1458,8 +1436,6 @@ class NewTabPosition(BaseType):
|
||||
|
||||
"""How new tabs are positioned."""
|
||||
|
||||
special = True
|
||||
|
||||
def __init__(self, none_ok=False):
|
||||
super().__init__(none_ok)
|
||||
self.valid_values = ValidValues(
|
||||
@ -1473,8 +1449,6 @@ class IgnoreCase(Bool):
|
||||
|
||||
"""Whether to ignore case when searching."""
|
||||
|
||||
special = True
|
||||
|
||||
def __init__(self, none_ok=False):
|
||||
super().__init__(none_ok)
|
||||
self.valid_values = ValidValues(
|
||||
@ -1503,8 +1477,6 @@ class UserAgent(BaseType):
|
||||
|
||||
"""The user agent to use."""
|
||||
|
||||
special = True
|
||||
|
||||
def validate(self, value):
|
||||
self._basic_validation(value)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user