debugger: fix dumper for QString::isNull()

This commit is contained in:
hjk
2009-12-01 15:31:52 +01:00
parent 9af0027158
commit ebff16f8b1
2 changed files with 8 additions and 4 deletions

View File

@@ -715,7 +715,10 @@ void QDumper::putBase64Encoded(const char *buf, int n)
void QDumper::putStringValue(const QString &str) void QDumper::putStringValue(const QString &str)
{ {
if (str.isNull()) { if (str.isNull()) {
putItem("value", "\"\" (null)"); beginItem("value");
putBase64Encoded("\"\" (null)", 9);
endItem();
putItem("valueencoded", "5");
} else { } else {
putItem("value", str); putItem("value", str);
putItem("valueencoded", "2"); putItem("valueencoded", "2");

View File

@@ -462,7 +462,8 @@ static const QByteArray ptrToBa(const void *p, bool symbolicNull = true)
static const QByteArray generateQStringSpec(const QString &str, bool isNull = false) static const QByteArray generateQStringSpec(const QString &str, bool isNull = false)
{ {
if (isNull) if (isNull)
return QByteArray("value=''' (null)',type='"NS"QString',numchild='0'"); return QByteArray("value='IiIgKG51bGwp',valueencoded='5',"
"type='"NS"QString',numchild='0'");
return return
QByteArray("value='%',valueencoded='2',type='"NS"QString',numchild='0'") QByteArray("value='%',valueencoded='2',type='"NS"QString',numchild='0'")
<< utfToBase64(str); << utfToBase64(str);
@@ -2263,7 +2264,7 @@ void tst_Debugger::dumpQSharedPointer()
void tst_Debugger::dumpQString() void tst_Debugger::dumpQString()
{ {
QString s; QString s;
testDumper("value=''' (null)',type='$T',numchild='0'", testDumper("value='IiIgKG51bGwp',valueencoded='5',type='$T',numchild='0'",
&s, NS"QString", false); &s, NS"QString", false);
s = "abc"; s = "abc";
testDumper("value='YQBiAGMA',valueencoded='2',type='$T',numchild='0'", testDumper("value='YQBiAGMA',valueencoded='2',type='$T',numchild='0'",