aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2012-06-07 08:57:15 -0500
committerCharles Kerr <charles.kerr@canonical.com>2012-06-07 08:57:15 -0500
commit8b31b764a1f13c4f1651790157712794c11ea8d4 (patch)
tree73da850924388d5b9a93f2458a22a8eb73c788cc /src
parent9091bba8ac0ac70107bfe27276b1d6e9e3471fc8 (diff)
downloadayatana-indicator-power-8b31b764a1f13c4f1651790157712794c11ea8d4.tar.gz
ayatana-indicator-power-8b31b764a1f13c4f1651790157712794c11ea8d4.tar.bz2
ayatana-indicator-power-8b31b764a1f13c4f1651790157712794c11ea8d4.zip
improve the variant sanity tests in indicator_power_device_new_from_variant()
Diffstat (limited to 'src')
-rw-r--r--src/device.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/device.c b/src/device.c
index c79e145..c22aae8 100644
--- a/src/device.c
+++ b/src/device.c
@@ -641,9 +641,7 @@ indicator_power_device_new (const gchar * object_path,
IndicatorPowerDevice *
indicator_power_device_new_from_variant (GVariant * v)
{
- g_return_val_if_fail (v != NULL, NULL);
- g_return_val_if_fail (g_variant_type_is_tuple(g_variant_get_type(v)), NULL);
- g_return_val_if_fail (g_variant_n_children(v) == 6, NULL);
+ g_return_val_if_fail (g_variant_is_of_type (v, G_VARIANT_TYPE("(susdut)")), NULL);
UpDeviceKind kind = UP_DEVICE_KIND_UNKNOWN;
UpDeviceState state = UP_DEVICE_STATE_UNKNOWN;