mirror of
https://github.com/transmission/transmission
synced 2025-02-20 21:26:53 +00:00
in tr_metainfoRemoveSaved(), don't look for .torrent files under our old naming scheme... we haven't used it since 2008
This commit is contained in:
parent
410fa7e054
commit
4f6dcc6d31
1 changed files with 0 additions and 34 deletions
|
@ -57,36 +57,6 @@ getTorrentFilename (const tr_session * session, const tr_info * inf)
|
|||
return filename;
|
||||
}
|
||||
|
||||
static char*
|
||||
getOldTorrentFilename (const tr_session * session, const tr_info * inf)
|
||||
{
|
||||
int i;
|
||||
char * path;
|
||||
struct stat sb;
|
||||
const int tagCount = 5;
|
||||
const char * tags[] = { "beos", "cli", "daemon", "macosx", "wx" };
|
||||
|
||||
/* test the beos, cli, daemon, macosx, wx tags */
|
||||
for (i=0; i<tagCount; ++i)
|
||||
{
|
||||
path = tr_strdup_printf ("%s%c%s-%s", tr_getTorrentDir (session), '/', inf->hashString, tags[i]);
|
||||
if (!stat (path, &sb) && ((sb.st_mode & S_IFMT) == S_IFREG))
|
||||
return path;
|
||||
tr_free (path);
|
||||
}
|
||||
|
||||
/* test a non-tagged file */
|
||||
path = tr_buildPath (tr_getTorrentDir (session), inf->hashString, NULL);
|
||||
if (!stat (path, &sb) && ((sb.st_mode & S_IFMT) == S_IFREG))
|
||||
return path;
|
||||
tr_free (path);
|
||||
|
||||
/* return the -gtk form by default, since that's the most common case.
|
||||
don't bother testing stat () on it since this is the last candidate
|
||||
and we don't want to return NULL anyway */
|
||||
return tr_strdup_printf ("%s%c%s-%s", tr_getTorrentDir (session), '/', inf->hashString, "gtk");
|
||||
}
|
||||
|
||||
/***
|
||||
****
|
||||
***/
|
||||
|
@ -606,9 +576,5 @@ tr_metainfoRemoveSaved (const tr_session * session, const tr_info * inf)
|
|||
filename = getTorrentFilename (session, inf);
|
||||
unlink (filename);
|
||||
tr_free (filename);
|
||||
|
||||
filename = getOldTorrentFilename (session, inf);
|
||||
unlink (filename);
|
||||
tr_free (filename);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue