Changeset 11110 for branches


Ignore:
Timestamp:
Aug 4, 2010, 2:11:06 PM (11 years ago)
Author:
charles
Message:

(2.0x gtk) #3478 "Display bug when magnet links without display names are added" -- fixed.

Location:
branches/2.0x/gtk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/2.0x/gtk/tr-core.c

    r11106 r11110  
    294294    gtk_tree_model_get( model, a, MC_NAME_COLLATED, &ca, -1 );
    295295    gtk_tree_model_get( model, b, MC_NAME_COLLATED, &cb, -1 );
    296     ret = strcmp( ca, cb );
     296    ret = gtr_strcmp0( ca, cb );
    297297    g_free( cb );
    298298    g_free( ca );
     
    473473}
    474474
    475 static int
    476 tr_strcmp( const void * a,
    477            const void * b )
    478 {
    479     if( a && b ) return strcmp( a, b );
    480     if( a ) return 1;
    481     if( b ) return -1;
    482     return 0;
    483 }
    484 
    485475static char *
    486476torrentTrackerString( tr_torrent * tor )
     
    649639    struct TrCorePrivate * p = TR_CORE( core )->priv;
    650640
    651     if( p->monitor && ( !isEnabled || tr_strcmp( filename, p->monitor_path ) ) )
     641    if( p->monitor && ( !isEnabled || gtr_strcmp0( filename, p->monitor_path ) ) )
    652642    {
    653643        g_signal_handler_disconnect( p->monitor, p->monitor_tag );
     
    12991289    /* updating the model triggers off resort/refresh,
    13001290       so don't do it unless something's actually changed... */
    1301     if( ( newActivity != oldActivity ) ||
     1291    if( ( newActivity != oldActivity )
    13021292        || ( newFinished != oldFinished )
    13031293        || ( newPriority != oldPriority )
    1304         || tr_strcmp( oldTrackers, newTrackers )
    1305         ( (int)(newUpSpeed*10.0) != (int)(oldUpSpeed*10.0) ) ||
    1306         ( (int)(newDownSpeed*10.0) != (int)(oldDownSpeed*10.0) ) )
     1294        || ( gtr_strcmp0( oldTrackers, newTrackers ) )
     1295        || ( (int)(newUpSpeed*10.0) != (int)(oldUpSpeed*10.0) )
     1296        || ( (int)(newDownSpeed*10.0) != (int)(oldDownSpeed*10.0) ) )
    13071297    {
    13081298        gtk_list_store_set( GTK_LIST_STORE( model ), iter,
     
    15001490    const char * oldval = pref_string_get( key );
    15011491
    1502     if( tr_strcmp( oldval, newval ) )
     1492    if( gtr_strcmp0( oldval, newval ) )
    15031493    {
    15041494        pref_string_set( key, newval );
  • branches/2.0x/gtk/util.c

    r10827 r11110  
    456456#endif
    457457    return object;
     458}
     459
     460int
     461gtr_strcmp0( const char * str1, const char * str2 )
     462{
     463#if GLIB_CHECK_VERSION( 2, 16, 0 )
     464    return g_strcmp0( str1, str2 );
     465#else
     466    if( str1 && str2 ) return strcmp( str1, str2 );
     467    if( str1 ) return 1;
     468    if( str2 ) return -1;
     469    return 0;
     470#endif
    458471}
    459472
  • branches/2.0x/gtk/util.h

    r10698 r11110  
    130130gpointer gtr_object_ref_sink( gpointer object );
    131131
     132/* backwards-comparible wrapper around g_strcmp0() */
     133int gtr_strcmp0( const char * str1, const char * str2 );
     134
    132135/***
    133136****
Note: See TracChangeset for help on using the changeset viewer.