Changeset 10853


Ignore:
Timestamp:
Jun 25, 2010, 5:49:53 PM (12 years ago)
Author:
charles
Message:

(2.0x gtk) #3350 "Add URL doesn't warn upon corrupt torrents" -- fixed

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.0x/gtk/tr-core.c

    r10830 r10853  
    10191019    TrCore * core;
    10201020    tr_ctor * ctor;
    1021     GtkDialog * dialog;
     1021    char * url;
     1022    long response_code;
    10221023};
    10231024
     
    10261027{
    10271028    struct url_dialog_data * data = vdata;
    1028     tr_core_add_ctor( data->core, data->ctor );
     1029    const gboolean doPrompt = pref_flag_get( PREF_KEY_OPTIONS_PROMPT );
     1030    const gboolean doNotify = FALSE;
     1031    const int err = add_ctor( data->core, data->ctor, doPrompt, doNotify );
     1032
     1033    if( err == TR_PARSE_ERR )
     1034        tr_core_errsig( data->core, TR_PARSE_ERR, data->url );
     1035   
     1036     tr_core_torrents_added( data->core );
     1037
     1038    /* cleanup */
     1039    g_free( data->url );
    10291040    g_free( data );
    10301041    return FALSE;
     
    10331044static void
    10341045onURLDone( tr_session       * session,
    1035            long               response_code UNUSED,
     1046           long               response_code,
    10361047           const void       * response,
    10371048           size_t             response_byte_count,
     
    10391050{
    10401051    struct url_dialog_data * data = vdata;
    1041     tr_ctor * ctor = tr_ctorNew( session );
    1042 
    1043     /* FIME: error dialog */
    1044 
    1045     if( tr_ctorSetMetainfo( ctor, response, response_byte_count ) )
    1046     {
    1047         tr_ctorFree( ctor );
    1048         g_free( data );
    1049     }
    1050     else /* move the work back to the gtk thread */
    1051     {
    1052         data->ctor = ctor;
    1053         gtr_idle_add( onURLDoneIdle, data );
    1054     }
     1052
     1053    data->response_code = response_code;
     1054    data->ctor = tr_ctorNew( session );
     1055    tr_core_apply_defaults( data->ctor );
     1056    tr_ctorSetMetainfo( data->ctor, response, response_byte_count );
     1057
     1058    gtr_idle_add( onURLDoneIdle, data );
    10551059}
    10561060
     
    10851089        struct url_dialog_data * data = g_new( struct url_dialog_data, 1 );
    10861090        data->core = core;
     1091        data->url = g_strdup( url );
    10871092        tr_webRun( session, url, NULL, onURLDone, data );
    10881093    }
Note: See TracChangeset for help on using the changeset viewer.