~ubuntu-branches/ubuntu/precise/glib2.0/precise-updates

« back to all changes in this revision

Viewing changes to .pc/02_gettext-desktopfiles-ubuntu.patch/glib/gkeyfile.c

  • Committer: Package Import Robot
  • Author(s): Sebastien Bacher
  • Date: 2012-02-02 19:24:45 UTC
  • mfrom: (1.59.38)
  • Revision ID: package-import@ubuntu.com-20120202192445-n258a4h70odnnq4m
Tags: 2.31.14-0ubuntu1
* New upstream version:
  GResource:
  - GLib now includes a commandline utility, gresource, to explore 
    resources in ELF files
  - The resource compiler can now optionally strip ignorable 
    whitespace from XML resources
  - The resource compiler can now generate build dependencies
  - The resource compiler will now autoselect output formats
  GApplication:
  - The menu markup parser API has been dropped, the menu XML support 
    lives in GTK+ now
  GValueArray has been deprecated
* debian/libglib2.0-0.symbols: 
  - new version update
* debian/libglib2.0-bin.install:
  - list the new gresource command and its manpage
* debian/control.in:
  - Breaks on gtk << 3.3.12, glib and gtk needs to be updated together
    due to the gmenu parser changes
  - Build-Depends on libelf-dev for the gresources tools, thanks ricotz
* debian/docs:
  - dropped, no need to install ChangeLog and NEWS from the past century
* debian/libglib2.0-bin.install:
  - ship the glib-compile-resources manpage, thanks ricotz
* debian/patches/git_gsettings_lists_set.patch:
  - git patch, fix "gsettings set ..." command line issues (lp: #925382)

Show diffs side-by-side

added added

removed removed

Lines of Context:
438
438
 
439
439
  GString *parse_buffer; /* Holds up to one line of not-yet-parsed data */
440
440
 
441
 
  /* Used for sizing the output buffer during serialization */
442
 
  gsize approximate_size;
443
 
 
444
441
  gchar list_separator;
445
442
 
446
443
  GKeyFileFlags flags;
574
571
  key_file->group_hash = g_hash_table_new (g_str_hash, g_str_equal);
575
572
  key_file->start_group = NULL;
576
573
  key_file->parse_buffer = g_string_sized_new (128);
577
 
  key_file->approximate_size = 0;
578
574
  key_file->list_separator = ';';
579
575
  key_file->flags = 0;
580
576
  key_file->locales = g_strdupv ((gchar **)g_get_language_names ());
757
753
  gssize bytes_read;
758
754
  struct stat stat_buf;
759
755
  gchar read_buf[4096];
760
 
  
 
756
  gchar list_separator;
 
757
 
761
758
  if (fstat (fd, &stat_buf) < 0)
762
759
    {
763
760
      g_set_error_literal (error, G_FILE_ERROR,
774
771
      return FALSE;
775
772
    }
776
773
 
777
 
  if (key_file->approximate_size > 0)
778
 
    {
779
 
      g_key_file_clear (key_file);
780
 
      g_key_file_init (key_file);
781
 
    }
 
774
  list_separator = key_file->list_separator;
 
775
  g_key_file_clear (key_file);
 
776
  g_key_file_init (key_file);
 
777
  key_file->list_separator = list_separator;
782
778
  key_file->flags = flags;
783
779
 
784
780
  do
899
895
                           GError        **error)
900
896
{
901
897
  GError *key_file_error = NULL;
 
898
  gchar list_separator;
902
899
 
903
900
  g_return_val_if_fail (key_file != NULL, FALSE);
904
 
  g_return_val_if_fail (data != NULL, FALSE);
905
 
  g_return_val_if_fail (length != 0, FALSE);
 
901
  g_return_val_if_fail (data != NULL || length == 0, FALSE);
906
902
 
907
903
  if (length == (gsize)-1)
908
904
    length = strlen (data);
909
905
 
910
 
  if (key_file->approximate_size > 0)
911
 
    {
912
 
      g_key_file_clear (key_file);
913
 
      g_key_file_init (key_file);
914
 
    }
 
906
  list_separator = key_file->list_separator;
 
907
  g_key_file_clear (key_file);
 
908
  g_key_file_init (key_file);
 
909
  key_file->list_separator = list_separator;
915
910
  key_file->flags = flags;
916
911
 
917
912
  g_key_file_parse_data (key_file, data, length, &key_file_error);
1376
1371
  gsize i;
1377
1372
 
1378
1373
  g_return_if_fail (key_file != NULL);
1379
 
  g_return_if_fail (data != NULL);
 
1374
  g_return_if_fail (data != NULL || length == 0);
1380
1375
 
1381
1376
  parse_error = NULL;
1382
1377
 
1426
1421
          i += line_length;
1427
1422
        }
1428
1423
    }
