Changeset 11834 for trunk/gtk/main.c


Ignore:
Timestamp:
Feb 6, 2011, 5:30:46 PM (11 years ago)
Author:
jordan
Message:

(trunk) #3675 "Not all .part files are removed" -- handle trashing files via RPC.

When libtransmission gets a "remove torrent" request from RPC, it tries to delegate the work. This is because the GTK+ and Mac clients don't want torrents disappearing in a different thread and causing possible thread issues. So the GTK+ and Mac clients get notification about this via libtransmission's RPC callback and remove the torrents themselves. Unfortunately, that notification doesn't include information about whether or not to delete local data.

This commit adds that information to the RPC callback so that the Mac and GTK+ clients will know whether or not to trash the local files when a third-party RPC client requests that at torrent and its files be deleted.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gtk/main.c

    r11831 r11834  
    454454    TrCore * core;
    455455    int id;
     456    gboolean delete_files;
    456457};
    457458
     
    461462    struct torrent_idle_data * data = gdata;
    462463
    463     tr_core_remove_torrent_from_id( data->core, data->id, FALSE );
     464    tr_core_remove_torrent_from_id( data->core, data->id, data->delete_files );
    464465
    465466    g_free( data );
     
    512513        }
    513514
    514         case TR_RPC_TORRENT_REMOVING: {
     515        case TR_RPC_TORRENT_REMOVING:
     516        case TR_RPC_TORRENT_TRASHING: {
    515517            struct torrent_idle_data * data = g_new0( struct torrent_idle_data, 1 );
    516518            data->id = tr_torrentId( tor );
    517519            data->core = cbdata->core;
     520            data->delete_files = type == TR_RPC_TORRENT_TRASHING;
    518521            gtr_idle_add( rpc_torrent_remove_idle, data );
    519522            status = TR_RPC_NOREMOVE;
Note: See TracChangeset for help on using the changeset viewer.