aboutsummaryrefslogtreecommitdiff
path: root/libqmenumodel/src
diff options
context:
space:
mode:
authorMarco Trevisan (Treviño) <mail@3v1n0.net>2016-10-26 14:29:33 +0200
committerMarco Trevisan (Treviño) <mail@3v1n0.net>2016-10-26 14:29:33 +0200
commit210cae9ff99fc5bbb206b904c8c7bfa2736f503f (patch)
tree105e3e04b97014d9aa56270d11717320bf81fffe /libqmenumodel/src
parente1ee47eaef71ffa0519843c5022d1d239512b866 (diff)
downloadqmenumodel-210cae9ff99fc5bbb206b904c8c7bfa2736f503f.tar.gz
qmenumodel-210cae9ff99fc5bbb206b904c8c7bfa2736f503f.tar.bz2
qmenumodel-210cae9ff99fc5bbb206b904c8c7bfa2736f503f.zip
converter: properly set the QByteArray using ctor, or it will be created twice
Diffstat (limited to 'libqmenumodel/src')
-rw-r--r--libqmenumodel/src/converter.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/libqmenumodel/src/converter.cpp b/libqmenumodel/src/converter.cpp
index ff70803..459e77f 100644
--- a/libqmenumodel/src/converter.cpp
+++ b/libqmenumodel/src/converter.cpp
@@ -69,10 +69,7 @@ QVariant Converter::toQVariant(GVariant *value)
result.setValue(list);
g_free(sa);
} else if (g_variant_type_equal(type, G_VARIANT_TYPE_BYTESTRING)) {
- gsize size = 0;
- gchar *bs = g_variant_dup_bytestring(value, &size);
- result.setValue(QByteArray::fromRawData(bs, size));
- g_free(bs);
+ result.setValue(QByteArray(g_variant_get_bytestring(value)));
} else if (g_variant_type_equal(type, G_VARIANT_TYPE_BYTESTRING_ARRAY)) {
gsize size = 0;
const gchar **bsa = g_variant_get_bytestring_array(value, &size);