1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-23 16:24:02 +00:00

(trunk) #3478 "Display bug when magnet links without display names are added" -- fixed in trunk

This commit is contained in:
Charles Kerr 2010-08-03 03:16:21 +00:00
parent dcea7e5783
commit 5624840ac4
2 changed files with 9 additions and 5 deletions

View file

@ -362,7 +362,7 @@ compareByName( GtkTreeModel * model,
gtk_tree_model_get( model, a, MC_NAME_COLLATED, &ca, -1 );
gtk_tree_model_get( model, b, MC_NAME_COLLATED, &cb, -1 );
ret = strcmp( ca, cb );
ret = gtr_strcmp0( ca, cb );
g_free( cb );
g_free( ca );
@ -893,11 +893,11 @@ tr_core_add_torrent( TrCore * self,
{
const tr_info * inf = tr_torrent_info( gtor );
const tr_stat * st = tr_torrent_stat( gtor );
tr_torrent * tor = tr_torrent_handle( gtor );
char * collated = g_utf8_strdown( inf->name, -1 );
char * trackers = torrentTrackerString( tor );
tr_torrent * tor = tr_torrent_handle( gtor );
char * collated = g_utf8_strdown( inf->name ? inf->name : "", -1 );
char * trackers = torrentTrackerString( tor );
GtkListStore * store = GTK_LIST_STORE( tr_core_model( self ) );
GtkTreeIter unused;
GtkTreeIter unused;
gtk_list_store_insert_with_values( store, &unused, 0,
MC_NAME, inf->name,

View file

@ -438,10 +438,14 @@ tr_metainfoParseImpl( const tr_session * session,
escape( inf->hashEscaped, inf->hash, SHA_DIGEST_LENGTH );
/* maybe get the display name */
if( tr_bencDictFindStr( d, "display-name", &str ) ) {
tr_free( inf->name );
inf->name = tr_strdup( str );
}
if( !inf->name )
inf->name = tr_strdup( inf->hashString );
}
else /* not a magnet link and has no info dict... */
{