From 4e0becaa57efa4304f697c172e01c2c269d6a595 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Wed, 2 Jul 2008 00:51:04 +0000 Subject: [PATCH] (gtk) #1035 prefrence "Remove source to trash" doesn't work --- gtk/tr-torrent.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/gtk/tr-torrent.c b/gtk/tr-torrent.c index f2d545074..1509ee77a 100644 --- a/gtk/tr-torrent.c +++ b/gtk/tr-torrent.c @@ -176,20 +176,19 @@ tr_torrent_new_ctor( tr_handle * handle, { tr_torrent * tor; int errcode; + uint8_t doTrash = FALSE; errcode = -1; *err = NULL; + /* let the gtk client handle the removal, since libT + * doesn't have any concept of the glib trash API */ + tr_ctorGetDeleteSource( ctor, &doTrash ); tr_ctorSetDeleteSource( ctor, FALSE ); tor = tr_torrentNew( handle, ctor, &errcode ); - if( tor ) - { - uint8_t doTrash = FALSE; - tr_ctorGetDeleteSource( ctor, &doTrash ); - if( doTrash ) - tr_file_trash_or_unlink( tr_ctorGetSourceFile( ctor ) ); - } + if( tor && doTrash ) + tr_file_trash_or_unlink( tr_ctorGetSourceFile( ctor ) ); if( !tor ) {