emulator: Use a switch/case instead of if

Seems a bit cleaner
This commit is contained in:
Denis Kenzior 2011-04-19 13:31:37 -05:00
parent 894c9cf406
commit cae4553710
1 changed files with 10 additions and 5 deletions

View File

@ -910,15 +910,20 @@ void ofono_emulator_set_indicator(struct ofono_emulator *em,
if (!callsetup)
return;
if (value == OFONO_EMULATOR_CALLSETUP_INCOMING) {
switch (value) {
case OFONO_EMULATOR_CALLSETUP_INCOMING:
if (call_ind->value == OFONO_EMULATOR_CALL_INACTIVE)
send_callsetup_notification(em);
em->callsetup_source = g_timeout_add_seconds(RING_TIMEOUT,
send_callsetup_notification, em);
} else if (value != OFONO_EMULATOR_CALLSETUP_INCOMING &&
em->callsetup_source) {
g_source_remove(em->callsetup_source);
em->callsetup_source = 0;
break;
default:
if (em->callsetup_source > 0) {
g_source_remove(em->callsetup_source);
em->callsetup_source = 0;
}
break;
}
}