[libgda] GdaBrowser: use thread wrapper to catch the transaction status change signal
- From: Vivien Malerba <vivien src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgda] GdaBrowser: use thread wrapper to catch the transaction status change signal
- Date: Sun, 1 Aug 2010 15:52:57 +0000 (UTC)
commit b8ad01a5846a6e59709a26914fdaaf15f6ffe862
Author: Vivien Malerba <malerba gnome-db org>
Date: Sun Aug 1 10:36:02 2010 +0200
GdaBrowser: use thread wrapper to catch the transaction status change signal
tools/browser/browser-connection-priv.h | 1 +
tools/browser/browser-connection.c | 24 ++++++++++++++++--------
2 files changed, 17 insertions(+), 8 deletions(-)
---
diff --git a/tools/browser/browser-connection-priv.h b/tools/browser/browser-connection-priv.h
index e91062d..283596e 100644
--- a/tools/browser/browser-connection-priv.h
+++ b/tools/browser/browser-connection-priv.h
@@ -33,6 +33,7 @@ struct _BrowserConnectionPrivate {
GHashTable *executed_statements; /* key = guint exec ID, value = a StatementResult pointer */
gulong meta_store_signal;
+ gulong transaction_status_signal;
gchar *name;
GdaConnection *cnc;
diff --git a/tools/browser/browser-connection.c b/tools/browser/browser-connection.c
index 88d3cc4..4e77fdc 100644
--- a/tools/browser/browser-connection.c
+++ b/tools/browser/browser-connection.c
@@ -279,7 +279,9 @@ browser_connection_init (BrowserConnection *bcnc)
}
static void
-transaction_status_changed_cb (GdaConnection *cnc, BrowserConnection *bcnc)
+transaction_status_changed_cb (GdaThreadWrapper *wrapper, gpointer instance, const gchar *signame,
+ gint n_param_values, const GValue *param_values, gpointer gda_reserved,
+ BrowserConnection *bcnc)
{
g_signal_emit (bcnc, browser_connection_signals [TRANSACTION_STATUS_CHANGED], 0);
}
@@ -370,8 +372,14 @@ browser_connection_set_property (GObject *object,
return;
g_object_ref (bcnc->priv->cnc);
- g_signal_connect (bcnc->priv->cnc, "transaction-status-changed",
- G_CALLBACK (transaction_status_changed_cb), bcnc);
+ bcnc->priv->transaction_status_signal =
+ gda_thread_wrapper_connect_raw (bcnc->priv->wrapper,
+ bcnc->priv->cnc,
+ "transaction-status-changed",
+ FALSE, FALSE,
+ (GdaThreadWrapperCallback) transaction_status_changed_cb,
+ bcnc);
+
/* meta store */
gchar *dict_file_name = NULL;
@@ -545,12 +553,12 @@ browser_connection_dispose (GObject *object)
if (bcnc->priv->p_mstruct_mutex)
g_mutex_free (bcnc->priv->p_mstruct_mutex);
- if (bcnc->priv->cnc) {
- g_signal_handlers_disconnect_by_func (bcnc->priv->cnc,
- G_CALLBACK (transaction_status_changed_cb),
- bcnc);
+ if (bcnc->priv->transaction_status_signal)
+ gda_thread_wrapper_disconnect (bcnc->priv->wrapper,
+ bcnc->priv->transaction_status_signal);
+ if (bcnc->priv->cnc)
g_object_unref (bcnc->priv->cnc);
- }
+
if (bcnc->priv->parser)
g_object_unref (bcnc->priv->parser);
if (bcnc->priv->bfav) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]