summaryrefslogtreecommitdiffstats
path: root/gtk/src/callbacks.c
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2008-11-25 21:41:23 +0000
committerjstebbins <[email protected]>2008-11-25 21:41:23 +0000
commit54c7e6f7e9f5c2bb57fcca2808fce07aaf0589c9 (patch)
tree90538fbf6bd535335c1067f41fbc8fa1bbba8efd /gtk/src/callbacks.c
parent98d6ebb52840ae25250364cdc002a97560d6c3f1 (diff)
LinGui: make socket connect for appcast run in its own thread. prevents
long delay at startup when there are network issues. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1954 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'gtk/src/callbacks.c')
-rw-r--r--gtk/src/callbacks.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/gtk/src/callbacks.c b/gtk/src/callbacks.c
index 0b8ee4c90..5f2a55a43 100644
--- a/gtk/src/callbacks.c
+++ b/gtk/src/callbacks.c
@@ -2699,7 +2699,7 @@ html_link_cb(GtkHTML *html, const gchar *url, signal_user_data_t *ud)
browse_url(url);
}
-static gboolean check_stable_update(signal_user_data_t *ud);
+static gpointer check_stable_update(signal_user_data_t *ud);
static gboolean stable_update_lock = FALSE;
static void
@@ -2724,7 +2724,7 @@ process_appcast(signal_user_data_t *ud)
|| ibuild <= HB_BUILD || skip == ibuild)
{
if (!stable_update_lock && HB_BUILD % 100)
- g_idle_add((GSourceFunc)check_stable_update, ud);
+ g_thread_create((GThreadFunc)check_stable_update, ud, FALSE, NULL);
goto done;
}
msg = g_strdup_printf("HandBrake %s/%s is now available (you have %s/%d).",
@@ -2842,7 +2842,7 @@ ghb_net_open(signal_user_data_t *ud, gchar *address, gint port)
return ioc;
}
-gboolean
+gpointer
ghb_check_update(signal_user_data_t *ud)
{
gchar *query;
@@ -2863,16 +2863,16 @@ ghb_check_update(signal_user_data_t *ud)
}
ioc = ghb_net_open(ud, "handbrake.fr", 80);
if (ioc == NULL)
- return FALSE;
+ return NULL;
g_io_channel_write_chars(ioc, query, strlen(query), &len, &gerror);
g_io_channel_flush(ioc, &gerror);
// This function is initiated by g_idle_add. Must return false
// so that it is not called again
- return FALSE;
+ return NULL;
}
-static gboolean
+static gpointer
check_stable_update(signal_user_data_t *ud)
{
gchar *query;
@@ -2885,12 +2885,12 @@ check_stable_update(signal_user_data_t *ud)
query = "GET /appcast.xml HTTP/1.0\r\nHost: handbrake.fr\r\n\r\n";
ioc = ghb_net_open(ud, "handbrake.fr", 80);
if (ioc == NULL)
- return FALSE;
+ return NULL;
g_io_channel_write_chars(ioc, query, strlen(query), &len, &gerror);
g_io_channel_flush(ioc, &gerror);
// This function is initiated by g_idle_add. Must return false
// so that it is not called again
- return FALSE;
+ return NULL;
}