Commit ffee3f98 authored by hjk's avatar hjk

debugger: fix regression in QVariant dumper

parent 013437cf
......@@ -2460,7 +2460,7 @@ static void qDumpQVariant(QDumper &d)
d.putItem("value", "(invalid)");
} else if (value.isEmpty()) {
d.beginItem("value");
d.put("(").put(v.typeName()).put(") ").put(qPrintable(value));
d.put("(").put(v.typeName()).put(") ");
d.endItem();
} else {
QByteArray ba;
......@@ -2469,7 +2469,7 @@ static void qDumpQVariant(QDumper &d)
ba += ") ";
ba += qPrintable(value);
d.putItem("value", ba);
d.putItem("valueencoded", "4");
d.putItem("valueencoded", "5");
}
d.putItem("type", NS"QVariant");
d.putItem("numchild", (isInvalid ? "0" : "1"));
......
......@@ -376,6 +376,9 @@ QString decodeData(const QByteArray &ba, int encoding)
const QByteArray decodedBa = QByteArray::fromBase64(ba);
return QString::fromUtf16(reinterpret_cast<const ushort *>(decodedBa.data()), decodedBa.size() / 2);
}
case 5: { // base64 encoded 8 bit data, without quotes (see 1)
return quoteUnprintableLatin1(QByteArray::fromBase64(ba));
}
}
return QCoreApplication::translate("Debugger", "<Encoding error>");
}
......
......@@ -468,6 +468,7 @@ void testQObject(int &argc, char *argv[])
#endif
QString str = QString::fromUtf8("XXXXXXXXXXXXXXyyXXX ö");
QLabel l(str);
l.setObjectName("Some Label");
l.show();
app.exec();
}
......@@ -915,7 +916,13 @@ void testQVariant1()
void testQVariant2()
{
QVariant value;
QVariant::Type t = QVariant::String;
value = QVariant(t, (void*)0);
*(QString*)value.data() = QString("XXX");
int i = 1;
#if 0
QVariant var;
var.setValue(1);
var.setValue(2);
......@@ -927,6 +934,7 @@ void testQVariant2()
var.setValue(QStringList() << "World" << "Hello");
var.setValue(QStringList() << "Hello" << "Hello");
var.setValue(QStringList() << "World" << "Hello" << "Hello");
#endif
#if 0
QVariant var3;
QHostAddress ha("127.0.0.1");
......
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