diff options
Diffstat (limited to 'libqmenumodel/src')
-rw-r--r-- | libqmenumodel/src/ayatanamenumodel.cpp | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/libqmenumodel/src/ayatanamenumodel.cpp b/libqmenumodel/src/ayatanamenumodel.cpp index 39ce0bc..9ab0ff4 100644 --- a/libqmenumodel/src/ayatanamenumodel.cpp +++ b/libqmenumodel/src/ayatanamenumodel.cpp @@ -584,7 +584,12 @@ static QVariant attributeToQVariant(GVariant *value, const QString &type) { QVariant result; - if (type == "int") { + if (type == "int16") { + if (g_variant_is_of_type (value, G_VARIANT_TYPE_INT16)) { + result = QVariant(g_variant_get_int16(value)); + } + } + else if (type == "int32" || type == "int") { if (g_variant_is_of_type (value, G_VARIANT_TYPE_INT32)) { result = QVariant(g_variant_get_int32(value)); } @@ -594,6 +599,21 @@ static QVariant attributeToQVariant(GVariant *value, const QString &type) result = QVariant((qlonglong)g_variant_get_int64(value)); } } + else if (type == "uint16") { + if (g_variant_is_of_type (value, G_VARIANT_TYPE_UINT16)) { + result = QVariant(g_variant_get_uint16(value)); + } + } + else if (type == "uint32") { + if (g_variant_is_of_type (value, G_VARIANT_TYPE_UINT32)) { + result = QVariant(g_variant_get_uint32(value)); + } + } + else if (type == "uint64") { + if (g_variant_is_of_type (value, G_VARIANT_TYPE_UINT64)) { + result = QVariant((quint64)g_variant_get_uint64(value)); + } + } else if (type == "bool") { if (g_variant_is_of_type (value, G_VARIANT_TYPE_BOOLEAN)) { result = QVariant(g_variant_get_boolean(value)); |