mirror of
https://github.com/transmission/transmission
synced 2024-12-25 17:17:31 +00:00
(gtk) #1504: when the details dialog's peers list is sorted, some rows are duplicated
This commit is contained in:
parent
aee1a0b9a0
commit
e99e3243a0
1 changed files with 14 additions and 13 deletions
|
@ -325,8 +325,7 @@ static const char* peer_column_names[N_PEER_COLS] =
|
|||
};
|
||||
|
||||
static int
|
||||
compare_peers( const void * a,
|
||||
const void * b )
|
||||
compare_peers( const void * a, const void * b )
|
||||
{
|
||||
const tr_peer_stat * pa = a;
|
||||
const tr_peer_stat * pb = b;
|
||||
|
@ -335,10 +334,8 @@ compare_peers( const void * a,
|
|||
}
|
||||
|
||||
static int
|
||||
compare_addr_to_peer( const void * a,
|
||||
const void * b )
|
||||
compare_addr_to_peer( const void * addr, const void * b )
|
||||
{
|
||||
const char * addr = (const char *) a;
|
||||
const tr_peer_stat * peer = b;
|
||||
|
||||
return strcmp( addr, peer->addr );
|
||||
|
@ -388,8 +385,7 @@ peer_model_new( tr_torrent * tor )
|
|||
G_TYPE_FLOAT, /* downloadFromRate */
|
||||
G_TYPE_FLOAT, /* uploadToRate */
|
||||
G_TYPE_STRING, /* client */
|
||||
G_TYPE_INT, /* progress [0..100]
|
||||
*/
|
||||
G_TYPE_INT, /* progress [0..100] */
|
||||
G_TYPE_BOOLEAN, /* isEncrypted */
|
||||
G_TYPE_STRING ); /* flagString */
|
||||
|
||||
|
@ -486,6 +482,7 @@ typedef struct
|
|||
GtkWidget * seeders_lb;
|
||||
GtkWidget * leechers_lb;
|
||||
GtkWidget * completed_lb;
|
||||
GtkWidget * peer_tree_view;
|
||||
}
|
||||
PeerData;
|
||||
|
||||
|
@ -587,6 +584,8 @@ refresh_peers( GtkWidget * top )
|
|||
fmtpeercount ( p->completed_lb, stat->timesCompleted );
|
||||
|
||||
free( peers );
|
||||
|
||||
gtk_widget_queue_draw( p->peer_tree_view );
|
||||
}
|
||||
|
||||
#if GTK_CHECK_VERSION( 2, 12, 0 )
|
||||
|
@ -735,12 +734,14 @@ peer_page_new( TrTorrent * gtor )
|
|||
|
||||
m = peer_model_new ( tor );
|
||||
v = GTK_WIDGET( g_object_new( GTK_TYPE_TREE_VIEW,
|
||||
"model", m,
|
||||
"model", gtk_tree_model_sort_new_with_model( m ),
|
||||
"rules-hint", TRUE,
|
||||
#if GTK_CHECK_VERSION( 2, 12, 0 )
|
||||
"has-tooltip", TRUE,
|
||||
#endif
|
||||
NULL ) );
|
||||
p->peer_tree_view = v;
|
||||
|
||||
#if GTK_CHECK_VERSION( 2, 12, 0 )
|
||||
g_signal_connect( v, "query-tooltip",
|
||||
G_CALLBACK( onPeerViewQueryTooltip ), NULL );
|
||||
|
|
Loading…
Reference in a new issue