~ubuntu-branches/ubuntu/quantal/colord/quantal-proposed

« back to all changes in this revision

Viewing changes to libcolord/cd-profile.c

  • Committer: Package Import Robot
  • Author(s): Christopher James Halse Rogers
  • Date: 2012-03-01 17:33:00 UTC
  • mto: (1.1.4) (2.1.7 sid)
  • mto: This revision was merged to the branch mainline in revision 11.
  • Revision ID: package-import@ubuntu.com-20120301173300-q1s2bs8yubnybln8
ImportĀ upstreamĀ versionĀ 0.1.18

Show diffs side-by-side

added added

removed removed

Lines of Context:
182
182
gboolean
183
183
cd_profile_has_access (CdProfile *profile)
184
184
{
 
185
        gboolean ret = TRUE;
 
186
 
185
187
        g_return_val_if_fail (CD_IS_PROFILE (profile), FALSE);
186
188
        g_return_val_if_fail (profile->priv->proxy != NULL, FALSE);
187
 
        return g_access (profile->priv->filename, R_OK) == 0;
 
189
 
 
190
        /* virtual profile */
 
191
        if (profile->priv->filename == NULL)
 
192
                goto out;
 
193
 
 
194
        /* profile on disk */
 
195
        ret = g_access (profile->priv->filename, R_OK) == 0;
 
196
out:
 
197
        return ret;
188
198
}
189
199
 
190
200
/**
432
442
static void
433
443
cd_profile_set_metadata_from_variant (CdProfile *profile, GVariant *variant)
434
444
{
435
 
        GVariantIter *iter = NULL;
 
445
        GVariantIter iter;
436
446
        const gchar *prop_key;
437
447
        const gchar *prop_value;
438
448
 
440
450
        g_hash_table_remove_all (profile->priv->metadata);
441
451
 
442
452
        /* insert the new metadata */
443
 
        g_variant_get (variant, "a{ss}",
444
 
                       &iter);
445
 
        while (g_variant_iter_loop (iter, "{ss}",
 
453
        g_variant_iter_init (&iter, variant);
 
454
        while (g_variant_iter_loop (&iter, "{ss}",
446
455
                                    &prop_key, &prop_value)) {
447
456
                g_hash_table_insert (profile->priv->metadata,
448
457
                                     g_strdup (prop_key),