Skip to content
Snippets Groups Projects
Commit 9a58dec6 authored by Alexandre Savard's avatar Alexandre Savard
Browse files

#6233: Fix history

parent 768fcc07
No related branches found
No related tags found
No related merge requests found
......@@ -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);
......
......@@ -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,9 +1414,12 @@ void calltree_remove_conference (calltab_t* tab, const conference_obj_t* conf, G
g_value_unset (&callval);
if (call) {
// do not add back call in history calltree when cleaning it
if(tab != history) {
calltree_add_call (tab, call, NULL);
}
}
}
}
......
......@@ -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)
{
......
......@@ -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 *);
......
......@@ -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();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment