Commit 85164001 authored by Alexandre Savard's avatar Alexandre Savard

[#3218] Fix elapsing time display problems

parent 65c4b5a3
......@@ -189,7 +189,7 @@ sflphone_ringing(callable_obj_t * c )
void
sflphone_hung_up( callable_obj_t * c)
{
DEBUG("Actions: SFLphone hungup");
DEBUG("SFLphone: Hung up");
calllist_remove( current_calls, c->_callID);
calltree_remove_call(current_calls, c, NULL);
......@@ -200,6 +200,8 @@ sflphone_hung_up( callable_obj_t * c)
status_tray_icon_blink( FALSE );
#endif
free_callable_obj_t(c);
calltree_update_clock();
}
static hashtable_free(gpointer key, gpointer value, gpointer user_data)
......@@ -380,6 +382,8 @@ sflphone_hang_up()
callable_obj_t * selectedCall = calltab_get_selected_call(current_calls);
conference_obj_t * selectedConf = calltab_get_selected_conf(active_calltree);
DEBUG("SFLphone: Hang up");
if(selectedCall)
{
switch(selectedCall->_state)
......@@ -428,6 +432,8 @@ sflphone_hang_up()
}
calltree_update_call(history, selectedCall, NULL);
calltree_update_clock();
}
......
......@@ -155,8 +155,7 @@ void *threaded_clock_incrementer(void *pc) {
duration = (int) difftime(current, start);
if( duration / 60 == 0 )
{
if( duration / 60 == 0 ) {
if( duration < 10 ) {
g_snprintf(call->_timestr, 20, "00:0%d", duration);
}
......@@ -164,8 +163,7 @@ void *threaded_clock_incrementer(void *pc) {
g_snprintf(call->_timestr, 20, "00:%d", duration);
}
}
else
{
else {
if( duration%60 < 10 ) {
g_snprintf(call->_timestr, 20, "0%d:0%d", duration/60, duration%60);
}
......@@ -174,7 +172,16 @@ void *threaded_clock_incrementer(void *pc) {
}
}
calltree_update_clock();
DEBUG("CALL STATE %d", call->_state);
if( (call->_state != CALL_STATE_INVALID) &&
(call->_state != CALL_STATE_INCOMING) &&
(call->_state != CALL_STATE_RINGING) &&
(call->_state != CALL_STATE_DIALING) &&
(call->_state != CALL_STATE_FAILURE) &&
(call->_state != CALL_STATE_BUSY) ) {
calltree_update_clock();
}
gdk_threads_leave ();
......
......@@ -681,6 +681,8 @@ calltree_remove_call (calltab_t* tab, callable_obj_t * c, GtkTreeIter *parent)
calltab_select_call(tab, NULL);
update_actions();
calltree_update_clock();
DEBUG("Calltre remove call ended");
}
......@@ -1408,19 +1410,34 @@ void calltree_display (calltab_t *tab) {
void calltree_update_clock() {
if(!selected_call) {
statusbar_update_clock(NULL);
callable_obj_t *c = calltab_get_selected_call(current_calls);
// if(!selected_call) {
if(!c) {
statusbar_update_clock("");
return;
}
if(!(selected_call->_timestr)) {
statusbar_update_clock(NULL);
// if(!(selected_call->_timestr)) {
if(!(c->_timestr)) {
statusbar_update_clock("");
return;
}
// TODO this make the whole thing crash...
// calltree_update_call(current_calls, c, NULL);
statusbar_update_clock(selected_call->_timestr);
if( (c->_state != CALL_STATE_INVALID) &&
(c->_state != CALL_STATE_INCOMING) &&
(c->_state != CALL_STATE_RINGING) &&
(c->_state != CALL_STATE_DIALING) &&
(c->_state != CALL_STATE_FAILURE) &&
(c->_state != CALL_STATE_BUSY) ) {
// TODO this make the whole thing crash...
// calltree_update_call(current_calls, c, NULL);
statusbar_update_clock(c->_timestr);
}
else {
statusbar_update_clock("");
}
}
......
Markdown is supported
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