Changeset 5868


Ignore:
Timestamp:
May 20, 2008, 11:58:59 PM (14 years ago)
Author:
charles
Message:

(#954) rpc: add "torrent-remove" method. rename tr_torrentDelete() as tr_torrentRemove() for consistency with various parts of the code.

Location:
trunk
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/daemon/transmission-remote.1

    r5861 r5868  
    2727.Op Fl q
    2828.Oo
    29 .Fl r Ar all | Ar torrent-id
     29.Fl r Ar all | Ar id | Ar hash
    3030.Oc
    3131.Oo
    32 .Fl s Ar all | Ar torrent-id
     32.Fl s Ar all | Ar id | Ar hash
    3333.Oc
    3434.Oo
    35 .Fl S Ar all | Ar torrent-id
     35.Fl S Ar all | Ar id | Ar hash
    3636.Oc
    3737.Op Fl u Ar upload-rate
    3838.Op Fl U
    3939.Oo
    40 .Fl V Ar all | Ar torrent-id
     40.Fl v Ar all | Ar id | Ar hash
    4141.Oc
    4242.Ek
     
    8484.Ar port
    8585for use as a listening port to accept incoming peer connections.
    86 .It Fl r Fl -remove Ar all | torrent-id
    87 Remove all torrents, or the torrent with the unique id
    88 .Ar torrent-id .
    89 Neither the downloaded data nor the original torrent metainfo file
    90 will be deleted.
    91 .It Fl S Fl -stop Ar all | torrent-id
    92 Stop all torrents from downloading or seeding, or the torrent with the unique id
    93 .Ar torrent-id .
    94 .It Fl s Fl -start Ar all | torrent-id
    95 Start all torrents downloading or seeding, or the torrent with the unique id
    96 .Ar torrent-id .
     86
     87.It Fl r Fl -remove Ar all | id | torrent-hash
     88Remove all torrents, or the torrent matching the specified
     89.Ar id
     90or
     91.Ar hash .
     92This does not delete the downloaded data.
     93
     94.It Fl S Fl -stop Ar all | id | torrent-hash
     95Stop all torrents from downloading or seeding, or the torrent matching the specified
     96.Ar id
     97or
     98.Ar hash .
     99
     100.It Fl s Fl -start Ar all | id | torrent-hash
     101Start all torrents downloading or seeding, or the torrent matching the specified
     102.Ar id
     103or
     104.Ar hash .
     105
    97106.It Fl u Fl -upload-limit Ar upload-rate
    98107Set maximum upload rate to
    99108.Ar upload-rate
    100109in kilobytes per second.
     110
    101111.It Fl U Fl -upload-unlimited
    102112Remove the upload limit.
     113
     114.It Fl v Fl -verify Ar all | id | torrent-hash
     115Queue all the torrents for verification, or the torrent matching the specified
     116.Ar id
     117or
     118.Ar hash .
    103119
    104120.El
  • trunk/doc/rpc-spec.txt

    r5860 r5868  
    64643.1.  Torrent Action Requests
    6565
    66    Method names: "torrent-start", "torrent-stop",
    67                  "torrent-remove", "torrent-verify"
     66   Method name         | libtransmission function
     67   --------------------+-------------------------------------------------
     68   "torrent-close"     | tr_torrentClose
     69   "torrent-remove"    | tr_torrentRemove
     70   "torrent-start"     | tr_torrentStart
     71   "torrent-stop"      | tr_torrentStop
     72   "torrent-verify"    | tr_torrentVerify
    6873
    6974   Request arguments: "ids", a list of torrent id integers, sha1 hash strings,
  • trunk/gtk/Makefile.am

    r5843 r5868  
    3333    torrent-cell-renderer.h \
    3434    tr-core.h \
     35    tr-core-dbus.h \
    3536    tr-icon.h \
    3637    tr-io.h \
  • trunk/gtk/add-dialog.c

    r5843 r5868  
    3232
    3333static void
    34 deleteOldTorrent( struct AddData * data )
     34removeOldTorrent( struct AddData * data )
    3535{
    3636    if( data->gtor )
     
    3838        file_list_set_torrent( data->list, NULL );
    3939
    40         tr_torrent_set_delete_flag( data->gtor, TRUE );
     40        tr_torrent_set_remove_flag( data->gtor, TRUE );
    4141        g_object_unref( G_OBJECT( data->gtor ) );
    4242        data->gtor = NULL;
     
    5252    {
    5353        if( response != GTK_RESPONSE_ACCEPT )
    54             deleteOldTorrent( data );
     54            removeOldTorrent( data );
    5555        else {
    5656            if( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( data->run_check ) ) )
     
    8383    struct AddData * data = gdata;
    8484
    85     deleteOldTorrent( data );
     85    removeOldTorrent( data );
    8686
    8787    g_free( data->filename );
  • trunk/gtk/tr-core.c

    r5843 r5868  
    825825        tr_torrent_delete_files( gtor );
    826826
    827     /* delete the torrent */
    828     tr_torrent_set_delete_flag( gtor, TRUE );
     827    /* remove the torrent */
     828    tr_torrent_set_remove_flag( gtor, TRUE );
    829829    g_object_unref( G_OBJECT( gtor ) );
    830830}
  • trunk/gtk/tr-torrent.c

    r5843 r5868  
    4040{
    4141   tr_torrent * handle;
    42    gboolean do_delete;
     42   gboolean do_remove;
    4343   gboolean seeding_cap_enabled;
    4444   gdouble seeding_cap; /* ratio to stop seeding at */
     
    7979        if( self->priv->handle )
    8080        {
    81             if( self->priv->do_delete )
    82                 tr_torrentDelete( self->priv->handle );
     81            if( self->priv->do_remove )
     82                tr_torrentRemove( self->priv->handle );
    8383            else
    8484                tr_torrentClose( self->priv->handle );
     
    319319
    320320void
    321 tr_torrent_set_delete_flag( TrTorrent * gtor, gboolean do_delete )
     321tr_torrent_set_remove_flag( TrTorrent * gtor, gboolean do_remove )
    322322{
    323323    if( !isDisposed( gtor ) )
    324         gtor->priv->do_delete = do_delete;
     324        gtor->priv->do_remove = do_remove;
    325325}
    326326
  • trunk/gtk/tr-torrent.h

    r5583 r5868  
    9797
    9898void
    99 tr_torrent_set_delete_flag( TrTorrent *, gboolean );
     99tr_torrent_set_remove_flag( TrTorrent *, gboolean );
    100100
    101101#endif
  • trunk/libtransmission/rpc.c

    r5860 r5868  
    131131        notify( h, TR_RPC_TORRENT_CLOSING, tor );
    132132        tr_torrentClose( tor );
     133    }
     134    tr_free( torrents );
     135    return NULL;
     136}
     137
     138static const char*
     139torrentRemove( tr_handle * h, tr_benc * args_in, tr_benc * args_out UNUSED )
     140{
     141    int i, torrentCount;
     142    tr_torrent ** torrents = getTorrents( h, args_in, &torrentCount );
     143    for( i=0; i<torrentCount; ++i )
     144    {
     145        tr_torrent * tor = torrents[i];
     146        notify( h, TR_RPC_TORRENT_REMOVING, tor );
     147        tr_torrentRemove( tor );
    133148    }
    134149    tr_free( torrents );
     
    674689    { "torrent-info", torrentInfo },
    675690    { "torrent-list", torrentList },
     691    { "torrent-remove", torrentRemove },
    676692    { "torrent-set-priorities", torrentSetPriorities },
    677693    { "torrent-set", torrentSet },
  • trunk/libtransmission/torrent.c

    r5843 r5868  
    11341134
    11351135void
    1136 tr_torrentDelete( tr_torrent * tor )
     1136tr_torrentRemove( tr_torrent * tor )
    11371137{
    11381138    tor->isDeleting = 1;
  • trunk/libtransmission/transmission.h

    r5843 r5868  
    157157    TR_RPC_TORRENT_STOPPED,
    158158    TR_RPC_TORRENT_CLOSING,
     159    TR_RPC_TORRENT_REMOVING,
    159160    TR_RPC_TORRENT_CHANGED,
    160161    TR_RPC_SESSION_CHANGED
     
    469470 *  + Simplifies the API down to two (non-deprecated) functions.
    470471 *  + You can set the fields you want; the system sets defaults for the rest.
    471  *  + You can specify whether or not your fields should supercede fastresume's.
     472 *  + You can specify whether or not your fields should supercede resume's.
    472473 *  + We can add new features to tr_ctor without breaking tr_torrentNew()'s API.
    473474 *
     
    488489{
    489490    TR_FALLBACK, /* indicates the ctor value should be used only
    490                     in case of missing fastresume settings */
     491                    in case of missing resume settings */
    491492
    492493    TR_FORCE, /* indicates the ctor value should be used
    493                  regardless of what's in the fastresume settings */
     494                 regardless of what's in the resume settings */
    494495}
    495496tr_ctorMode;
     
    747748/**
    748749 * Like tr_torrentClose() but also deletes
    749  * the fastresume file and our copy of the
     750 * the resume file and our copy of the
    750751 * torrent file
    751752 */
    752 void tr_torrentDelete( tr_torrent * );
     753void tr_torrentRemove( tr_torrent * );
    753754
    754755/***********************************************************************
  • trunk/macosx/Makefile.am

    r5789 r5868  
    5757    InfoWindowController.h \
    5858    InfoWindowController.m \
    59     IPCController.h \
    60     IPCController.m \
    6159    main.m \
    6260    MenuLabel.h \
  • trunk/macosx/Torrent.m

    r5858 r5868  
    206206    [self setTimeMachineExclude: NO forPath: [[self downloadFolder] stringByAppendingPathComponent: [self name]]];
    207207   
    208     tr_torrentDelete(fHandle);
     208    tr_torrentRemove(fHandle);
    209209}
    210210
Note: See TracChangeset for help on using the changeset viewer.