Use g_variant_is_of_type()
authorChristian Persch <chpe@gnome.org>
Tue, 8 Jun 2010 11:36:00 +0000 (13:36 +0200)
committerChristian Persch <chpe@gnome.org>
Tue, 8 Jun 2010 15:41:46 +0000 (17:41 +0200)
... instead of strcmp()'ing the type strings.

Bug #620954.

gio/gapplication.c
gio/gdbusapplication.c

index 854fad0..029bf29 100644 (file)
@@ -407,7 +407,7 @@ g_application_register_with_data (GApplication  *application,
   g_return_if_fail (application->priv->appid != NULL);
   g_return_if_fail (application->priv->is_remote);
   g_return_if_fail (platform_data == NULL
-                    || strcmp (g_variant_get_type_string (platform_data), "a{sv}") == 0);
+                    || g_variant_is_of_type (platform_data, G_VARIANT_TYPE ("a{sv}")) == 0);
 
   if (!_g_application_platform_acquire_single_instance (application, NULL))
     {
index 5b6088d..8b17ce4 100644 (file)
@@ -332,7 +332,7 @@ _g_application_platform_acquire_single_instance (GApplication  *app,
   if (request_result == NULL)
     return FALSE;
 
-  if (strcmp (g_variant_get_type_string (request_result), "(u)") == 0)
+  if (g_variant_is_of_type (request_result, G_VARIANT_TYPE ("(u)")))
     g_variant_get (request_result, "(u)", &request_status);
   else
     request_status = 0;