diff --git a/sflphone-client-gnome/src/contacts/calllist.c b/sflphone-client-gnome/src/contacts/calllist.c index ab95bd03c64fc1209e14f66ed860d587538d4b7b..986ff5a65167b37c3e73059836b05303d2e6bc36 100644 --- a/sflphone-client-gnome/src/contacts/calllist.c +++ b/sflphone-client-gnome/src/contacts/calllist.c @@ -154,13 +154,13 @@ calllist_add_call (calltab_t* tab, callable_obj_t * c) g_queue_push_tail (tab->callQueue, (gpointer *) element); } -// TODO : sflphoneGTK : try to do this more generic void calllist_clean_history (void) { - unsigned int i; + guint i; guint size = calllist_get_size (history); - DEBUG ("CallList: History list size = %i", calllist_get_size (history)); + + DEBUG ("CallList: History list size %d", size); for (i = 0 ; i < size; i++) { QueueElement* c = calllist_get_nth (history , i); diff --git a/sflphone-client-gnome/src/contacts/calltree.c b/sflphone-client-gnome/src/contacts/calltree.c index c7f7a9ad1e317a07ea557e19f0762e31f729a0c2..bc38ed0f30540af0217613d26c7f642c36ce5da3 100644 --- a/sflphone-client-gnome/src/contacts/calltree.c +++ b/sflphone-client-gnome/src/contacts/calltree.c @@ -1360,7 +1360,7 @@ void calltree_add_conference (calltab_t* tab, conference_obj_t* conf) void calltree_update_conference (calltab_t* tab, const conference_obj_t* conf) { - DEBUG ("CallTree: Update conference %s\n", conf->_confID); + DEBUG ("CallTree: Update conference %s", conf->_confID); calltree_remove_conference(tab, conf, NULL); calltree_add_conference (tab, (conference_obj_t *)conf); @@ -1379,7 +1379,7 @@ void calltree_remove_conference (calltab_t* tab, const conference_obj_t* conf, G int nbParticipant; int i, j; - DEBUG ("CallTree: Remove conference %s\n", conf->_confID); + DEBUG ("CallTree: Remove conference %s", conf->_confID); int nbChild = gtk_tree_model_iter_n_children (GTK_TREE_MODEL (store), parent); @@ -1414,8 +1414,11 @@ void calltree_remove_conference (calltab_t* tab, const conference_obj_t* conf, G g_value_unset (&callval); if (call) { - calltree_add_call (tab, call, NULL); - } + // do not add back call in history calltree when cleaning it + if(tab != history) { + calltree_add_call (tab, call, NULL); + } + } } } diff --git a/sflphone-client-gnome/src/contacts/conferencelist.c b/sflphone-client-gnome/src/contacts/conferencelist.c index 399cee58aa16f39d5bd14834616b58d41447a054..fd703119940b9dcd26854b1d4b97fd6311844949 100644 --- a/sflphone-client-gnome/src/contacts/conferencelist.c +++ b/sflphone-client-gnome/src/contacts/conferencelist.c @@ -28,8 +28,8 @@ * as that of the covered work. */ -#include <conferencelist.h> - +#include "calltree.h" +#include "conferencelist.h" #include "logger.h" static gint is_confID_confstruct(gconstpointer, gconstpointer); @@ -78,6 +78,30 @@ void conferencelist_clean(calltab_t *tab) g_queue_free (tab->conferenceQueue); } +void +conferencelist_clean_history(void) +{ + conference_obj_t *conf; + guint size = conferencelist_get_size(history); + guint i; + + DEBUG("ConferenceList: clean history"); + + while(size > 0) { + conf = conferencelist_pop_head(history); + if(conf) { + calltree_remove_conference(history, conf, NULL); + } + else { + ERROR("ConferenceList: Conference pointer is NULL"); + } + size = conferencelist_get_size(history); + } + + // g_queue_free(history->conferenceQueue); + +} + void conferencelist_reset(calltab_t *tab) { diff --git a/sflphone-client-gnome/src/contacts/conferencelist.h b/sflphone-client-gnome/src/contacts/conferencelist.h index f09060b85049cefb093e8b85798d08c9ce0e459c..1fb288e45f69b8d0f14b87d1bfaf43ce02698937 100644 --- a/sflphone-client-gnome/src/contacts/conferencelist.h +++ b/sflphone-client-gnome/src/contacts/conferencelist.h @@ -50,6 +50,10 @@ conferencelist_init (calltab_t *); void conferencelist_clean (calltab_t *); +/** This function empty and free the history conference list */ +void +conferencelist_clean_history (void); + /** This function empty, free the conference list and allocate a new one. */ void conferencelist_reset (calltab_t *); diff --git a/sflphone-client-gnome/src/uimanager.c b/sflphone-client-gnome/src/uimanager.c index 6d0817b9b170f7df5dd1ec21b7ee98ddeda0ad90..832e72726e60a876019b8e3911485b948c15a2e8 100644 --- a/sflphone-client-gnome/src/uimanager.c +++ b/sflphone-client-gnome/src/uimanager.c @@ -875,6 +875,10 @@ edit_paste (void * foo UNUSED) static void clear_history (void) { + if(conferencelist_get_size(history) != 0) { + conferencelist_clean_history(); + } + if (calllist_get_size (history) != 0) { calllist_clean_history(); }