Commit 46171f54 authored by hjk's avatar hjk
Browse files

Debugger: Un-duplicate dumper code



Change-Id: Idf617c9ea7e13474abab6fc5dad4f8885dc7902b
Reviewed-by: default avatarhjk <hjk121@nokiamail.com>
parent 9e4fa5e2
......@@ -1675,17 +1675,6 @@ class Dumper:
def putName(self, name):
self.put('name="%s",' % name)
def putMapName(self, value):
ns = qtNamespace()
if str(value.type) == ns + "QString":
self.put('key="%s",' % encodeString(value))
self.put('keyencoded="%s",' % Hex4EncodedLittleEndian)
elif str(value.type) == ns + "QByteArray":
self.put('key="%s",' % self.encodeByteArray(value))
self.put('keyencoded="%s",' % Hex2EncodedLatin1)
else:
self.put('name="%s",' % value)
def isExpanded(self):
#warn("IS EXPANDED: %s in %s: %s" % (self.currentIName,
# self.expandedINames, self.currentIName in self.expandedINames))
......
......@@ -683,16 +683,6 @@ class Dumper:
def putName(self, name):
self.put('name="%s",' % name)
def putMapName(self, value):
if str(value.type) == self.ns + "QString":
self.put('key="%s",' % encodeString(value))
self.put('keyencoded="%s",' % Hex4EncodedLittleEndian)
elif str(value.type) == self.ns + "QByteArray":
self.put('key="%s",' % self.encodeByteArray(value))
self.put('keyencoded="%s",' % Hex2EncodedLatin1)
else:
self.put('name="%s",' % value)
def isExpanded(self):
#warn("IS EXPANDED: %s in %s: %s" % (self.currentIName,
# self.expandedINames, self.currentIName in self.expandedINames))
......
......@@ -67,12 +67,12 @@ def arrayForms():
return "Normal,Plot"
return "Normal"
def mapCompact(format, keyType, valueType):
def qMapCompact(format, keyType, valueType):
if format == 2:
return True # Compact.
return isSimpleType(keyType) and isSimpleType(valueType)
def putMapName(d, value):
def qPutMapName(d, value):
if str(value.type) == d.ns + "QString":
d.put('key="%s",' % d.encodeString(value))
d.put('keyencoded="%s",' % Hex4EncodedLittleEndian)
......@@ -85,18 +85,16 @@ def putMapName(d, value):
else:
d.put('name="%s",' % value)
# Compatibility with earlier versions
Dumper.encodeByteArray = qEncodeByteArray
Dumper.byteArrayData = qByteArrayData
Dumper.putByteArrayValue = qPutByteArrayValue
Dumper.encodeString = qEncodeString
Dumper.stringData = qStringData
Dumper.putStringValue = qPutStringValue
Dumper.putMapName = putMapName
Dumper.putMapName = qPutMapName
Dumper.isMapCompact = \
lambda d, keyType, valueType: mapCompact(d.currentItemFormat(), keyType, valueType)
lambda d, keyType, valueType: qMapCompact(d.currentItemFormat(), keyType, valueType)
def tryPutObjectNameValue(d, value):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment