diff options
author | Nick Dedekind <nicholas.dedekind@gmail.com> | 2013-08-26 13:57:39 +0000 |
---|---|---|
committer | Tarmac <> | 2013-08-26 13:57:39 +0000 |
commit | 346f5fce5ddaf12dff92f467d69a1dd5841012c8 (patch) | |
tree | eef5c26fbe89f2e6d42862a893e420699484bdbc | |
parent | bac9f37d6fc619e3c1c57754e0afe7b197c7668c (diff) | |
parent | d83555e4e6b771e70237924bea8714df7868808a (diff) | |
download | qmenumodel-346f5fce5ddaf12dff92f467d69a1dd5841012c8.tar.gz qmenumodel-346f5fce5ddaf12dff92f467d69a1dd5841012c8.tar.bz2 qmenumodel-346f5fce5ddaf12dff92f467d69a1dd5841012c8.zip |
Added int64 & variant types to UnityMenuModel ext attribute parsing.
Approved by Lars Uebernickel, PS Jenkins bot.
-rw-r--r-- | libqmenumodel/src/unitymenumodel.cpp | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/libqmenumodel/src/unitymenumodel.cpp b/libqmenumodel/src/unitymenumodel.cpp index e5407ab..031de9a 100644 --- a/libqmenumodel/src/unitymenumodel.cpp +++ b/libqmenumodel/src/unitymenumodel.cpp @@ -491,20 +491,34 @@ static QVariant attributeToQVariant(GVariant *value, const QString &type) QVariant result; if (type == "int") { - if (g_variant_is_of_type (value, G_VARIANT_TYPE_INT32)) + if (g_variant_is_of_type (value, G_VARIANT_TYPE_INT32)) { result = QVariant(g_variant_get_int32(value)); + } + } + else if (type == "int64") { + if (g_variant_is_of_type (value, G_VARIANT_TYPE_INT64)) { + result = QVariant((qlonglong)g_variant_get_int64(value)); + } } - if (type == "bool") { - if (g_variant_is_of_type (value, G_VARIANT_TYPE_BOOLEAN)) + else if (type == "bool") { + if (g_variant_is_of_type (value, G_VARIANT_TYPE_BOOLEAN)) { result = QVariant(g_variant_get_boolean(value)); + } } else if (type == "string") { - if (g_variant_is_of_type (value, G_VARIANT_TYPE_STRING)) + if (g_variant_is_of_type (value, G_VARIANT_TYPE_STRING)) { result = QVariant(g_variant_get_string(value, NULL)); + } } - if (type == "double") { - if (g_variant_is_of_type (value, G_VARIANT_TYPE_DOUBLE)) + else if (type == "double") { + if (g_variant_is_of_type (value, G_VARIANT_TYPE_DOUBLE)) { result = QVariant(g_variant_get_double(value)); + } + } + else if (type == "variant") { + if (g_variant_is_of_type (value, G_VARIANT_TYPE_VARIANT)) { + result = Converter::toQVariant(value); + } } else if (type == "icon") { GIcon *icon = g_icon_deserialize (value); |