aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Rostedt <srostedt@redhat.com>2011-02-15 14:51:59 -0500
committerSteven Rostedt <rostedt@goodmis.org>2011-02-21 20:42:05 -0500
commit4857f97c671da6cb36be4e850e50501a01bb733d (patch)
tree006c5f1474424aed3ab6f9cc375f53b06eb11594
parentd4b6a3efdf7604d2edcb8470543b39cdedce60f4 (diff)
kernelshark/trace-view: Fix searching list on later pages
Currently the search function only works on the first page of the list. The list is broken up into pages of 1,000,000 items. But if you are on the second or later page (>1,000,000 item) the search will not work. This patch fixes the search feature to work on other pages. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
-rw-r--r--trace-view-store.c9
-rw-r--r--trace-view.c1
2 files changed, 5 insertions, 5 deletions
diff --git a/trace-view-store.c b/trace-view-store.c
index 34f8155..3b62680 100644
--- a/trace-view-store.c
+++ b/trace-view-store.c
@@ -387,18 +387,18 @@ trace_view_store_get_path (GtkTreeModel *tree_model,
387{ 387{
388 GtkTreePath *path; 388 GtkTreePath *path;
389 TraceViewRecord *record; 389 TraceViewRecord *record;
390 TraceViewStore *trace_view_store; 390 TraceViewStore *store;
391 391
392 g_return_val_if_fail (TRACE_VIEW_IS_LIST(tree_model), NULL); 392 g_return_val_if_fail (TRACE_VIEW_IS_LIST(tree_model), NULL);
393 g_return_val_if_fail (iter != NULL, NULL); 393 g_return_val_if_fail (iter != NULL, NULL);
394 g_return_val_if_fail (iter->user_data != NULL, NULL); 394 g_return_val_if_fail (iter->user_data != NULL, NULL);
395 395
396 trace_view_store = TRACE_VIEW_STORE(tree_model); 396 store = TRACE_VIEW_STORE(tree_model);
397 397
398 record = (TraceViewRecord*) iter->user_data; 398 record = (TraceViewRecord*) iter->user_data;
399 399
400 path = gtk_tree_path_new(); 400 path = gtk_tree_path_new();
401 gtk_tree_path_append_index(path, record->pos); 401 gtk_tree_path_append_index(path, record->pos - store->start_row);
402 402
403 return path; 403 return path;
404} 404}
@@ -1106,8 +1106,9 @@ gint trace_view_store_get_timestamp_page(TraceViewStore *store, guint64 ts)
1106static TraceViewRecord *get_row(TraceViewStore *store, gint row) 1106static TraceViewRecord *get_row(TraceViewStore *store, gint row)
1107{ 1107{
1108 TraceViewRecord *record; 1108 TraceViewRecord *record;
1109 gint index = row - store->start_row;
1109 1110
1110 g_return_val_if_fail(row >= store->start_row && row < store->visible_rows, NULL); 1111 g_return_val_if_fail(index >= 0 && index < store->visible_rows, NULL);
1111 1112
1112 record = store->rows[row]; 1113 record = store->rows[row];
1113 g_assert(record != NULL); 1114 g_assert(record != NULL);
diff --git a/trace-view.c b/trace-view.c
index 8d121d1..37b7992 100644
--- a/trace-view.c
+++ b/trace-view.c
@@ -772,7 +772,6 @@ static void search_tree(gpointer data)
772 break; 772 break;
773 } 773 }
774 774
775
776 if (!found) { 775 if (!found) {
777 printf("NOT FOUND!\n"); 776 printf("NOT FOUND!\n");
778 /* show pop up */ 777 /* show pop up */