Commit 710b3603 authored by qthjk's avatar qthjk Committed by hjk
Browse files

debugger: fix selection of displays of integer-ish data

Change-Id: I9e9d22884a53f462b6e7a3e823cb14958c0eccd9
Reviewed-on: http://codereview.qt.nokia.com/93

Reviewed-by: default avatarhjk <qthjk@ovi.com>
parent f3faa59f
......@@ -370,8 +370,10 @@ static inline QString formattedValue(const WatchData &data, int format)
return reformatInteger(data.value.toLongLong(), format);
}
if (data.value.toULongLong(0, 0))
return reformatInteger(data.value.toLongLong(), format);
bool ok = false;
qulonglong integer = data.value.toULongLong(&ok, 0);
if (ok)
return reformatInteger(integer, format);
QString result = data.value;
result.replace(QLatin1Char('\n'), QLatin1String("\\n"));
......@@ -721,8 +723,9 @@ QVariant WatchModel::data(const QModelIndex &idx, int role) const
return QStringList()
<< tr("Latin1 string")
<< tr("UTF8 string");
if ((isIntType(data.type) && data.type != "bool")
|| data.value.toULongLong(0, 0))
bool ok = false;
(void)data.value.toULongLong(&ok, 0);
if ((isIntType(data.type) && data.type != "bool") || ok)
return QStringList()
<< tr("Decimal")
<< tr("Hexadecimal")
......
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