Commit 95d9327f authored by Emmanuel Milou's avatar Emmanuel Milou
Browse files

Clean code

parent 1479ec6d
...@@ -83,7 +83,6 @@ sflphone_hold(call_t * c ) ...@@ -83,7 +83,6 @@ sflphone_hold(call_t * c )
c->state = CALL_STATE_HOLD; c->state = CALL_STATE_HOLD;
update_call_tree(c); update_call_tree(c);
update_menus(); update_menus();
//screen_clear();
} }
void void
...@@ -94,6 +93,14 @@ sflphone_ringing(call_t * c ) ...@@ -94,6 +93,14 @@ sflphone_ringing(call_t * c )
update_menus(); update_menus();
} }
void
sflphone_hung_up( call_t * c)
{
call_list_remove( c->callID);
update_call_tree_remove(c);
update_menus();
}
/** Internal to actions: Fill account list */ /** Internal to actions: Fill account list */
void void
sflphone_fill_account_list() sflphone_fill_account_list()
...@@ -169,7 +176,6 @@ sflphone_init() ...@@ -169,7 +176,6 @@ sflphone_init()
sflphone_hang_up() sflphone_hang_up()
{ {
call_t * selectedCall = call_get_selected(); call_t * selectedCall = call_get_selected();
//main_window_callinfo(FALSE, selectedCall);
if(selectedCall) if(selectedCall)
{ {
switch(selectedCall->state) switch(selectedCall->state)
...@@ -200,18 +206,14 @@ sflphone_hang_up() ...@@ -200,18 +206,14 @@ sflphone_hang_up()
sflphone_pick_up() sflphone_pick_up()
{ {
call_t * selectedCall = call_get_selected(); call_t * selectedCall = call_get_selected();
//printf("full name: %s\n",g_hash_table_lookup(selectedCall->properties, ACCOUNT_IAX_FULL_NAME));
//main_window_callinfo(TRUE, selectedCall);
if(selectedCall) if(selectedCall)
{ {
switch(selectedCall->state) switch(selectedCall->state)
{ {
case CALL_STATE_DIALING: case CALL_STATE_DIALING:
sflphone_place_call (selectedCall); sflphone_place_call (selectedCall);
//printf("accountID=%s\n",selectedCall->accountID);
break; break;
case CALL_STATE_INCOMING: case CALL_STATE_INCOMING:
//printf("CALL ID = %s\n", selectedCall->callID);
dbus_accept (selectedCall); dbus_accept (selectedCall);
break; break;
case CALL_STATE_HOLD: case CALL_STATE_HOLD:
...@@ -276,7 +278,6 @@ sflphone_fail( call_t * c ) ...@@ -276,7 +278,6 @@ sflphone_fail( call_t * c )
c->state = CALL_STATE_FAILURE; c->state = CALL_STATE_FAILURE;
update_call_tree(c); update_call_tree(c);
update_menus(); update_menus();
//main_window_callinfo(FALSE, c);
} }
void void
...@@ -285,7 +286,6 @@ sflphone_busy( call_t * c ) ...@@ -285,7 +286,6 @@ sflphone_busy( call_t * c )
c->state = CALL_STATE_BUSY; c->state = CALL_STATE_BUSY;
update_call_tree(c); update_call_tree(c);
update_menus(); update_menus();
//screen_set_call(c);
} }
void void
...@@ -294,7 +294,6 @@ sflphone_current( call_t * c ) ...@@ -294,7 +294,6 @@ sflphone_current( call_t * c )
c->state = CALL_STATE_CURRENT; c->state = CALL_STATE_CURRENT;
update_call_tree(c); update_call_tree(c);
update_menus(); update_menus();
//screen_set_call(c);
} }
void void
...@@ -305,7 +304,6 @@ sflphone_set_transfert() ...@@ -305,7 +304,6 @@ sflphone_set_transfert()
{ {
c->state = CALL_STATE_TRANSFERT; c->state = CALL_STATE_TRANSFERT;
c->to = g_strdup(""); c->to = g_strdup("");
//screen_set_call(c);
update_call_tree(c); update_call_tree(c);
update_menus(); update_menus();
} }
...@@ -320,7 +318,6 @@ sflphone_unset_transfert() ...@@ -320,7 +318,6 @@ sflphone_unset_transfert()
{ {
c->state = CALL_STATE_CURRENT; c->state = CALL_STATE_CURRENT;
c->to = g_strdup(""); c->to = g_strdup("");
//screen_set_call(c);
update_call_tree(c); update_call_tree(c);
update_menus(); update_menus();
} }
...@@ -335,15 +332,6 @@ sflphone_incoming_call (call_t * c) ...@@ -335,15 +332,6 @@ sflphone_incoming_call (call_t * c)
update_menus(); update_menus();
} }
void
sflphone_hung_up (call_t * c )
{
call_list_remove(c->callID);
update_call_tree_remove(c);
update_menus();
//main_window_callinfo(FALSE, c);
}
void process_dialing(call_t * c, guint keyval, gchar * key) void process_dialing(call_t * c, guint keyval, gchar * key)
{ {
switch (keyval) switch (keyval)
...@@ -353,7 +341,7 @@ void process_dialing(call_t * c, guint keyval, gchar * key) ...@@ -353,7 +341,7 @@ void process_dialing(call_t * c, guint keyval, gchar * key)
sflphone_place_call(c); sflphone_place_call(c);
break; break;
case 65307: /* ESCAPE */ case 65307: /* ESCAPE */
dbus_hang_up(c); sflphone_hang_up(c);
break; break;
case 65288: /* BACKSPACE */ case 65288: /* BACKSPACE */
{ /* Brackets mandatory because of local vars */ { /* Brackets mandatory because of local vars */
...@@ -368,7 +356,6 @@ void process_dialing(call_t * c, guint keyval, gchar * key) ...@@ -368,7 +356,6 @@ void process_dialing(call_t * c, guint keyval, gchar * key)
g_free(c->from); g_free(c->from);
c->from = g_strconcat("\"\" <", c->to, ">", NULL); c->from = g_strconcat("\"\" <", c->to, ">", NULL);
} }
//screen_set_call(c);
update_call_tree(c); update_call_tree(c);
} }
else if(strlen(c->to) == 0) else if(strlen(c->to) == 0)
...@@ -397,7 +384,6 @@ void process_dialing(call_t * c, guint keyval, gchar * key) ...@@ -397,7 +384,6 @@ void process_dialing(call_t * c, guint keyval, gchar * key)
g_free(c->from); g_free(c->from);
c->from = g_strconcat("\"\" <", c->to, ">", NULL); c->from = g_strconcat("\"\" <", c->to, ">", NULL);
} }
//screen_set_call(c);
update_call_tree(c); update_call_tree(c);
} }
break; break;
...@@ -418,7 +404,6 @@ call_t * sflphone_new_call() ...@@ -418,7 +404,6 @@ call_t * sflphone_new_call()
c->to = g_strdup(""); c->to = g_strdup("");
call_list_add(c); call_list_add(c);
//screen_set_call(c);
update_call_tree_add(c); update_call_tree_add(c);
update_menus(); update_menus();
...@@ -442,7 +427,7 @@ sflphone_keypad( guint keyval, gchar * key) ...@@ -442,7 +427,7 @@ sflphone_keypad( guint keyval, gchar * key)
switch (keyval) switch (keyval)
{ {
case 65307: /* ESCAPE */ case 65307: /* ESCAPE */
dbus_hang_up(c); sflphone_hang_up(c);
break; break;
default: // TODO should this be here? default: // TODO should this be here?
dbus_play_dtmf(key); dbus_play_dtmf(key);
...@@ -453,7 +438,6 @@ sflphone_keypad( guint keyval, gchar * key) ...@@ -453,7 +438,6 @@ sflphone_keypad( guint keyval, gchar * key)
c->from = g_strconcat("\"",call_get_name(c) ,"\" <", temp, ">", NULL); c->from = g_strconcat("\"",call_get_name(c) ,"\" <", temp, ">", NULL);
g_free(before); g_free(before);
g_free(temp); g_free(temp);
//screen_set_call(c);
//update_call_tree(c); //update_call_tree(c);
} }
break; break;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment