aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Tilloy <olivier.tilloy@canonical.com>2012-10-04 17:53:52 +0200
committerOlivier Tilloy <olivier.tilloy@canonical.com>2012-10-04 17:53:52 +0200
commit5fb1863497f1d02ea2f9eb1ad6c73e652d19d59f (patch)
tree2156a53fef826d4af13db8f26c734d8771805f13
parent795bf87a2e1e9d362a8ff0f55628021410964f3e (diff)
downloadqmenumodel-5fb1863497f1d02ea2f9eb1ad6c73e652d19d59f.tar.gz
qmenumodel-5fb1863497f1d02ea2f9eb1ad6c73e652d19d59f.tar.bz2
qmenumodel-5fb1863497f1d02ea2f9eb1ad6c73e652d19d59f.zip
Fix variant conversion on 32-bits platforms.
-rw-r--r--libqmenumodel/src/converter.cpp12
-rw-r--r--tests/client/modeltest.cpp4
2 files changed, 8 insertions, 8 deletions
diff --git a/libqmenumodel/src/converter.cpp b/libqmenumodel/src/converter.cpp
index a060618..452f68c 100644
--- a/libqmenumodel/src/converter.cpp
+++ b/libqmenumodel/src/converter.cpp
@@ -21,17 +21,17 @@ QVariant Converter::toQVariant(GVariant *value)
} else if (g_variant_type_equal(type, G_VARIANT_TYPE_BYTE)) {
result.setValue(g_variant_get_byte(value));
} else if (g_variant_type_equal(type, G_VARIANT_TYPE_INT16)) {
- result.setValue(g_variant_get_int16(value));
+ result.setValue(qint16(g_variant_get_int16(value)));
} else if (g_variant_type_equal(type, G_VARIANT_TYPE_UINT16)) {
- result.setValue(g_variant_get_uint16(value));
+ result.setValue(quint16(g_variant_get_uint16(value)));
} else if (g_variant_type_equal(type, G_VARIANT_TYPE_INT32)) {
- result.setValue(g_variant_get_int32(value));
+ result.setValue(qint32(g_variant_get_int32(value)));
} else if (g_variant_type_equal(type, G_VARIANT_TYPE_UINT32)) {
- result.setValue(g_variant_get_uint32(value));
+ result.setValue(quint32(g_variant_get_uint32(value)));
} else if (g_variant_type_equal(type, G_VARIANT_TYPE_INT64)) {
- result.setValue(g_variant_get_int64(value));
+ result.setValue(qint64(g_variant_get_int64(value)));
} else if (g_variant_type_equal(type, G_VARIANT_TYPE_UINT64)) {
- result.setValue(g_variant_get_uint64(value));
+ result.setValue(quint64(g_variant_get_uint64(value)));
} else if (g_variant_type_equal(type, G_VARIANT_TYPE_DOUBLE)) {
result.setValue(g_variant_get_double(value));
} else if (g_variant_type_equal(type, G_VARIANT_TYPE_STRING)) {
diff --git a/tests/client/modeltest.cpp b/tests/client/modeltest.cpp
index b1f2090..9f6ee76 100644
--- a/tests/client/modeltest.cpp
+++ b/tests/client/modeltest.cpp
@@ -185,12 +185,12 @@ private Q_SLOTS:
// Int64
v = extra["int64"];
- QCOMPARE(v.typeName(), "long");
+ QCOMPARE(v.type(), QVariant::LongLong);
QCOMPARE(v.value<long>(), (long) -42);
// UInt64
v = extra["uint64"];
- QCOMPARE(v.typeName(), "ulong");
+ QCOMPARE(v.type(), QVariant::ULongLong);
QCOMPARE(v.value<ulong>(), (ulong) 42);
// Double