forked from Mirrors/sngrep
Fix wrong displayed filtered calls in CallList
This commit is contained in:
parent
373617d1d5
commit
080a4a10d2
17
src/filter.c
17
src/filter.c
|
@ -63,19 +63,22 @@ filter_get(int type)
|
|||
return filters[type].expr;
|
||||
}
|
||||
|
||||
int
|
||||
filter_display_count()
|
||||
void
|
||||
filter_stats(int *total, int *displayed)
|
||||
{
|
||||
sip_call_t *call = NULL;
|
||||
int filtered_cnt = 0;
|
||||
|
||||
while ((call = call_get_next_filtered(call))) {
|
||||
filtered_cnt++;
|
||||
// Initialize stats
|
||||
*total = 0;
|
||||
*displayed = 0;
|
||||
|
||||
while ((call = call_get_next(call))) {
|
||||
(*total)++;
|
||||
if (filter_check_call(call) == 0)
|
||||
(*displayed)++;
|
||||
}
|
||||
return filtered_cnt;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
filter_check_call(sip_call_t *call)
|
||||
{
|
||||
|
|
|
@ -99,12 +99,13 @@ const char *
|
|||
filter_get(int type);
|
||||
|
||||
/**
|
||||
* @brief Number of calls that not have been filtered
|
||||
* @brief Get Filtered calls
|
||||
*
|
||||
* @return Number of calls without filtered flag
|
||||
* @param total Total calls processed
|
||||
* @param displayed number of calls matching filters
|
||||
*/
|
||||
int
|
||||
filter_display_count();
|
||||
void
|
||||
filter_stats(int *total, int *displayed);
|
||||
|
||||
/**
|
||||
* @brief Check if a call if filtered
|
||||
|
|
|
@ -226,9 +226,8 @@ call_list_draw(PANEL *panel)
|
|||
wattroff(win, A_BOLD | A_REVERSE | COLOR_PAIR(CP_DEF_ON_CYAN));
|
||||
}
|
||||
|
||||
// Store call counters
|
||||
callcnt = sip_calls_count();
|
||||
dispcallcnt = filter_display_count();
|
||||
// Get filter call counters
|
||||
filter_stats(&callcnt, &dispcallcnt);
|
||||
|
||||
// Print calls count (also filtered)
|
||||
mvwprintw(win, 1, 35, "%*s", 35, "");
|
||||
|
|
|
@ -144,15 +144,19 @@ save_destroy(PANEL *panel)
|
|||
int
|
||||
save_draw(PANEL *panel)
|
||||
{
|
||||
int total, displayed;
|
||||
|
||||
// Get panel information
|
||||
save_info_t *info = (save_info_t*) panel_userptr(panel);
|
||||
WINDOW *win = panel_window(panel);
|
||||
|
||||
// Get filter stats
|
||||
filter_stats(&total, &displayed);
|
||||
|
||||
mvwprintw(win, 5, 3, "( ) Save all dialogs");
|
||||
mvwprintw(win, 6, 3, "( ) Save selected dialogs (%d dialogs)",
|
||||
call_group_count(info->group));
|
||||
mvwprintw(win, 7, 3, "( ) Save displayed dialogs (%d dialogs)",
|
||||
filter_display_count());
|
||||
mvwprintw(win, 7, 3, "( ) Save displayed dialogs (%d dialogs)", displayed);
|
||||
|
||||
set_field_buffer(info->fields[FLD_SAVE_ALL], 0,
|
||||
(info->savemode == SAVE_ALL) ? "*" : "");
|
||||
|
|
Loading…
Reference in New Issue