Changeset 13683 for trunk/utils/edit.c


Ignore:
Timestamp:
Dec 22, 2012, 8:35:19 PM (9 years ago)
Author:
jordan
Message:

(trunk, libT) first drop of the tr_quark patch.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/utils/edit.c

    r13667 r13683  
    9696  bool changed = false;
    9797
    98   if (tr_variantDictFindStr (metainfo, "announce", &str, NULL) && !strcmp (str, url))
     98  if (tr_variantDictFindStr (metainfo, TR_KEY_announce, &str, NULL) && !strcmp (str, url))
    9999    {
    100100      printf ("\tRemoved \"%s\" from \"announce\"\n", str);
    101       tr_variantDictRemove (metainfo, "announce");
     101      tr_variantDictRemove (metainfo, TR_KEY_announce);
    102102      changed = true;
    103103    }
    104104
    105   if (tr_variantDictFindList (metainfo, "announce-list", &announce_list))
     105  if (tr_variantDictFindList (metainfo, TR_KEY_announce_list, &announce_list))
    106106    {
    107107      tr_variant * tier;
     
    136136        {
    137137          printf ("\tNo tiers left... removing announce-list\n");
    138           tr_variantDictRemove (metainfo, "announce-list");
     138          tr_variantDictRemove (metainfo, TR_KEY_announce_list);
    139139        }
    140140    }
     
    142142  /* if we removed the "announce" field and there's still another track left,
    143143   * use it as the "announce" field */
    144   if (changed && !tr_variantDictFindStr (metainfo, "announce", &str, NULL))
     144  if (changed && !tr_variantDictFindStr (metainfo, TR_KEY_announce, &str, NULL))
    145145    {
    146146      tr_variant * tier;
     
    153153              if (tr_variantGetStr (node, &str, NULL))
    154154                {
    155                   tr_variantDictAddStr (metainfo, "announce", str);
     155                  tr_variantDictAddStr (metainfo, TR_KEY_announce, str);
    156156                  printf ("\tAdded \"%s\" to announce\n", str);
    157157                }
     
    190190  bool changed = false;
    191191
    192   if (tr_variantDictFindStr (metainfo, "announce", &str, NULL) && strstr (str, in))
     192  if (tr_variantDictFindStr (metainfo, TR_KEY_announce, &str, NULL) && strstr (str, in))
    193193    {
    194194      char * newstr = replaceSubstr (str, in, out);
    195195      printf ("\tReplaced in \"announce\": \"%s\" --> \"%s\"\n", str, newstr);
    196       tr_variantDictAddStr (metainfo, "announce", newstr);
     196      tr_variantDictAddStr (metainfo, TR_KEY_announce, newstr);
    197197      tr_free (newstr);
    198198      changed = true;
    199199    }
    200200
    201   if (tr_variantDictFindList (metainfo, "announce-list", &announce_list))
     201  if (tr_variantDictFindList (metainfo, TR_KEY_announce_list, &announce_list))
    202202    {
    203203      tr_variant * tier;
     
    249249  tr_variant * announce_list = NULL;
    250250  bool changed = false;
    251   const bool had_announce = tr_variantDictFindStr (metainfo, "announce", &announce, NULL);
    252   const bool had_announce_list = tr_variantDictFindList (metainfo, "announce-list", &announce_list);
     251  const bool had_announce = tr_variantDictFindStr (metainfo, TR_KEY_announce, &announce, NULL);
     252  const bool had_announce_list = tr_variantDictFindList (metainfo, TR_KEY_announce_list, &announce_list);
    253253
    254254  if (!had_announce && !had_announce_list)
     
    256256      /* this new tracker is the only one, so add it to "announce"... */
    257257      printf ("\tAdded \"%s\" in \"announce\"\n", url);
    258       tr_variantDictAddStr (metainfo, "announce", url);
     258      tr_variantDictAddStr (metainfo, TR_KEY_announce, url);
    259259      changed = true;
    260260    }
     
    263263      if (!had_announce_list)
    264264        {
    265           announce_list = tr_variantDictAddList (metainfo, "announce-list", 2);
     265          announce_list = tr_variantDictAddList (metainfo, TR_KEY_announce_list, 2);
    266266
    267267          if (had_announce)
Note: See TracChangeset for help on using the changeset viewer.