1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2025-03-10 14:13:23 +00:00

remove the gtr_idle_add() portability wrapper around gdk_threads_add_idle() -- it's unnecessary now that the minimum gtk version's been bumped.

This commit is contained in:
Jordan Lee 2011-08-08 17:10:55 +00:00
parent 6d1869c33b
commit 8d89a16f4f
7 changed files with 15 additions and 24 deletions

View file

@ -17,7 +17,7 @@
#include <libtransmission/web.h> /* tr_webRun() */ #include <libtransmission/web.h> /* tr_webRun() */
#include "favicon.h" #include "favicon.h"
#include "util.h" /* gtr_idle_add() */ #include "util.h" /* gtr_get_host_from_url() */
#define IMAGE_TYPES 4 #define IMAGE_TYPES 4
static const char * image_types[IMAGE_TYPES] = { "ico", "png", "gif", "jpg" }; static const char * image_types[IMAGE_TYPES] = { "ico", "png", "gif", "jpg" };
@ -140,7 +140,7 @@ favicon_web_done_cb( tr_session * session UNUSED,
fav->contents = g_memdup( data, len ); fav->contents = g_memdup( data, len );
fav->len = len; fav->len = len;
gtr_idle_add( favicon_web_done_idle_cb, fav ); gdk_threads_add_idle( favicon_web_done_idle_cb, fav );
} }
void void

View file

@ -22,7 +22,7 @@
#include "filter.h" #include "filter.h"
#include "hig.h" /* GUI_PAD */ #include "hig.h" /* GUI_PAD */
#include "tr-core.h" /* MC_TORRENT */ #include "tr-core.h" /* MC_TORRENT */
#include "util.h" /* gtr_idle_add() */ #include "util.h" /* gtr_get_host_from_url() */
static GQuark DIRTY_KEY = 0; static GQuark DIRTY_KEY = 0;
static GQuark SESSION_KEY = 0; static GQuark SESSION_KEY = 0;
@ -378,7 +378,7 @@ category_model_update_idle( gpointer category_model )
{ {
GSourceFunc func = (GSourceFunc) category_filter_model_update; GSourceFunc func = (GSourceFunc) category_filter_model_update;
g_object_set_qdata( o, DIRTY_KEY, GINT_TO_POINTER(1) ); g_object_set_qdata( o, DIRTY_KEY, GINT_TO_POINTER(1) );
gtr_idle_add( func, category_model ); gdk_threads_add_idle( func, category_model );
} }
} }
@ -750,7 +750,7 @@ activity_model_update_idle( gpointer activity_model )
{ {
GSourceFunc func = (GSourceFunc) activity_filter_model_update; GSourceFunc func = (GSourceFunc) activity_filter_model_update;
g_object_set_qdata( o, DIRTY_KEY, GINT_TO_POINTER(1) ); g_object_set_qdata( o, DIRTY_KEY, GINT_TO_POINTER(1) );
gtr_idle_add( func, activity_model ); gdk_threads_add_idle( func, activity_model );
} }
} }

View file

@ -334,7 +334,7 @@ refresh_actions_soon( gpointer gdata )
struct cbdata * data = gdata; struct cbdata * data = gdata;
if( data->refresh_actions_tag == 0 ) if( data->refresh_actions_tag == 0 )
data->refresh_actions_tag = gtr_idle_add( refresh_actions, data ); data->refresh_actions_tag = gdk_threads_add_idle( refresh_actions, data );
} }
static void static void
@ -467,7 +467,7 @@ on_rpc_changed( tr_session * session,
struct torrent_idle_data * data = g_new0( struct torrent_idle_data, 1 ); struct torrent_idle_data * data = g_new0( struct torrent_idle_data, 1 );
data->id = tr_torrentId( tor ); data->id = tr_torrentId( tor );
data->core = cbdata->core; data->core = cbdata->core;
gtr_idle_add( rpc_torrent_add_idle, data ); gdk_threads_add_idle( rpc_torrent_add_idle, data );
break; break;
} }
@ -477,7 +477,7 @@ on_rpc_changed( tr_session * session,
data->id = tr_torrentId( tor ); data->id = tr_torrentId( tor );
data->core = cbdata->core; data->core = cbdata->core;
data->delete_files = type == TR_RPC_TORRENT_TRASHING; data->delete_files = type == TR_RPC_TORRENT_TRASHING;
gtr_idle_add( rpc_torrent_remove_idle, data ); gdk_threads_add_idle( rpc_torrent_remove_idle, data );
status = TR_RPC_NOREMOVE; status = TR_RPC_NOREMOVE;
break; break;
} }
@ -1053,7 +1053,7 @@ session_close_threadfunc( gpointer gdata )
struct cbdata * cbdata = gdata; struct cbdata * cbdata = gdata;
gdk_threads_enter( ); gdk_threads_enter( );
gtr_core_close( cbdata->core ); gtr_core_close( cbdata->core );
gtr_idle_add( on_session_closed, gdata ); gdk_threads_add_idle( on_session_closed, gdata );
gdk_threads_leave( ); gdk_threads_leave( );
return NULL; return NULL;
} }
@ -1442,7 +1442,7 @@ update_model_soon( gpointer gdata )
struct cbdata *data = gdata; struct cbdata *data = gdata;
if( data->update_model_soon_tag == 0 ) if( data->update_model_soon_tag == 0 )
data->update_model_soon_tag = gtr_idle_add( update_model_once, data ); data->update_model_soon_tag = gdk_threads_add_idle( update_model_once, data );
} }
static gboolean static gboolean

View file

@ -980,7 +980,7 @@ on_torrent_completeness_changed( tr_torrent * tor,
data->core = gcore; data->core = gcore;
data->torrent_id = tr_torrentId( tor ); data->torrent_id = tr_torrentId( tor );
g_object_ref( G_OBJECT( data->core ) ); g_object_ref( G_OBJECT( data->core ) );
gtr_idle_add( on_torrent_completeness_changed_idle, data ); gdk_threads_add_idle( on_torrent_completeness_changed_idle, data );
} }
} }
@ -1059,7 +1059,7 @@ on_torrent_metadata_changed( tr_torrent * tor, void * gcore )
data->core = gcore; data->core = gcore;
data->torrent_id = tr_torrentId( tor ); data->torrent_id = tr_torrentId( tor );
g_object_ref( G_OBJECT( data->core ) ); g_object_ref( G_OBJECT( data->core ) );
gtr_idle_add( on_torrent_metadata_changed_idle, data ); gdk_threads_add_idle( on_torrent_metadata_changed_idle, data );
} }
/*** /***
@ -1278,7 +1278,7 @@ on_url_done( tr_session * session,
core_apply_defaults( data->ctor ); core_apply_defaults( data->ctor );
tr_ctorSetMetainfo( data->ctor, response, response_byte_count ); tr_ctorSetMetainfo( data->ctor, response, response_byte_count );
gtr_idle_add( on_url_done_idle, data ); gdk_threads_add_idle( on_url_done_idle, data );
} }
void void
@ -1766,7 +1766,7 @@ core_read_rpc_response( tr_session * session UNUSED,
{ {
struct evbuffer * buf = evbuffer_new( ); struct evbuffer * buf = evbuffer_new( );
evbuffer_add_buffer( buf, response ); evbuffer_add_buffer( buf, response );
gtr_idle_add( core_read_rpc_response_idle, buf ); gdk_threads_add_idle( core_read_rpc_response_idle, buf );
} }
static void static void

View file

@ -345,7 +345,7 @@ onAltSpeedToggledIdle( gpointer vp )
static void static void
onAltSpeedToggled( tr_session * s UNUSED, bool isEnabled UNUSED, bool byUser UNUSED, void * p ) onAltSpeedToggled( tr_session * s UNUSED, bool isEnabled UNUSED, bool byUser UNUSED, void * p )
{ {
gtr_idle_add( onAltSpeedToggledIdle, p ); gdk_threads_add_idle( onAltSpeedToggledIdle, p );
} }
/*** /***

View file

@ -620,12 +620,6 @@ gtr_dialog_set_content( GtkDialog * dialog, GtkWidget * content )
**** ****
***/ ***/
guint
gtr_idle_add( GSourceFunc function, gpointer data )
{
return gdk_threads_add_idle( function, data );
}
void void
gtr_http_failure_dialog( GtkWidget * parent, const char * url, long response_code ) gtr_http_failure_dialog( GtkWidget * parent, const char * url, long response_code )
{ {

View file

@ -108,9 +108,6 @@ const char* gtr_get_help_uri( void );
**** ****
***/ ***/
/* backwards-compatible wrapper around gdk_threads_add_idle() */
guint gtr_idle_add( GSourceFunc func, gpointer data );
/* backwards-compatible wrapper around gtk_widget_set_visible() */ /* backwards-compatible wrapper around gtk_widget_set_visible() */
void gtr_widget_set_visible( GtkWidget *, gboolean ); void gtr_widget_set_visible( GtkWidget *, gboolean );