diff options
author | Denis Kenzior <denkenz@gmail.com> | 2009-08-07 17:30:28 -0500 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2009-08-07 17:30:28 -0500 |
commit | d7a5e7d017497366e4593ab6cac1d6f618b8548a (patch) | |
tree | dae4060fcfc6a7964804d8e10a1da12023c21c98 /src/call-forwarding.c | |
parent | 6b9d8567b4851648e9cc82243caaed7ef57fcfdf (diff) | |
download | ofono-d7a5e7d017497366e4593ab6cac1d6f618b8548a.tar.bz2 |
No need to use g_timeout_add here
Diffstat (limited to 'src/call-forwarding.c')
-rw-r--r-- | src/call-forwarding.c | 41 |
1 files changed, 18 insertions, 23 deletions
diff --git a/src/call-forwarding.c b/src/call-forwarding.c index d001bcab..b142d895 100644 --- a/src/call-forwarding.c +++ b/src/call-forwarding.c @@ -53,9 +53,9 @@ struct call_forwarding_data { struct cf_ss_request *ss_req; }; -static gboolean get_query_next_cf_cond(gpointer user); -static gboolean set_query_next_cf_cond(gpointer user); -static gboolean ss_set_query_next_cf_cond(gpointer user); +static void get_query_next_cf_cond(struct ofono_modem *modem); +static void set_query_next_cf_cond(struct ofono_modem *modem); +static void ss_set_query_next_cf_cond(struct ofono_modem *modem); static void cf_unregister_ss_controls(struct ofono_modem *modem); struct cf_ss_request { @@ -423,18 +423,15 @@ static void get_query_cf_callback(const struct ofono_error *error, int total, } cf->query_next++; - g_timeout_add(0, get_query_next_cf_cond, modem); + get_query_next_cf_cond(modem); } -static gboolean get_query_next_cf_cond(gpointer user) +static void get_query_next_cf_cond(struct ofono_modem *modem) { - struct ofono_modem *modem = user; struct call_forwarding_data *cf = modem->call_forwarding; cf->ops->query(modem, cf->query_next, BEARER_CLASS_DEFAULT, get_query_cf_callback, modem); - - return FALSE; } static DBusMessage *cf_get_properties(DBusConnection *conn, DBusMessage *msg, @@ -534,27 +531,26 @@ static void set_query_cf_callback(const struct ofono_error *error, int total, if (cf->query_next == cf->query_end) { reply = dbus_message_new_method_return(cf->pending); __ofono_dbus_pending_reply(&cf->pending, reply); - } else { - cf->query_next++; - g_timeout_add(0, set_query_next_cf_cond, modem); - } + } l = cf_cond_list_create(total, list); set_new_cond_list(modem, cf->query_next, l); ofono_debug("%s conditions:", cf_type_lut[cf->query_next]); cf_cond_list_print(l); + + if (cf->query_next != cf->query_end) { + cf->query_next++; + set_query_next_cf_cond(modem); + } } -static gboolean set_query_next_cf_cond(gpointer user) +static void set_query_next_cf_cond(struct ofono_modem *modem) { - struct ofono_modem *modem = user; struct call_forwarding_data *cf = modem->call_forwarding; cf->ops->query(modem, cf->query_next, BEARER_CLASS_DEFAULT, set_query_cf_callback, modem); - - return FALSE; } static void set_property_callback(const struct ofono_error *error, void *data) @@ -877,23 +873,22 @@ static void ss_set_query_cf_callback(const struct ofono_error *error, int total, __ofono_dbus_pending_reply(&cf->pending, reply); g_free(cf->ss_req); cf->ss_req = NULL; - } else { - cf->query_next++; - g_timeout_add(0, ss_set_query_next_cf_cond, modem); } set_new_cond_list(modem, cf->query_next, l); + + if (cf->query_next != cf->query_end) { + cf->query_next++; + ss_set_query_next_cf_cond(modem); + } } -static gboolean ss_set_query_next_cf_cond(gpointer user) +static void ss_set_query_next_cf_cond(struct ofono_modem *modem) { - struct ofono_modem *modem = user; struct call_forwarding_data *cf = modem->call_forwarding; cf->ops->query(modem, cf->query_next, BEARER_CLASS_DEFAULT, ss_set_query_cf_callback, modem); - - return FALSE; } static void cf_ss_control_callback(const struct ofono_error *error, void *data) |