]> granicus.if.org Git - transmission/commitdiff
remove unused function tr_metainfoMigrate()
authorJordan Lee <jordan@transmissionbt.com>
Sun, 9 Dec 2012 01:27:01 +0000 (01:27 +0000)
committerJordan Lee <jordan@transmissionbt.com>
Sun, 9 Dec 2012 01:27:01 +0000 (01:27 +0000)
libtransmission/metainfo.c
libtransmission/metainfo.h

index 107c2d0baecb8ec8f32b30b7ef98b59f297a3cfd..98f358adc5a68e6488e70c584666776c17aff7b3 100644 (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);
-}
-
 /***
 ****
 ***/
index 07f88d5a52fae13e59b8155684f94f0d612c1985..7dd2ddd737db6802841e4f8ce785542c10655ab8 100644 (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 *);