(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 );
@ -894,7 +894,7 @@ 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 * collated = g_utf8_strdown( inf->name ? inf->name : "", -1 );
char * trackers = torrentTrackerString( tor );
GtkListStore * store = GTK_LIST_STORE( tr_core_model( self ) );
GtkTreeIter unused;

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... */
{