Use g_variant_is_of_type()

... instead of strcmp()'ing the type strings.

Bug #620954.
This commit is contained in:
Christian Persch 2010-06-08 13:36:00 +02:00
parent b75e7eb95d
commit d3b091f63a
2 changed files with 2 additions and 2 deletions

View 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))
{

View 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;