mirror of
https://github.com/transmission/transmission
synced 2024-12-24 00:34:04 +00:00
(trunk) #3478 "Display bug when magnet links without display names are added" -- fixed in trunk
This commit is contained in:
parent
dcea7e5783
commit
5624840ac4
2 changed files with 9 additions and 5 deletions
|
@ -362,7 +362,7 @@ compareByName( GtkTreeModel * model,
|
||||||
|
|
||||||
gtk_tree_model_get( model, a, MC_NAME_COLLATED, &ca, -1 );
|
gtk_tree_model_get( model, a, MC_NAME_COLLATED, &ca, -1 );
|
||||||
gtk_tree_model_get( model, b, MC_NAME_COLLATED, &cb, -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( cb );
|
||||||
g_free( ca );
|
g_free( ca );
|
||||||
|
@ -894,7 +894,7 @@ tr_core_add_torrent( TrCore * self,
|
||||||
const tr_info * inf = tr_torrent_info( gtor );
|
const tr_info * inf = tr_torrent_info( gtor );
|
||||||
const tr_stat * st = tr_torrent_stat( gtor );
|
const tr_stat * st = tr_torrent_stat( gtor );
|
||||||
tr_torrent * tor = tr_torrent_handle( 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 );
|
char * trackers = torrentTrackerString( tor );
|
||||||
GtkListStore * store = GTK_LIST_STORE( tr_core_model( self ) );
|
GtkListStore * store = GTK_LIST_STORE( tr_core_model( self ) );
|
||||||
GtkTreeIter unused;
|
GtkTreeIter unused;
|
||||||
|
|
|
@ -438,10 +438,14 @@ tr_metainfoParseImpl( const tr_session * session,
|
||||||
escape( inf->hashEscaped, inf->hash, SHA_DIGEST_LENGTH );
|
escape( inf->hashEscaped, inf->hash, SHA_DIGEST_LENGTH );
|
||||||
|
|
||||||
/* maybe get the display name */
|
/* maybe get the display name */
|
||||||
|
|
||||||
if( tr_bencDictFindStr( d, "display-name", &str ) ) {
|
if( tr_bencDictFindStr( d, "display-name", &str ) ) {
|
||||||
tr_free( inf->name );
|
tr_free( inf->name );
|
||||||
inf->name = tr_strdup( str );
|
inf->name = tr_strdup( str );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if( !inf->name )
|
||||||
|
inf->name = tr_strdup( inf->hashString );
|
||||||
}
|
}
|
||||||
else /* not a magnet link and has no info dict... */
|
else /* not a magnet link and has no info dict... */
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue