From 6d1869c33bf6ed295af2cd867224d1ecd935c68e Mon Sep 17 00:00:00 2001 From: Jordan Lee Date: Mon, 8 Aug 2011 17:06:46 +0000 Subject: [PATCH] remove the gtr_timeout_add_seconds() portability wrapper around gdk_threads_add_timeout_seconds(); it's unnecessary now that the minimum gtk version's been bumped. --- gtk/details.c | 4 ++-- gtk/file-list.c | 2 +- gtk/main.c | 2 +- gtk/makemeta-ui.c | 2 +- gtk/msgwin.c | 2 +- gtk/relocate.c | 2 +- gtk/stats.c | 2 +- gtk/tr-core.c | 2 +- gtk/tr-prefs.c | 2 +- gtk/util.c | 6 ------ gtk/util.h | 3 --- 11 files changed, 10 insertions(+), 19 deletions(-) diff --git a/gtk/details.c b/gtk/details.c index 09b167162..8c80b808c 100644 --- a/gtk/details.c +++ b/gtk/details.c @@ -2564,8 +2564,8 @@ gtr_torrent_details_dialog_new( GtkWindow * parent, TrCore * core ) gtk_notebook_append_page( GTK_NOTEBOOK( n ), w, l ); gtr_dialog_set_content( GTK_DIALOG( d ), n ); - di->periodic_refresh_tag = gtr_timeout_add_seconds( SECONDARY_WINDOW_REFRESH_INTERVAL_SECONDS, - periodic_refresh, di ); + di->periodic_refresh_tag = gdk_threads_add_timeout_seconds( SECONDARY_WINDOW_REFRESH_INTERVAL_SECONDS, + periodic_refresh, di ); return d; } diff --git a/gtk/file-list.c b/gtk/file-list.c index 3ae8a3a4a..93ebc45ba 100644 --- a/gtk/file-list.c +++ b/gtk/file-list.c @@ -562,7 +562,7 @@ gtr_file_list_set_torrent( GtkWidget * w, int torrentId ) } refresh( data ); - data->timeout_tag = gtr_timeout_add_seconds( SECONDARY_WINDOW_REFRESH_INTERVAL_SECONDS, refreshModel, data ); + data->timeout_tag = gdk_threads_add_timeout_seconds( SECONDARY_WINDOW_REFRESH_INTERVAL_SECONDS, refreshModel, data ); } gtk_tree_view_set_model( GTK_TREE_VIEW( data->view ), data->model ); diff --git a/gtk/main.c b/gtk/main.c index 985efe207..a37f128d2 100644 --- a/gtk/main.c +++ b/gtk/main.c @@ -839,7 +839,7 @@ app_setup( TrWindow * wind, on_prefs_changed( cbdata->core, PREF_KEY_SHOW_TRAY_ICON, cbdata ); /* start model update timer */ - cbdata->timer = gtr_timeout_add_seconds( MAIN_WINDOW_REFRESH_INTERVAL_SECONDS, update_model_loop, cbdata ); + cbdata->timer = gdk_threads_add_timeout_seconds( MAIN_WINDOW_REFRESH_INTERVAL_SECONDS, update_model_loop, cbdata ); update_model_once( cbdata ); /* either show the window or iconify it */ diff --git a/gtk/makemeta-ui.c b/gtk/makemeta-ui.c index e6305a91d..ea3146691 100644 --- a/gtk/makemeta-ui.c +++ b/gtk/makemeta-ui.c @@ -190,7 +190,7 @@ makeProgressDialog( GtkWidget * parent, MakeMetaUI * ui ) ui->progress_bar = w; gtk_box_pack_start( GTK_BOX( v ), w, FALSE, FALSE, 0 ); - ui->progress_tag = gtr_timeout_add_seconds( SECONDARY_WINDOW_REFRESH_INTERVAL_SECONDS, onProgressDialogRefresh, ui ); + ui->progress_tag = gdk_threads_add_timeout_seconds( SECONDARY_WINDOW_REFRESH_INTERVAL_SECONDS, onProgressDialogRefresh, ui ); g_object_weak_ref( G_OBJECT( d ), onProgressDialogDestroyed, ui ); onProgressDialogRefresh( ui ); diff --git a/gtk/msgwin.c b/gtk/msgwin.c index 6bcb2fe6b..f43c5a042 100644 --- a/gtk/msgwin.c +++ b/gtk/msgwin.c @@ -535,7 +535,7 @@ gtr_message_log_window_new( GtkWindow * parent, TrCore * core ) gtk_box_pack_start( GTK_BOX( vbox ), w, TRUE, TRUE, 0 ); gtk_container_add( GTK_CONTAINER( win ), vbox ); - data->refresh_tag = gtr_timeout_add_seconds( SECONDARY_WINDOW_REFRESH_INTERVAL_SECONDS, onRefresh, data ); + data->refresh_tag = gdk_threads_add_timeout_seconds( SECONDARY_WINDOW_REFRESH_INTERVAL_SECONDS, onRefresh, data ); g_object_weak_ref( G_OBJECT( win ), onWindowDestroyed, data ); scroll_to_bottom( data ); diff --git a/gtk/relocate.c b/gtk/relocate.c index 3a91b4aef..0e9a99038 100644 --- a/gtk/relocate.c +++ b/gtk/relocate.c @@ -134,7 +134,7 @@ onResponse( GtkDialog * dialog, int response, gpointer unused UNUSED ) data->message_dialog = w; data->done = TR_LOC_DONE; onTimer( data ); - gtr_timeout_add_seconds( 1, onTimer, data ); + gdk_threads_add_timeout_seconds( 1, onTimer, data ); } else { diff --git a/gtk/stats.c b/gtk/stats.c index 2f51459ea..456e35938 100644 --- a/gtk/stats.c +++ b/gtk/stats.c @@ -182,7 +182,7 @@ gtr_stats_dialog_new( GtkWindow * parent, TrCore * core ) updateStats( ui ); g_object_set_data_full( G_OBJECT( d ), "data", ui, g_free ); g_signal_connect( d, "response", G_CALLBACK( dialogResponse ), ui ); - i = gtr_timeout_add_seconds( SECONDARY_WINDOW_REFRESH_INTERVAL_SECONDS, updateStats, ui ); + i = gdk_threads_add_timeout_seconds( SECONDARY_WINDOW_REFRESH_INTERVAL_SECONDS, updateStats, ui ); g_object_weak_ref( G_OBJECT( d ), dialogDestroyed, GUINT_TO_POINTER( i ) ); return d; } diff --git a/gtk/tr-core.c b/gtk/tr-core.c index 29f2b4b84..3ed8044ed 100644 --- a/gtk/tr-core.c +++ b/gtk/tr-core.c @@ -799,7 +799,7 @@ core_watchdir_monitor_file( TrCore * core, const char * filename ) p->monitor_files = g_slist_append( p->monitor_files, watchdir_file_new( filename ) ); if( !p->monitor_idle_tag ) - p->monitor_idle_tag = gtr_timeout_add_seconds( 1, core_watchdir_idle, core ); + p->monitor_idle_tag = gdk_threads_add_timeout_seconds( 1, core_watchdir_idle, core ); } } diff --git a/gtk/tr-prefs.c b/gtk/tr-prefs.c index 098955a63..951e31673 100644 --- a/gtk/tr-prefs.c +++ b/gtk/tr-prefs.c @@ -140,7 +140,7 @@ spun_cb( GtkSpinButton * w, gpointer core, gboolean isDouble ) data->isDouble = isDouble; g_object_set_data_full( o, IDLE_DATA, data, spin_idle_data_free ); g_object_ref( G_OBJECT( o ) ); - gtr_timeout_add_seconds( 1, spun_cb_idle, w ); + gdk_threads_add_timeout_seconds( 1, spun_cb_idle, w ); } g_timer_start( data->last_change ); } diff --git a/gtk/util.c b/gtk/util.c index d84590f0f..19495abbf 100644 --- a/gtk/util.c +++ b/gtk/util.c @@ -626,12 +626,6 @@ gtr_idle_add( GSourceFunc function, gpointer data ) return gdk_threads_add_idle( function, data ); } -guint -gtr_timeout_add_seconds( guint seconds, GSourceFunc function, gpointer data ) -{ - return gdk_threads_add_timeout_seconds( seconds, function, data ); -} - void gtr_http_failure_dialog( GtkWidget * parent, const char * url, long response_code ) { diff --git a/gtk/util.h b/gtk/util.h index 851331a11..1c5ece080 100644 --- a/gtk/util.h +++ b/gtk/util.h @@ -108,9 +108,6 @@ const char* gtr_get_help_uri( void ); **** ***/ -/* backwards-compatible wrapper around gdk_threads_add_timeout_seconds() */ -guint gtr_timeout_add_seconds( guint seconds, GSourceFunc func, gpointer data ); - /* backwards-compatible wrapper around gdk_threads_add_idle() */ guint gtr_idle_add( GSourceFunc func, gpointer data );