Fix signal emission when the operator changes

If the operator changes without going through a searching state the
Operator change signal was not properly emitted
This commit is contained in:
Denis Kenzior 2009-05-28 17:58:10 -05:00
parent d9d10f2292
commit b4d2d29d07
1 changed files with 6 additions and 2 deletions

View File

@ -953,14 +953,17 @@ static void current_operator_callback(const struct ofono_error *error,
network_operator_compare); network_operator_compare);
if (op) { if (op) {
netreg->current_operator = op->data;
set_network_operator_status(modem, op->data, set_network_operator_status(modem, op->data,
OPERATOR_STATUS_CURRENT); OPERATOR_STATUS_CURRENT);
set_network_operator_technology(modem, op->data, set_network_operator_technology(modem, op->data,
current->tech); current->tech);
set_network_operator_name(modem, op->data, current->name); set_network_operator_name(modem, op->data, current->name);
return; if (netreg->current_operator == op->data)
return;
netreg->current_operator = op->data;
goto emit;
} }
if (current) { if (current) {
@ -986,6 +989,7 @@ static void current_operator_callback(const struct ofono_error *error,
netreg->current_operator = NULL; netreg->current_operator = NULL;
} }
emit:
operator = get_operator_display_name(modem); operator = get_operator_display_name(modem);
dbus_gsm_signal_property_changed(conn, modem->path, dbus_gsm_signal_property_changed(conn, modem->path,
NETWORK_REGISTRATION_INTERFACE, NETWORK_REGISTRATION_INTERFACE,