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

#6298: Cleanup

parent 2dd9310c
Branches
Tags
No related merge requests found
...@@ -1344,7 +1344,7 @@ void sflphone_fill_conference_list (void) ...@@ -1344,7 +1344,7 @@ void sflphone_fill_conference_list (void)
gchar* conf_id; gchar* conf_id;
conference_obj_t* conf; conference_obj_t* conf;
DEBUG ("sflphone_fill_conference_list"); DEBUG ("SFLphone: Fill conference list");
conferences = dbus_get_conference_list(); conferences = dbus_get_conference_list();
...@@ -1353,8 +1353,6 @@ void sflphone_fill_conference_list (void) ...@@ -1353,8 +1353,6 @@ void sflphone_fill_conference_list (void)
conf = g_new0 (conference_obj_t, 1); conf = g_new0 (conference_obj_t, 1);
conf_id = (gchar*) (*conferences); conf_id = (gchar*) (*conferences);
DEBUG (" fetching conference: %s", conf_id);
conference_details = (GHashTable*) dbus_get_conference_details (conf_id); conference_details = (GHashTable*) dbus_get_conference_details (conf_id);
create_new_conference_from_details (conf_id, conference_details, &conf); create_new_conference_from_details (conf_id, conference_details, &conf);
...@@ -1376,16 +1374,12 @@ void sflphone_fill_history (void) ...@@ -1376,16 +1374,12 @@ void sflphone_fill_history (void)
QueueElement *element; QueueElement *element;
guint i = 0, n = 0; guint i = 0, n = 0;
DEBUG ("======================================================= SFLphone: Loading history");
entries = dbus_get_history (); entries = dbus_get_history ();
while (*entries) { while (*entries) {
current_entry = (gchar *)*entries; current_entry = (gchar *)*entries;
DEBUG("entry: %s", current_entry);
// Parsed a conference // Parsed a conference
if(g_str_has_prefix(current_entry, "9999")) { if(g_str_has_prefix(current_entry, "9999")) {
// create a conference entry // create a conference entry
...@@ -1401,7 +1395,6 @@ void sflphone_fill_history (void) ...@@ -1401,7 +1395,6 @@ void sflphone_fill_history (void)
// if this conference is already created since one of the participant have already // if this conference is already created since one of the participant have already
// been unserialized, update the recordfile value // been unserialized, update the recordfile value
conf->_recordfile = g_strdup(history_conf->_recordfile); conf->_recordfile = g_strdup(history_conf->_recordfile);
DEBUG("----------------- add record file: %s", conf->_recordfile);
} }
} }
else { else {
...@@ -1414,8 +1407,6 @@ void sflphone_fill_history (void) ...@@ -1414,8 +1407,6 @@ void sflphone_fill_history (void)
if(history_call->_confID && g_strcmp0(history_call->_confID, "") != 0) { if(history_call->_confID && g_strcmp0(history_call->_confID, "") != 0) {
DEBUG("----------------- conf id: %s", history_call->_confID);
// process conference // process conference
conf = conferencelist_get(history, history_call->_confID); conf = conferencelist_get(history, history_call->_confID);
if(conf == NULL) { if(conf == NULL) {
...@@ -1424,6 +1415,7 @@ void sflphone_fill_history (void) ...@@ -1424,6 +1415,7 @@ void sflphone_fill_history (void)
conferencelist_add(history, conf); conferencelist_add(history, conf);
} }
// add this participant to the conference
conference_add_participant(history_call->_callID, conf); conference_add_participant(history_call->_callID, conf);
// conference start timestamp corespond to // conference start timestamp corespond to
...@@ -1436,31 +1428,26 @@ void sflphone_fill_history (void) ...@@ -1436,31 +1428,26 @@ void sflphone_fill_history (void)
entries++; entries++;
} }
entries = history_entries; // fill the treeview wtih calls
// fill
n = calllist_get_size(history); n = calllist_get_size(history);
DEBUG("CALL SIZE: %d", n);
for(i = 0; i < n; i++) { for(i = 0; i < n; i++) {
element = calllist_get_nth(history, i); element = calllist_get_nth(history, i);
if(element->type == HIST_CALL) { if(element->type == HIST_CALL) {
call = element->elem.call; call = element->elem.call;
DEBUG("%d ADDING: %s", i, call->_callID);
calltree_add_call (history, call, NULL); calltree_add_call (history, call, NULL);
} }
} }
// fill the treeview with conferences
n = conferencelist_get_size(history); n = conferencelist_get_size(history);
DEBUG("CONFERENCE SIZE: %d", n);
for(i = 0; i < n; i++) { for(i = 0; i < n; i++) {
conference_obj_t *conf = conferencelist_get_nth(history, i); conference_obj_t *conf = conferencelist_get_nth(history, i);
if(conf == NULL) { if(conf == NULL) {
DEBUG("??????????????????????"); DEBUG("SFLphone: Error: Could not find conference");
} }
calltree_add_conference(history, conf); calltree_add_conference(history, conf);
} }
DEBUG ("======================================================== SFLphone: Loading history ...(end)");
} }
void sflphone_save_history (void) void sflphone_save_history (void)
...@@ -1473,8 +1460,6 @@ void sflphone_save_history (void) ...@@ -1473,8 +1460,6 @@ void sflphone_save_history (void)
gchar **ordered_result; gchar **ordered_result;
gchar *key, *value; gchar *key, *value;
DEBUG ("==================================================== SFLphone: Saving history");
result = g_hash_table_new (NULL, g_str_equal); result = g_hash_table_new (NULL, g_str_equal);
g_hash_table_ref (result); g_hash_table_ref (result);
...@@ -1486,12 +1471,10 @@ void sflphone_save_history (void) ...@@ -1486,12 +1471,10 @@ void sflphone_save_history (void)
if(current->type == HIST_CALL) { if(current->type == HIST_CALL) {
value = serialize_history_call_entry (current->elem.call); value = serialize_history_call_entry (current->elem.call);
key = convert_timestamp_to_gchar (current->elem.call->_time_start); key = convert_timestamp_to_gchar (current->elem.call->_time_start);
DEBUG("--------------------------------- SFLphone: Serialize call [%s]: %s", key, value);
} }
else if(current->type == HIST_CONFERENCE) { else if(current->type == HIST_CONFERENCE) {
value = serialize_history_conference_entry(current->elem.conf); value = serialize_history_conference_entry(current->elem.conf);
key = convert_timestamp_to_gchar (current->elem.conf->_time_start); key = convert_timestamp_to_gchar (current->elem.conf->_time_start);
DEBUG("--------------------------------- SFLphone: Serialize conference [%s]: %s", key, value);
} }
else { else {
ERROR("SFLphone: Error: Unknown type for serialization"); ERROR("SFLphone: Error: Unknown type for serialization");
......
...@@ -126,16 +126,6 @@ int HistoryManager::load_history_items_map (Conf::ConfigTree *history_list, int ...@@ -126,16 +126,6 @@ int HistoryManager::load_history_items_map (Conf::ConfigTree *history_list, int
confID = getConfigString(*iter, "confid", history_list); confID = getConfigString(*iter, "confid", history_list);
time_added = getConfigString(*iter, "timeadded", history_list); time_added = getConfigString(*iter, "timeadded", history_list);
_error("Unserialized time start: %s", timestamp_start.c_str());
_error("Unserialized time stop: %s", timestamp_stop.c_str());
_error("Unserialized number: %s", number.c_str());
_error("Unserialized callid: %s", callID.c_str());
_error("Unserialized account: %s", accountID.c_str());
_error("Unserialized name: %s", name.c_str());
_error("Unserialized record file: %s", recording_file.c_str());
_error("Unserialized confid: %s", confID.c_str());
_error("Unserialized timeadded: %s", time_added.c_str());
// Make a check on the start timestamp to know it is loadable according to CONFIG_HISTORY_LIMIT // Make a check on the start timestamp to know it is loadable according to CONFIG_HISTORY_LIMIT
if (atoi (timestamp_start.c_str ()) >= ( (int) current_timestamp - history_limit)) { if (atoi (timestamp_start.c_str ()) >= ( (int) current_timestamp - history_limit)) {
...@@ -261,14 +251,11 @@ std::vector<std::string> HistoryManager::get_history_serialized (void) ...@@ -261,14 +251,11 @@ std::vector<std::string> HistoryManager::get_history_serialized (void)
iter = _history_items.begin (); iter = _history_items.begin ();
_error("HistoryManager: History items size: %d", _history_items.size());
while (iter != _history_items.end()) { while (iter != _history_items.end()) {
current = *iter; current = *iter;
if (current) { if (current) {
res = current->serialize (); res = current->serialize ();
_error("%s", res.c_str());
serialized.push_back(res); serialized.push_back(res);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment