Changeset 6309 for trunk/gtk/tr-core.c


Ignore:
Timestamp:
Jul 9, 2008, 4:33:00 PM (14 years ago)
Author:
charles
Message:

(gtk) #562: No error message when opening broken torrent file

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gtk/tr-core.c

    r6301 r6309  
    741741}
    742742
    743 void
    744 tr_core_add_ctor( TrCore * self, tr_ctor * ctor )
    745 {
    746     TrTorrent * tor;
    747     char      * errstr = NULL;
    748 
    749     tr_core_apply_defaults( ctor );
    750 
    751     if(( tor = tr_torrent_new_ctor( tr_core_handle( self ), ctor, &errstr )))
    752         tr_core_add_torrent( self, tor );
    753     else{
    754         tr_core_errsig( self, TR_CORE_ERR_ADD_TORRENT, errstr );
    755         g_free( errstr );
    756     }
    757 
    758     /* cleanup */
    759     tr_ctorFree( ctor );
    760 }
    761 
    762743static void
    763744add_filename( TrCore       * core,
     
    775756        tr_ctorSetPaused( ctor, TR_FORCE, !doStart );
    776757        if( tr_ctorSetMetainfoFromFile( ctor, filename ) ) {
    777             addTorrentErrorDialog( NULL, TR_EINVALID, filename );
     758            tr_core_errsig( core, TR_EINVALID, filename );
    778759            tr_ctorFree( ctor );
    779760        } else if(( err = tr_torrentParse( handle, ctor, NULL ))) {
    780             addTorrentErrorDialog( NULL, err, filename );
     761            tr_core_errsig( core, err, filename );
    781762            tr_ctorFree( ctor );
    782763        } else if( doPrompt )
    783764            g_signal_emit( core, TR_CORE_GET_CLASS(core)->promptsig, 0, ctor );
    784         else
    785             tr_core_add_ctor( core, ctor );
     765        else {
     766            tr_torrent * tor = tr_torrentNew( handle, ctor, &err );
     767            if( err )
     768                tr_core_errsig( core, err, filename );
     769            else
     770                tr_core_add_torrent( core, tr_torrent_new_preexisting( tor ) );
     771        }
    786772    }
    787773}
Note: See TracChangeset for help on using the changeset viewer.