aboutsummaryrefslogtreecommitdiff
path: root/src/mm-iface-modem.c
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@lanedo.com>2012-01-03 21:43:20 +0100
committerAleksander Morgado <aleksander@lanedo.com>2012-03-15 14:14:44 +0100
commitcb2612d0cee5d676564a14749a28021cf412354d (patch)
tree355c1f049179ffa70df3e01154bd7c4a154762fa /src/mm-iface-modem.c
parent5edb863eded7bef4e3a83b2900b3b3fdc262319f (diff)
iface-modem: fix signal quality context creation
Diffstat (limited to 'src/mm-iface-modem.c')
-rw-r--r--src/mm-iface-modem.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/mm-iface-modem.c b/src/mm-iface-modem.c
index bb74cde2..69712db2 100644
--- a/src/mm-iface-modem.c
+++ b/src/mm-iface-modem.c
@@ -474,10 +474,12 @@ update_signal_quality (MMIfaceModem *self,
MmGdbusModem *skeleton = NULL;
const gchar *dbus_path;
- if (G_UNLIKELY (!signal_quality_update_context_quark)) {
+ if (G_UNLIKELY (!signal_quality_update_context_quark))
signal_quality_update_context_quark = (g_quark_from_static_string (
SIGNAL_QUALITY_UPDATE_CONTEXT_TAG));
+ ctx = g_object_get_qdata (G_OBJECT (self), signal_quality_update_context_quark);
+ if (!ctx) {
/* Create context and keep it as object data */
ctx = g_new0 (SignalQualityUpdateContext, 1);
g_object_set_qdata_full (
@@ -485,8 +487,7 @@ update_signal_quality (MMIfaceModem *self,
signal_quality_update_context_quark,
ctx,
(GDestroyNotify)signal_quality_update_context_free);
- } else
- ctx = g_object_get_qdata (G_OBJECT (self), signal_quality_update_context_quark);
+ }
/* Keep current timestamp */
ctx->last_update = time (NULL);