From 7c0125e0d749f61688a140b2dbb76cc37ad57beb Mon Sep 17 00:00:00 2001 From: compudj Date: Thu, 19 Aug 2004 05:27:32 +0000 Subject: [PATCH] sort function desactivated during chunks git-svn-id: http://ltt.polymtl.ca/svn@816 04897980-b3bd-0310-b5e0-8ef037075253 --- .../lttv/modules/gui/controlflow/eventhooks.c | 20 +++++++++++++++++-- .../modules/gui/controlflow/processlist.c | 17 +--------------- .../modules/gui/controlflow/processlist.h | 20 ++++++++++++++++++- 3 files changed, 38 insertions(+), 19 deletions(-) diff --git a/ltt/branches/poly/lttv/modules/gui/controlflow/eventhooks.c b/ltt/branches/poly/lttv/modules/gui/controlflow/eventhooks.c index e27ddf27..abb2fd26 100644 --- a/ltt/branches/poly/lttv/modules/gui/controlflow/eventhooks.c +++ b/ltt/branches/poly/lttv/modules/gui/controlflow/eventhooks.c @@ -3167,7 +3167,14 @@ int before_chunk(void *hook_data, void *call_data) { EventsRequest *events_request = (EventsRequest*)hook_data; LttvTracesetState *tss = (LttvTracesetState*)call_data; - + ControlFlowData *cfd = (ControlFlowData*)events_request->viewer_data; + + /* Desactivate sort */ + gtk_tree_sortable_set_sort_column_id( + GTK_TREE_SORTABLE(cfd->process_list->list_store), + TRACE_COLUMN, + GTK_SORT_ASCENDING); + drawing_chunk_begin(events_request, tss); return 0; @@ -3177,7 +3184,7 @@ int before_request(void *hook_data, void *call_data) { EventsRequest *events_request = (EventsRequest*)hook_data; LttvTracesetState *tss = (LttvTracesetState*)call_data; - + drawing_data_request_begin(events_request, tss); return 0; @@ -3220,6 +3227,7 @@ int after_request(void *hook_data, void *call_data) /* Draw last items */ g_hash_table_foreach(process_list->process_hash, draw_closure, (void*)&closure_data); + /* Request expose */ drawing_request_expose(events_request, tss, end_time); @@ -3268,6 +3276,14 @@ int after_chunk(void *hook_data, void *call_data) g_hash_table_foreach(process_list->process_hash, draw_closure, (void*)&closure_data); + /* Reactivate sort */ + gtk_tree_sortable_set_sort_column_id( + GTK_TREE_SORTABLE(control_flow_data->process_list->list_store), + GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID, + GTK_SORT_ASCENDING); + + update_index_to_pixmap(control_flow_data->process_list); + /* Request expose */ drawing_request_expose(events_request, tss, end_time); diff --git a/ltt/branches/poly/lttv/modules/gui/controlflow/processlist.c b/ltt/branches/poly/lttv/modules/gui/controlflow/processlist.c index e04f208b..67d565a8 100644 --- a/ltt/branches/poly/lttv/modules/gui/controlflow/processlist.c +++ b/ltt/branches/poly/lttv/modules/gui/controlflow/processlist.c @@ -36,21 +36,6 @@ * Methods to synchronize process list * *****************************************************************************/ -//static inline guint get_cpu_number_from_name(GQuark name); - -/* Enumeration of the columns */ -enum -{ - PROCESS_COLUMN, - PID_COLUMN, - PPID_COLUMN, - CPU_COLUMN, - BIRTH_S_COLUMN, - BIRTH_NS_COLUMN, - TRACE_COLUMN, - N_COLUMNS -}; - gint process_sort_func ( GtkTreeModel *model, GtkTreeIter *it_a, @@ -166,7 +151,7 @@ static void update_index_to_pixmap_each(ProcessInfo *key, } -static void update_index_to_pixmap(ProcessList *process_list) +void update_index_to_pixmap(ProcessList *process_list) { g_ptr_array_set_size(process_list->index_to_pixmap, g_hash_table_size(process_list->process_hash)); diff --git a/ltt/branches/poly/lttv/modules/gui/controlflow/processlist.h b/ltt/branches/poly/lttv/modules/gui/controlflow/processlist.h index b8ad8453..687ac407 100644 --- a/ltt/branches/poly/lttv/modules/gui/controlflow/processlist.h +++ b/ltt/branches/poly/lttv/modules/gui/controlflow/processlist.h @@ -38,9 +38,23 @@ * provides helper function to convert a process unique identifier to * pixels (in height). * - * //FIXME : connect the scrolled window adjustment with the list. */ + +/* Enumeration of the columns */ +enum +{ + PROCESS_COLUMN, + PID_COLUMN, + PPID_COLUMN, + CPU_COLUMN, + BIRTH_S_COLUMN, + BIRTH_NS_COLUMN, + TRACE_COLUMN, + N_COLUMNS +}; + + typedef struct _ProcessInfo { guint pid; @@ -126,6 +140,10 @@ int processlist_add(ProcessList *process_list, Drawing_t * drawing, int processlist_remove(ProcessList *process_list, guint pid, guint cpu, LttTime *birth, guint trace_num); + +/* Synchronize the list at the left and the drawing */ +void update_index_to_pixmap(ProcessList *process_list); + /* Update the width of each pixmap buffer for each process */ void update_pixmap_size(ProcessList *process_list, guint width); -- 2.34.1