Changeset 12219


Ignore:
Timestamp:
Mar 24, 2011, 6:20:47 PM (11 years ago)
Author:
jordan
Message:

(trunk gtk) remove function gtr_strcmp0, which is redundant due to tr_strcmp0

Location:
trunk/gtk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/gtk/main.c

    r12204 r12219  
    647647            if( !tr_urlParse( url, strlen( url ), &scheme, NULL, NULL, NULL ) )
    648648            {
    649                 if( !gtr_strcmp0( scheme, "socks4" ) )
     649                if( !tr_strcmp0( scheme, "socks4" ) )
    650650                    curl_easy_setopt( easy, CURLOPT_PROXYTYPE, (long)CURLPROXY_SOCKS4 );
    651                 else if( !gtr_strcmp0( scheme, "socks5" ) )
     651                else if( !tr_strcmp0( scheme, "socks5" ) )
    652652                    curl_easy_setopt( easy, CURLOPT_PROXYTYPE, (long)CURLPROXY_SOCKS5 );
    653                 else if( !gtr_strcmp0( scheme, "http" ) )
     653                else if( !tr_strcmp0( scheme, "http" ) )
    654654                    curl_easy_setopt( easy, CURLOPT_PROXYTYPE, (long)CURLPROXY_HTTP );
    655655            }
     
    690690        const char * mode = gconf_value_get_string( value );
    691691
    692         if( !gtr_strcmp0( mode, "auto" ) )
     692        if( !tr_strcmp0( mode, "auto" ) )
    693693        {
    694694            apply_desktop_proxy_settings( easy, client, "/system/proxy/autoconfig_url", NULL );
    695695            use_http_proxy = FALSE;
    696696        }
    697         else if( !gtr_strcmp0( mode, "manual" ))
     697        else if( !tr_strcmp0( mode, "manual" ))
    698698        {
    699699            char * scheme = NULL;
    700700            if( !tr_urlParse( destination, strlen( destination ), &scheme, NULL, NULL, NULL ) )
    701701            {
    702                 if( !gtr_strcmp0( scheme, "ftp" ) )
     702                if( !tr_strcmp0( scheme, "ftp" ) )
    703703                {
    704704                    apply_desktop_proxy_settings( easy, client, "/system/proxy/ftp_host", "/system/proxy/ftp_port" );
    705705                    use_http_proxy = FALSE;
    706706                }
    707                 else if( !gtr_strcmp0( scheme, "https" ) )
     707                else if( !tr_strcmp0( scheme, "https" ) )
    708708                {
    709709                    apply_desktop_proxy_settings( easy, client, "/system/proxy/secure_host", "/system/proxy/secure_port" );
  • trunk/gtk/tr-core.c

    r12204 r12219  
    443443        gtk_tree_model_get( m, a, MC_NAME_COLLATED, &ca, -1 );
    444444        gtk_tree_model_get( m, b, MC_NAME_COLLATED, &cb, -1 );
    445         ret = gtr_strcmp0( ca, cb );
     445        ret = tr_strcmp0( ca, cb );
    446446        g_free( cb );
    447447        g_free( ca );
     
    756756    struct TrCorePrivate * p = TR_CORE( core )->priv;
    757757
    758     if( p->monitor && ( !is_enabled || gtr_strcmp0( dir, p->monitor_dir ) ) )
     758    if( p->monitor && ( !is_enabled || tr_strcmp0( dir, p->monitor_dir ) ) )
    759759    {
    760760        g_signal_handler_disconnect( p->monitor, p->monitor_tag );
     
    14031403        || ( newError != oldError )
    14041404        || ( newActivePeerCount != oldActivePeerCount )
    1405         || gtr_strcmp0( oldTrackers, newTrackers )
    1406         || gtr_strcmp0( oldCollatedName, newCollatedName )
     1405        || tr_strcmp0( oldTrackers, newTrackers )
     1406        || tr_strcmp0( oldCollatedName, newCollatedName )
    14071407        || gtr_compare_double( newUpSpeed, oldUpSpeed, 3 )
    14081408        || gtr_compare_double( newDownSpeed, oldDownSpeed, 3 )
     
    15831583gtr_core_set_pref( TrCore * self, const char * key, const char * newval )
    15841584{
    1585     if( gtr_strcmp0( newval, gtr_pref_string_get( key ) ) )
     1585    if( tr_strcmp0( newval, gtr_pref_string_get( key ) ) )
    15861586    {
    15871587        gtr_pref_string_set( key, newval );
  • trunk/gtk/util.c

    r12126 r12219  
    399399#endif
    400400    return object;
    401 }
    402 
    403 int
    404 gtr_strcmp0( const char * str1, const char * str2 )
    405 {
    406 #if GLIB_CHECK_VERSION( 2, 16, 0 )
    407     return g_strcmp0( str1, str2 );
    408 #else
    409     if( str1 && str2 ) return strcmp( str1, str2 );
    410     if( str1 ) return 1;
    411     if( str2 ) return -1;
    412     return 0;
    413 #endif
    414401}
    415402
  • trunk/gtk/util.h

    r12091 r12219  
    143143gpointer gtr_object_ref_sink( gpointer object );
    144144
    145 /* backwards-compatible wrapper around g_strcmp0() */
    146 int gtr_strcmp0( const char * str1, const char * str2 );
    147 
    148145/* backwards-compatible wrapper around g_dngettext() */
    149146const gchar* gtr_ngettext( const gchar*, const gchar*, gulong );
Note: See TracChangeset for help on using the changeset viewer.