mirror of
https://github.com/transmission/transmission
synced 2025-03-10 14:13:23 +00:00
(trunk gtk) remove function gtr_strcmp0, which is redundant due to tr_strcmp0
This commit is contained in:
parent
1dd57609d5
commit
5417711cd4
4 changed files with 12 additions and 28 deletions
14
gtk/main.c
14
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;
|
||||
|
|
|
@ -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 );
|
||||
|
|
13
gtk/util.c
13
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,
|
||||
|
|
|
@ -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 );
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue