Changeset 2463
- Timestamp:
- Jul 23, 2007, 3:03:45 AM (16 years ago)
- Location:
- trunk/gtk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gtk/main.c
r2444 r2463 413 413 414 414 /* add torrents from command-line and saved state */ 415 if( NULL != state ) 416 { 417 tr_core_load( cbdata->core, state, paused ); 418 } 415 tr_core_load( cbdata->core, paused ); 416 419 417 if( NULL != args ) 420 418 { … … 736 734 { 737 735 PREF_ID_PORT, 736 PREF_ID_DOWNLIMIT, 738 737 PREF_ID_USEDOWNLIMIT, 738 PREF_ID_UPLIMIT, 739 739 PREF_ID_USEUPLIMIT, 740 740 PREF_ID_NAT, … … 753 753 prefschanged( TrCore * core SHUTUP, int id, gpointer data ) 754 754 { 755 struct cbdata * cbdata ;756 tr_handle_t * tr ;755 struct cbdata * cbdata = data; 756 tr_handle_t * tr = tr_core_handle( cbdata->core ); 757 757 gboolean boolval; 758 759 cbdata = data;760 tr = tr_core_handle( cbdata->core );761 758 762 759 switch( id ) -
trunk/gtk/tr_core.c
r2425 r2463 32 32 #include <libtransmission/bencode.h> 33 33 #include <libtransmission/transmission.h> 34 #include <libtransmission/utils.h> 34 35 35 36 #include "conf.h" … … 402 403 403 404 int 404 tr_core_load( TrCore * self, const benc_val_t * state, gboolean forcepaused ) 405 { 405 tr_core_load( TrCore * self, gboolean forcepaused ) 406 { 407 int i; 408 int flags; 406 409 int count = 0; 407 408 TR_IS_CORE( self ); 409 410 if( TYPE_LIST == state->type ) 411 { 412 int ii; 413 for( ii = 0; ii < state->val.l.count; ii++ ) 414 { 415 char * errstr = NULL; 416 TrTorrent * tor = tr_torrent_new_with_state( self->handle, 417 state->val.l.vals + ii, 418 forcepaused, &errstr ); 419 if( NULL == tor ) 420 { 421 tr_core_errsig( self, TR_CORE_ERR_ADD_TORRENT, errstr ); 422 g_free( errstr ); 423 } 424 else 425 { 426 g_assert( NULL == errstr ); 427 tr_core_insert( self, tor ); 428 count++; 429 } 430 } 431 } 410 tr_torrent_t ** torrents; 411 const char * destination; 412 413 TR_IS_CORE( self ); 414 415 destination = getdownloaddir( ); 416 417 flags = 0; 418 if( forcepaused ) 419 flags |= TR_FLAG_PAUSED; 420 421 torrents = tr_loadTorrents ( self->handle, destination, flags, &count ); 422 for( i=0; i<count; ++i ) 423 tr_core_insert( self, tr_torrent_new_preexisting( torrents[i] ) ); 424 tr_free( torrents ); 432 425 433 426 return count; … … 560 553 gtk_tree_model_get( self->model, iter, MC_TORRENT, &tor, -1 ); 561 554 gtk_list_store_remove( GTK_LIST_STORE( self->model ), iter ); 562 563 if( TR_FLAG_SAVE & tr_torrent_info( tor )->flags ) 564 tr_torrentRemoveSaved( tr_torrent_handle( tor ) ); 555 tr_torrentRemoveSaved( tr_torrent_handle( tor ) ); 565 556 566 557 tr_torrent_sever( tor ); -
trunk/gtk/tr_core.h
r2400 r2463 125 125 or more "error" signals with TR_CORE_ERR_ADD_TORRENT */ 126 126 int 127 tr_core_load( TrCore * self, const benc_val_t * state,gboolean forcepaused );127 tr_core_load( TrCore * self, gboolean forcepaused ); 128 128 129 129 /* Any the tr_core_add functions below may trigger an "error" signal -
trunk/gtk/tr_torrent.c
r2441 r2463 292 292 } 293 293 294 TrTorrent* 295 tr_torrent_new_preexisting( tr_torrent_t * tor ) 296 { 297 return maketorrent( tor ); 298 } 299 300 294 301 TrTorrent * 295 302 tr_torrent_new( tr_handle_t * back, const char *torrent, const char *dir, -
trunk/gtk/tr_torrent.h
r2441 r2463 100 100 101 101 TrTorrent * 102 tr_torrent_new_preexisting( tr_torrent_t * tor ); 103 104 TrTorrent * 102 105 tr_torrent_new( tr_handle_t * handle, const char * path, const char * dir, 103 106 enum tr_torrent_action act, gboolean paused, char ** err);
Note: See TracChangeset
for help on using the changeset viewer.