[tracker/signal-enhancements] tracker-store: Code cleanup signal enhancements
- From: Philip Van Hoof <pvanhoof src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/signal-enhancements] tracker-store: Code cleanup signal enhancements
- Date: Thu, 16 Dec 2010 11:38:46 +0000 (UTC)
commit 06f457557f14842da25a2e645b0e88088d2a0390
Author: Philip Van Hoof <philip codeminded be>
Date: Thu Dec 16 12:38:32 2010 +0100
tracker-store: Code cleanup signal enhancements
src/tracker-store/tracker-resources.c | 47 +++++++++++++-------------------
1 files changed, 19 insertions(+), 28 deletions(-)
---
diff --git a/src/tracker-store/tracker-resources.c b/src/tracker-store/tracker-resources.c
index 6cf2d55..ba854da 100644
--- a/src/tracker-store/tracker-resources.c
+++ b/src/tracker-store/tracker-resources.c
@@ -452,6 +452,23 @@ update_batch_callback (GError *error, gpointer user_data)
}
+static void
+shared_thaw_signal (TrackerResources *self)
+{
+ TrackerResourcesPrivate *priv = TRACKER_RESOURCES_GET_PRIVATE (self);
+
+ /* If it was frozen (previous call was a batch_update, then immediately
+ * restart the signal, as on_statements_committed will happen in a gidle
+ * and that means that if a new batch_update happens, we'll be frozen
+ * again before on_statements_committed can unfreeze us - I know, awkward */
+
+ if (!priv->signal_configured && priv->freeze_emission) {
+ configure_signal_emission (priv, self);
+ }
+
+ thaw_signal_emission (priv, priv->freeze_emission);
+}
+
void
tracker_resources_sparql_update (TrackerResources *self,
const gchar *update,
@@ -461,7 +478,6 @@ tracker_resources_sparql_update (TrackerResources *self,
TrackerDBusMethodInfo *info;
guint request_id;
gchar *sender;
- TrackerResourcesPrivate *priv;
request_id = tracker_dbus_get_next_request_id ();
@@ -480,18 +496,7 @@ tracker_resources_sparql_update (TrackerResources *self,
sender = dbus_g_method_get_sender (context);
- priv = TRACKER_RESOURCES_GET_PRIVATE (self);
-
- /* If it was frozen (previous call was a batch_update, then immediately
- * restart the signal, as on_statements_committed will happen in a gidle
- * and that means that if a new batch_update happens, we'll be frozen
- * again before on_statements_committed can unfreeze us - I know, awkward */
-
- if (!priv->signal_configured && priv->freeze_emission) {
- configure_signal_emission (priv, self);
- }
-
- thaw_signal_emission (priv, priv->freeze_emission);
+ shared_thaw_signal (self);
tracker_store_sparql_update (update, TRACKER_STORE_PRIORITY_HIGH,
update_callback, sender,
@@ -528,7 +533,6 @@ tracker_resources_sparql_update_blank (TrackerResources *self,
TrackerDBusMethodInfo *info;
guint request_id;
gchar *sender;
- TrackerResourcesPrivate *priv;
request_id = tracker_dbus_get_next_request_id ();
@@ -547,20 +551,7 @@ tracker_resources_sparql_update_blank (TrackerResources *self,
sender = dbus_g_method_get_sender (context);
- priv = TRACKER_RESOURCES_GET_PRIVATE (self);
-
- priv = TRACKER_RESOURCES_GET_PRIVATE (self);
-
- /* If it was frozen (previous call was a batch_update, then immediately
- * restart the signal, as on_statements_committed will happen in a gidle
- * and that means that if a new batch_update happens, we'll be frozen
- * again before on_statements_committed can unfreeze us - I know, awkward */
-
- if (!priv->signal_configured && priv->freeze_emission) {
- configure_signal_emission (priv, self);
- }
-
- thaw_signal_emission (priv, priv->freeze_emission);
+ shared_thaw_signal (self);
tracker_store_sparql_update_blank (update, TRACKER_STORE_PRIORITY_HIGH,
update_blank_callback, sender,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]