(gtk) #1294: Don't auto-delete torrents when adding from Transmisson's config folder

This commit is contained in:
Charles Kerr 2008-10-02 17:10:01 +00:00
parent f3d75b3b57
commit 7b980aa9b7
1 changed files with 9 additions and 1 deletions

View File

@ -205,7 +205,15 @@ tr_torrent_new_ctor( tr_handle * handle,
tor = tr_torrentNew( handle, ctor, &errcode );
if( tor && doTrash )
tr_file_trash_or_unlink( tr_ctorGetSourceFile( ctor ) );
{
const char * config = tr_sessionGetConfigDir( handle );
const char * source = tr_ctorGetSourceFile( ctor );
const int is_internal = source && ( strstr( source, config ) == source );
/* #1294: don't delete the source .torrent file if it's our internal copy */
if( !is_internal )
tr_file_trash_or_unlink( source );
}
if( !tor )
{