Changeset 6836


Ignore:
Timestamp:
Oct 2, 2008, 5:10:01 PM (13 years ago)
Author:
charles
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gtk/tr-torrent.c

    r6796 r6836  
    206206
    207207    if( tor && doTrash )
    208         tr_file_trash_or_unlink( tr_ctorGetSourceFile( ctor ) );
     208    {
     209        const char * config = tr_sessionGetConfigDir( handle );
     210        const char * source = tr_ctorGetSourceFile( ctor );
     211        const int is_internal = source && ( strstr( source, config ) == source );
     212
     213        /* #1294: don't delete the source .torrent file if it's our internal copy */
     214        if( !is_internal )
     215            tr_file_trash_or_unlink( source );
     216    }
    209217
    210218    if( !tor )
Note: See TracChangeset for help on using the changeset viewer.