Changeset 13633


Ignore:
Timestamp:
Dec 9, 2012, 1:32:25 AM (9 years ago)
Author:
jordan
Message:

in tr_metainfoRemoveSaved(), don't look for .torrent files under our old naming scheme... we haven't used it since 2008

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/metainfo.c

    r13632 r13633  
    5656  tr_free (base);
    5757  return filename;
    58 }
    59 
    60 static char*
    61 getOldTorrentFilename (const tr_session * session, const tr_info * inf)
    62 {
    63   int i;
    64   char * path;
    65   struct stat sb;
    66   const int tagCount = 5;
    67   const char * tags[] = { "beos", "cli", "daemon", "macosx", "wx" };
    68 
    69   /* test the beos, cli, daemon, macosx, wx tags */
    70   for (i=0; i<tagCount; ++i)
    71     {
    72       path = tr_strdup_printf ("%s%c%s-%s", tr_getTorrentDir (session), '/', inf->hashString, tags[i]);
    73       if (!stat (path, &sb) && ((sb.st_mode & S_IFMT) == S_IFREG))
    74         return path;
    75       tr_free (path);
    76     }
    77 
    78   /* test a non-tagged file */
    79   path = tr_buildPath (tr_getTorrentDir (session), inf->hashString, NULL);
    80   if (!stat (path, &sb) && ((sb.st_mode & S_IFMT) == S_IFREG))
    81     return path;
    82   tr_free (path);
    83 
    84   /* return the -gtk form by default, since that's the most common case.
    85      don't bother testing stat () on it since this is the last candidate
    86      and we don't want to return NULL anyway */
    87   return tr_strdup_printf ("%s%c%s-%s", tr_getTorrentDir (session), '/', inf->hashString, "gtk");
    8858}
    8959
     
    607577  unlink (filename);
    608578  tr_free (filename);
    609 
    610   filename = getOldTorrentFilename (session, inf);
    611   unlink (filename);
    612   tr_free (filename);
    613 }
    614 
     579}
     580
Note: See TracChangeset for help on using the changeset viewer.