1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2025-01-31 03:12:44 +00:00

remove unused function tr_metainfoMigrate()

This commit is contained in:
Jordan Lee 2012-12-09 01:27:01 +00:00
parent a2d2a10226
commit 410fa7e054
2 changed files with 0 additions and 46 deletions

View file

@ -87,49 +87,6 @@ getOldTorrentFilename (const tr_session * session, const tr_info * inf)
return tr_strdup_printf ("%s%c%s-%s", tr_getTorrentDir (session), '/', inf->hashString, "gtk");
}
/* this is for really old versions of T and will probably be removed someday */
void
tr_metainfoMigrate (tr_session * session, tr_info * inf)
{
struct stat new_sb;
char * name = getTorrentFilename (session, inf);
if (stat (name, &new_sb) || ((new_sb.st_mode & S_IFMT) != S_IFREG))
{
char * old_name = getOldTorrentFilename (session, inf);
size_t contentLen;
uint8_t * content;
tr_mkdirp (tr_getTorrentDir (session), 0777);
if ((content = tr_loadFile (old_name, &contentLen)))
{
FILE * out;
errno = 0;
out = fopen (name, "wb+");
if (!out)
{
tr_nerr (inf->name, _("Couldn't create \"%1$s\": %2$s"), name, tr_strerror (errno));
}
else
{
if (fwrite (content, sizeof (uint8_t), contentLen, out) == contentLen)
{
tr_free (inf->torrent);
inf->torrent = tr_strdup (name);
tr_sessionSetTorrentFile (session, inf->hashString, name);
unlink (old_name);
}
fclose (out);
}
}
tr_free (content);
tr_free (old_name);
}
tr_free (name);
}
/***
****
***/

View file

@ -30,9 +30,6 @@ bool tr_metainfoParse (const tr_session * session,
void tr_metainfoRemoveSaved (const tr_session * session,
const tr_info * info);
void tr_metainfoMigrate (tr_session * session,
tr_info * inf);
char* tr_metainfoGetBasename (const tr_info *);