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