Commit ffee3f98 authored by hjk's avatar hjk
Browse files

debugger: fix regression in QVariant dumper

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