mirror of
https://github.com/transmission/transmission
synced 2025-02-22 22:20:39 +00:00
(trunk gtk) #3239 "move .torrent files to trash" not working when .torrent added via dbus
This commit is contained in:
parent
6ea50f14ec
commit
6ed4d1d87d
1 changed files with 11 additions and 2 deletions
13
gtk/main.c
13
gtk/main.c
|
@ -571,9 +571,18 @@ main( int argc, char ** argv )
|
||||||
* if that goes well, then our work is done. */
|
* if that goes well, then our work is done. */
|
||||||
GSList * l;
|
GSList * l;
|
||||||
gboolean delegated = FALSE;
|
gboolean delegated = FALSE;
|
||||||
|
const gboolean trash_originals = pref_flag_get( TR_PREFS_KEY_TRASH_ORIGINAL );
|
||||||
|
|
||||||
for( l = argfiles; l; l = l->next )
|
for( l=argfiles; l!=NULL; l=l->next )
|
||||||
delegated |= gtr_dbus_add_torrent( l->data );
|
{
|
||||||
|
const char * filename = l->data;
|
||||||
|
const gboolean added = gtr_dbus_add_torrent( filename );
|
||||||
|
|
||||||
|
if( added && trash_originals )
|
||||||
|
gtr_file_trash_or_remove( filename );
|
||||||
|
|
||||||
|
delegated |= added;
|
||||||
|
}
|
||||||
|
|
||||||
if( delegated ) {
|
if( delegated ) {
|
||||||
g_slist_foreach( argfiles, (GFunc)g_free, NULL );
|
g_slist_foreach( argfiles, (GFunc)g_free, NULL );
|
||||||
|
|
Loading…
Reference in a new issue