[tracker/gdbus: 22/92] libtracker-miner: it's possible that miners emit signals before constructed
- From: Jürg Billeter <juergbi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/gdbus: 22/92] libtracker-miner: it's possible that miners emit signals before constructed
- Date: Mon, 17 Jan 2011 09:33:30 +0000 (UTC)
commit cdfbfa24ce60e14235b26a88699334257fa0df43
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 66c5bec..0557173 100644
--- a/src/libtracker-miner/tracker-miner-object.c
+++ b/src/libtracker-miner/tracker-miner-object.c
@@ -58,7 +58,6 @@
static GQuark miner_error_quark = 0;
-
/* Introspection data for the service we are exporting */
static const gchar introspection_xml[] =
"<node>"
@@ -327,15 +326,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
@@ -474,13 +475,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);
+ }
}
/**
@@ -499,13 +502,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);
+ }
}
/**
@@ -575,13 +580,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;
@@ -648,13 +655,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;
@@ -706,7 +715,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]