From: Julien Desfossez Date: Tue, 22 May 2012 00:53:31 +0000 (-0400) Subject: sort perf key working X-Git-Tag: v0.3~127 X-Git-Url: https://git.lttng.org/?p=lttngtop.git;a=commitdiff_plain;h=bc958efad4530621ea32e98f265509140713384a sort perf key working Signed-off-by: Julien Desfossez --- diff --git a/src/cursesdisplay.c b/src/cursesdisplay.c index 2d79d65..beb7bdf 100644 --- a/src/cursesdisplay.c +++ b/src/cursesdisplay.c @@ -779,8 +779,8 @@ void update_perf() while (g_hash_table_iter_next (&iter, &key, (gpointer) &perfn1)) { if (perfn1->visible) { if (perfn1->sort) { + /* pref_current_sort = i; */ wattron(center, A_UNDERLINE); - /* FIXME : sort in the opposite direction */ } /* + 5 to strip the "perf_" prefix */ mvwprintw(center, 1, perf_row, "%s", @@ -1443,19 +1443,24 @@ void *handle_keyboard(void *p) update_preference_panel(&pref_line_selected, 0, 1); break; case '>': - if (!pref_panel_visible) { + /* perf uses a hashtable, it is ordered backward */ + if (current_view == perf) { + pref_current_sort--; + } else if (!pref_panel_visible) { pref_current_sort++; - update_sort(&pref_current_sort); - update_current_view(); } + update_sort(&pref_current_sort); + update_current_view(); break; case '<': - if (!pref_panel_visible) { - if (pref_current_sort > 0) - pref_current_sort--; - update_sort(&pref_current_sort); - update_current_view(); + /* perf uses a hashtable, it is ordered backward */ + if (current_view == perf) { + pref_current_sort++; + } else if (!pref_panel_visible) { + pref_current_sort--; } + update_sort(&pref_current_sort); + update_current_view(); break; case 13: /* FIXME : KEY_ENTER ?? */