1429
 
 
1430
 
  key_file->approximate_size += length;
1431
1424
}
1432
1425
 
1433
1426
static void
1483
1476
 
1484
1477
  g_return_val_if_fail (key_file != NULL, NULL);
1485
1478
 
1486
 
  data_string = g_string_sized_new (2 * key_file->approximate_size);
1487
 
  
 
1479
  data_string = g_string_new (NULL);
 
1480
 
1488
1481
  for (group_node = g_list_last (key_file->groups);
1489
1482
       group_node != NULL;
1490
1483
       group_node = group_node->prev)
3326
3319
        return FALSE;
3327
3320
    }
3328
3321
 
3329
 
  if (comment != NULL)
3330
 
    key_file->approximate_size += strlen (comment);
3331
 
 
3332
3322
  return TRUE;
3333
3323
}
3334
3324
 
3702
3692
  group->name = g_strdup (group_name);
3703
3693
  group->lookup_map = g_hash_table_new (g_str_hash, g_str_equal);
3704
3694
  key_file->groups = g_list_prepend (key_file->groups, group);
3705
 
  key_file->approximate_size += strlen (group_name) + 3;
3706
3695
  key_file->current_group = group;
3707
3696
 
3708
3697
  if (key_file->start_group == NULL)
3743
3732
 
3744
3733
  group->key_value_pairs = g_list_remove_link (group->key_value_pairs, pair_node);
3745
3734
 
3746
 
  if (pair->key != NULL)
3747
 
    key_file->approximate_size -= strlen (pair->key) + 1;
3748
 
 
3749
3735
  g_warn_if_fail (pair->value != NULL);
3750
 
  key_file->approximate_size -= strlen (pair->value);
3751
3736
 
3752
3737
  g_key_file_key_value_pair_free (pair);
3753
3738
 
3803
3788
 
3804
3789
  key_file->groups = g_list_remove_link (key_file->groups, group_node);
3805
3790
 
3806
 
  if (group->name != NULL)
3807
 
    key_file->approximate_size -= strlen (group->name) + 3;
3808
 
 
3809
3791
  tmp = group->key_value_pairs;
3810
3792
  while (tmp != NULL)
3811
3793
    {
3882
3864
  g_hash_table_replace (group->lookup_map, pair->key, pair);
3883
3865
  group->key_value_pairs = g_list_prepend (group->key_value_pairs, pair);
3884
3866
  group->has_trailing_blank_line = FALSE;
3885
 
  key_file->approximate_size += strlen (pair->key) + strlen (pair->value) + 2;
3886
3867
}
3887
3868
 
3888
3869
static void
3949
3930
      return FALSE;
3950
3931
    }
3951
3932
 
3952
 
  key_file->approximate_size -= strlen (pair->key) + strlen (pair->value) + 2;
3953
 
 
3954
3933
  group->key_value_pairs = g_list_remove (group->key_value_pairs, pair);
3955
 
  g_hash_table_remove (group->lookup_map, pair->key);  
 
3934
  g_hash_table_remove (group->lookup_map, pair->key);
3956
3935
  g_key_file_key_value_pair_free (pair);
3957
3936
 
3958
3937
  return TRUE;