[tracker/gdbus-porting-rebased: 9/65] libtracker-miner: it's possible that miners emit signals before constructed
- From: Philip Van Hoof <pvanhoof src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/gdbus-porting-rebased: 9/65] libtracker-miner: it's possible that miners emit signals before constructed
- Date: Wed, 12 Jan 2011 11:16:31 +0000 (UTC)
commit d8059499750b65a78aef95e0cf28a59b099d23e1
Author: Philip Van Hoof <philip codeminded be>
Date: Thu Dec 30 13:33:39 2010 +0100
libtracker-miner: it's possible that miners emit signals before constructed
src/libtracker-miner/tracker-miner-object.c | 86 +++++++++++++++------------
1 files changed, 47 insertions(+), 39 deletions(-)
---
diff --git a/src/libtracker-miner/tracker-miner-object.c b/src/libtracker-miner/tracker-miner-object.c
index 16b7e61..83822c3 100644
--- a/src/libtracker-miner/tracker-miner-object.c
+++ b/src/libtracker-miner/tracker-miner-object.c
@@ -56,7 +56,6 @@
static GQuark miner_error_quark = 0;
-
/* Introspection data for the service we are exporting */
static const gchar introspection_xml[] =
"<node>"
@@ -325,15 +324,17 @@ miner_update_progress (TrackerMiner *miner)
miner->private->status,
miner->private->progress);
- g_dbus_connection_emit_signal (miner->private->d_connection,
- NULL,
- miner->private->full_path,
- TRACKER_MINER_DBUS_INTERFACE,
- "Progress",
- g_variant_new ("(sd)",
- miner->private->status,
- miner->private->progress),
- NULL);
+ if (miner->private->d_connection) {
+ g_dbus_connection_emit_signal (miner->private->d_connection,
+ NULL,
+ miner->private->full_path,
+ TRACKER_MINER_DBUS_INTERFACE,
+ "Progress",
+ g_variant_new ("(sd)",
+ miner->private->status,
+ miner->private->progress),
+ NULL);
+ }
}
static void
@@ -472,13 +473,15 @@ tracker_miner_start (TrackerMiner *miner)
g_signal_emit (miner, signals[STARTED], 0);
- g_dbus_connection_emit_signal (miner->private->d_connection,
- NULL,
- miner->private->full_path,
- TRACKER_MINER_DBUS_INTERFACE,
- "Started",
- NULL,
- NULL);
+ if (miner->private->d_connection) {
+ g_dbus_connection_emit_signal (miner->private->d_connection,
+ NULL,
+ miner->private->full_path,
+ TRACKER_MINER_DBUS_INTERFACE,
+ "Started",
+ NULL,
+ NULL);
+ }
}
/**
@@ -497,13 +500,15 @@ tracker_miner_stop (TrackerMiner *miner)
g_signal_emit (miner, signals[STOPPED], 0);
- g_dbus_connection_emit_signal (miner->private->d_connection,
- NULL,
- miner->private->full_path,
- TRACKER_MINER_DBUS_INTERFACE,
- "Stopped",
- NULL,
- NULL);
+ if (miner->private->d_connection) {
+ g_dbus_connection_emit_signal (miner->private->d_connection,
+ NULL,
+ miner->private->full_path,
+ TRACKER_MINER_DBUS_INTERFACE,
+ "Stopped",
+ NULL,
+ NULL);
+ }
}
/**
@@ -573,13 +578,15 @@ tracker_miner_pause_internal (TrackerMiner *miner,
g_message ("Miner:'%s' is pausing", miner->private->name);
g_signal_emit (miner, signals[PAUSED], 0);
- g_dbus_connection_emit_signal (miner->private->d_connection,
- NULL,
- miner->private->full_path,
- TRACKER_MINER_DBUS_INTERFACE,
- "Paused",
- NULL,
- NULL);
+ if (miner->private->d_connection) {
+ g_dbus_connection_emit_signal (miner->private->d_connection,
+ NULL,
+ miner->private->full_path,
+ TRACKER_MINER_DBUS_INTERFACE,
+ "Paused",
+ NULL,
+ NULL);
+ }
}
return pd->cookie;
@@ -646,13 +653,15 @@ tracker_miner_resume (TrackerMiner *miner,
g_message ("Miner:'%s' is resuming", miner->private->name);
g_signal_emit (miner, signals[RESUMED], 0);
- g_dbus_connection_emit_signal (miner->private->d_connection,
- NULL,
- miner->private->full_path,
- TRACKER_MINER_DBUS_INTERFACE,
- "Resumed",
- NULL,
- NULL);
+ if (miner->private->d_connection) {
+ g_dbus_connection_emit_signal (miner->private->d_connection,
+ NULL,
+ miner->private->full_path,
+ TRACKER_MINER_DBUS_INTERFACE,
+ "Resumed",
+ NULL,
+ NULL);
+ }
}
return TRUE;
@@ -704,7 +713,6 @@ miner_finalize (GObject *object)
G_OBJECT_CLASS (tracker_miner_parent_class)->finalize (object);
}
-
static void
handle_method_call_ignore_next_update (TrackerMiner *miner,
GDBusMethodInvocation *invocation,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]