Changeset 11890


Ignore:
Timestamp:
Feb 15, 2011, 3:18:51 PM (11 years ago)
Author:
jordan
Message:

(trunk) make tr_torrentName() a public function.

This has been a private function in libtransmission for awhile now but it makes more sense as a public function.

Location:
trunk
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/gtk/details.c

    r11883 r11890  
    20252025        int j;
    20262026        const tr_torrent * tor = torrents[i];
    2027         const char * summary_name = n>1 ? tr_torrentInfo( tor )->name : NULL;
     2027        const char * summary_name = n>1 ? tr_torrentName( tor ) : NULL;
    20282028        for( j=0; j<statCount[i]; ++j ) {
    20292029            const tr_tracker_stat * st = &stats[i][j];
     
    21902190        char * text = get_editable_tracker_list( tor );
    21912191        const int torrent_id = tr_torrentId( tor );
    2192         char * title = g_strdup_printf( _( "%s - Edit Trackers" ), tr_torrentInfo( tor )->name );
     2192        char * title = g_strdup_printf( _( "%s - Edit Trackers" ), tr_torrentName( tor ) );
    21932193
    21942194        d = gtk_dialog_new_with_buttons( title, win,
     
    23002300        GtkWidget * t;
    23012301        GtkWidget * w;
    2302         char * title = g_strdup_printf( _( "%s - Add Tracker" ), tr_torrentInfo( tor )->name );
     2302        char * title = g_strdup_printf( _( "%s - Add Tracker" ), tr_torrentName( tor ) );
    23032303
    23042304        w = gtk_dialog_new_with_buttons( title, GTK_WINDOW( di->dialog ),
  • trunk/gtk/file-list.c

    r11837 r11890  
    540540            /* build a GNode tree of the files */
    541541            root_data = g_new0( struct row_struct, 1 );
    542             root_data->name = g_strdup( inf->name );
     542            root_data->name = g_strdup( tr_torrentName( tor ) );
    543543            root_data->index = -1;
    544544            root_data->length = 0;
  • trunk/gtk/notify.c

    r11709 r11890  
    130130
    131131        n = notify_notification_new( _( "Torrent Complete" ),
    132                                      info->name, NULL
     132                                     tr_torrentName( tr_torrent_handle( tor ) ), NULL
    133133/* the fourth argument was removed in libnotify 0.7.0 */
    134134#if !defined(NOTIFY_VERSION_MINOR) || (NOTIFY_VERSION_MAJOR == 0 && NOTIFY_VERSION_MINOR < 7)
  • trunk/gtk/relocate.c

    r11709 r11890  
    6262                                             data->torrent_ids );
    6363
    64     str = g_strdup_printf( _( "Moving \"%s\"" ), tr_torrentInfo(tor)->name );
     64    str = g_strdup_printf( _( "Moving \"%s\"" ), tr_torrentName( tor ) );
    6565    gtk_message_dialog_set_markup( GTK_MESSAGE_DIALOG( data->message_dialog ), str );
    6666    g_free( str );
  • trunk/gtk/torrent-cell-renderer.c

    r11747 r11890  
    388388
    389389    icon = get_icon( tor, COMPACT_ICON_SIZE, widget );
    390     name = tr_torrentInfo( tor )->name;
     390    name = tr_torrentName( tor );
    391391    status = getShortStatusString( tor, st, p->upload_speed_KBps, p->download_speed_KBps );
    392392    gtr_cell_renderer_get_padding( GTK_CELL_RENDERER( cell ), &xpad, &ypad );
     
    446446
    447447    icon = get_icon( tor, FULL_ICON_SIZE, widget );
    448     name = inf->name;
     448    name = tr_torrentName( tor );
    449449    status = getStatusString( tor, st, p->upload_speed_KBps, p->download_speed_KBps );
    450450    progress = getProgressString( tor, inf, st );
     
    564564
    565565    icon = get_icon( tor, COMPACT_ICON_SIZE, widget );
    566     name = tr_torrentInfo( tor )->name;
     566    name = tr_torrentName( tor );
    567567    status = getShortStatusString( tor, st, p->upload_speed_KBps, p->download_speed_KBps );
    568568    gtr_cell_renderer_get_padding( GTK_CELL_RENDERER( cell ), &xpad, &ypad );
     
    641641
    642642    icon = get_icon( tor, FULL_ICON_SIZE, widget );
    643     name = inf->name;
     643    name = tr_torrentName( tor );
    644644    status = getStatusString( tor, st, p->upload_speed_KBps, p->download_speed_KBps );
    645645    progress = getProgressString( tor, inf, st );
  • trunk/gtk/tr-core.c

    r11808 r11890  
    867867
    868868static char*
    869 get_collated_name( const tr_info * inf )
    870 {
    871     char * down = g_utf8_strdown( inf->name ? inf->name : "", -1 );
     869get_collated_name( const tr_torrent * tor )
     870{
     871    const char * name = tr_torrentName( tor );
     872    const tr_info * inf = tr_torrentInfo( tor );
     873    char * down = g_utf8_strdown( name ? name : "", -1 );
    872874    char * collated = g_strdup_printf( "%s\t%s", down, inf->hashString );
    873875    g_free( down );
     
    878880tr_core_add_torrent( TrCore * self, TrTorrent * gtor, gboolean doNotify )
    879881{
    880     const tr_info * inf = tr_torrent_info( gtor );
    881882    const tr_stat * st = tr_torrent_stat( gtor );
    882883    tr_torrent * tor = tr_torrent_handle( gtor );
    883     char *  collated = get_collated_name( inf );
     884    const char * name = tr_torrentName( tor );
     885    char * collated = get_collated_name( tor );
    884886    char *  trackers = torrentTrackerString( tor );
    885887    GtkListStore *  store = GTK_LIST_STORE( tr_core_raw_model( self ) );
     
    887889
    888890    gtk_list_store_insert_with_values( store, &unused, 0,
    889         MC_NAME,              inf->name,
     891        MC_NAME,              name,
    890892        MC_NAME_COLLATED,     collated,
    891893        MC_TORRENT,           gtor,
     
    902904
    903905    if( doNotify )
    904         gtr_notify_added( inf->name );
     906        gtr_notify_added( name );
    905907
    906908    /* cleanup */
     
    13371339    newActivePeerCount = st->peersSendingToUs + st->peersGettingFromUs + st->webseedsSendingToUs;
    13381340    newError = st->error;
    1339     newCollatedName = get_collated_name( tr_torrent_info( gtor ) );
     1341    newCollatedName = get_collated_name( tor );
    13401342
    13411343    /* updating the model triggers off resort/refresh,
  • trunk/gtk/tr-torrent.c

    r11709 r11890  
    228228    if( tor != NULL )
    229229    {
    230         const tr_info * info = tr_torrent_info( gtor );
    231         const gboolean single = info->fileCount == 1;
     230        const gboolean single = tr_torrent_info( gtor )->fileCount == 1;
    232231        const char * currentDir = tr_torrentGetCurrentDir( tor );
    233232        if( single )
    234233            gtr_open_file( currentDir );
    235234        else {
    236             char * path = g_build_filename( currentDir, info->name, NULL );
     235            char * path = g_build_filename( currentDir, tr_torrentName( tor ), NULL );
    237236            gtr_open_file( path );
    238237            g_free( path );
  • trunk/libtransmission/rpcimpl.c

    r11834 r11890  
    534534        tr_bencDictAddReal( d, key, st->metadataPercentComplete );
    535535    else if( tr_streq( key, keylen, "name" ) )
    536         tr_bencDictAddStr( d, key, inf->name );
     536        tr_bencDictAddStr( d, key, tr_torrentName( tor ) );
    537537    else if( tr_streq( key, keylen, "percentDone" ) )
    538538        tr_bencDictAddReal( d, key, st->percentDone );
  • trunk/libtransmission/torrent.c

    r11844 r11890  
    6969***/
    7070
     71const char *
     72tr_torrentName( const tr_torrent * tor )
     73{
     74    assert( tr_isTorrent( tor ) );
     75
     76    return tor->info.name;
     77}
     78
    7179int
    7280tr_torrentId( const tr_torrent * tor )
  • trunk/libtransmission/torrent.h

    r11814 r11890  
    371371
    372372    tor->isDirty = TRUE;
    373 }
    374 
    375 static inline
    376 const char * tr_torrentName( const tr_torrent * tor )
    377 {
    378     assert( tr_isTorrent( tor ) );
    379 
    380     return tor->info.name;
    381373}
    382374
  • trunk/libtransmission/transmission.h

    r11834 r11890  
    10891089tr_torrent* tr_torrentFindFromMagnetLink( tr_session * session, const char * link );
    10901090
     1091/**
     1092 * @return this torrent's name.
     1093 */
     1094const char* tr_torrentName( const tr_torrent * );
    10911095
    10921096/**
Note: See TracChangeset for help on using the changeset viewer.