From 5417711cd4c4ddc732a81d7912a6e05d8c9d7f91 Mon Sep 17 00:00:00 2001 From: Jordan Lee Date: Thu, 24 Mar 2011 18:20:47 +0000 Subject: [PATCH] (trunk gtk) remove function gtr_strcmp0, which is redundant due to tr_strcmp0 --- gtk/main.c | 14 +++++++------- gtk/tr-core.c | 10 +++++----- gtk/util.c | 13 ------------- gtk/util.h | 3 --- 4 files changed, 12 insertions(+), 28 deletions(-) diff --git a/gtk/main.c b/gtk/main.c index b799c882a..1c03a5f35 100644 --- a/gtk/main.c +++ b/gtk/main.c @@ -646,11 +646,11 @@ apply_desktop_proxy_settings( CURL * easy, GConfClient * client, const char * ho if( !tr_urlParse( url, strlen( url ), &scheme, NULL, NULL, NULL ) ) { - if( !gtr_strcmp0( scheme, "socks4" ) ) + if( !tr_strcmp0( scheme, "socks4" ) ) curl_easy_setopt( easy, CURLOPT_PROXYTYPE, (long)CURLPROXY_SOCKS4 ); - else if( !gtr_strcmp0( scheme, "socks5" ) ) + else if( !tr_strcmp0( scheme, "socks5" ) ) curl_easy_setopt( easy, CURLOPT_PROXYTYPE, (long)CURLPROXY_SOCKS5 ); - else if( !gtr_strcmp0( scheme, "http" ) ) + else if( !tr_strcmp0( scheme, "http" ) ) curl_easy_setopt( easy, CURLOPT_PROXYTYPE, (long)CURLPROXY_HTTP ); } @@ -689,22 +689,22 @@ curl_config_func( tr_session * session UNUSED, void * vcurl UNUSED, const char * { const char * mode = gconf_value_get_string( value ); - if( !gtr_strcmp0( mode, "auto" ) ) + if( !tr_strcmp0( mode, "auto" ) ) { apply_desktop_proxy_settings( easy, client, "/system/proxy/autoconfig_url", NULL ); use_http_proxy = FALSE; } - else if( !gtr_strcmp0( mode, "manual" )) + else if( !tr_strcmp0( mode, "manual" )) { char * scheme = NULL; if( !tr_urlParse( destination, strlen( destination ), &scheme, NULL, NULL, NULL ) ) { - if( !gtr_strcmp0( scheme, "ftp" ) ) + if( !tr_strcmp0( scheme, "ftp" ) ) { apply_desktop_proxy_settings( easy, client, "/system/proxy/ftp_host", "/system/proxy/ftp_port" ); use_http_proxy = FALSE; } - else if( !gtr_strcmp0( scheme, "https" ) ) + else if( !tr_strcmp0( scheme, "https" ) ) { apply_desktop_proxy_settings( easy, client, "/system/proxy/secure_host", "/system/proxy/secure_port" ); use_http_proxy = FALSE; diff --git a/gtk/tr-core.c b/gtk/tr-core.c index 2df1b6aaf..b50dc59e0 100644 --- a/gtk/tr-core.c +++ b/gtk/tr-core.c @@ -442,7 +442,7 @@ compare_by_name( GtkTreeModel * m, GtkTreeIter * a, GtkTreeIter * b, gpointer us char *ca, *cb; gtk_tree_model_get( m, a, MC_NAME_COLLATED, &ca, -1 ); gtk_tree_model_get( m, b, MC_NAME_COLLATED, &cb, -1 ); - ret = gtr_strcmp0( ca, cb ); + ret = tr_strcmp0( ca, cb ); g_free( cb ); g_free( ca ); } @@ -755,7 +755,7 @@ core_watchdir_update( TrCore * core ) const gboolean is_enabled = gtr_pref_flag_get( PREF_KEY_DIR_WATCH_ENABLED ); struct TrCorePrivate * p = TR_CORE( core )->priv; - if( p->monitor && ( !is_enabled || gtr_strcmp0( dir, p->monitor_dir ) ) ) + if( p->monitor && ( !is_enabled || tr_strcmp0( dir, p->monitor_dir ) ) ) { g_signal_handler_disconnect( p->monitor, p->monitor_tag ); g_free( p->monitor_dir ); @@ -1402,8 +1402,8 @@ update_foreach( GtkTreeModel * model, || ( newPriority != oldPriority ) || ( newError != oldError ) || ( newActivePeerCount != oldActivePeerCount ) - || gtr_strcmp0( oldTrackers, newTrackers ) - || gtr_strcmp0( oldCollatedName, newCollatedName ) + || tr_strcmp0( oldTrackers, newTrackers ) + || tr_strcmp0( oldCollatedName, newCollatedName ) || gtr_compare_double( newUpSpeed, oldUpSpeed, 3 ) || gtr_compare_double( newDownSpeed, oldDownSpeed, 3 ) || gtr_compare_double( newRecheckProgress, oldRecheckProgress, 2 ) ) @@ -1582,7 +1582,7 @@ core_commit_prefs_change( TrCore * core, const char * key ) void gtr_core_set_pref( TrCore * self, const char * key, const char * newval ) { - if( gtr_strcmp0( newval, gtr_pref_string_get( key ) ) ) + if( tr_strcmp0( newval, gtr_pref_string_get( key ) ) ) { gtr_pref_string_set( key, newval ); core_commit_prefs_change( self, key ); diff --git a/gtk/util.c b/gtk/util.c index 4b8afa5cc..7b62bb704 100644 --- a/gtk/util.c +++ b/gtk/util.c @@ -400,19 +400,6 @@ gtr_object_ref_sink( gpointer object ) return object; } -int -gtr_strcmp0( const char * str1, const char * str2 ) -{ -#if GLIB_CHECK_VERSION( 2, 16, 0 ) - return g_strcmp0( str1, str2 ); -#else - if( str1 && str2 ) return strcmp( str1, str2 ); - if( str1 ) return 1; - if( str2 ) return -1; - return 0; -#endif -} - const gchar * gtr_ngettext( const gchar * msgid, const gchar * msgid_plural, diff --git a/gtk/util.h b/gtk/util.h index c01e3dc51..7c0f56830 100644 --- a/gtk/util.h +++ b/gtk/util.h @@ -142,9 +142,6 @@ void gtr_cell_renderer_get_padding( GtkCellRenderer *, gint * xpad, gint * ypad /* backwards-compatible wrapper around g_object_ref_sink() */ gpointer gtr_object_ref_sink( gpointer object ); -/* backwards-compatible wrapper around g_strcmp0() */ -int gtr_strcmp0( const char * str1, const char * str2 ); - /* backwards-compatible wrapper around g_dngettext() */ const gchar* gtr_ngettext( const gchar*, const gchar*, gulong );