summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTillmann Karras <tilkax@gmail.com>2014-04-14 11:18:57 +0200
committerTillmann Karras <tilkax@gmail.com>2014-04-14 11:18:57 +0200
commite5c81182990c823cd1e481e3c8f0525f2899f9f1 (patch)
tree065458b9361a0037d0a194bb6967c51f3b811b1d /src
parentf7b395cafce96450e96a68b4860108a14fe7eab2 (diff)
Make search result lists searchable
no pun indented
Diffstat (limited to 'src')
-rw-r--r--src/uit_search.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/uit_search.c b/src/uit_search.c
index 780f3c5..fbb91e9 100644
--- a/src/uit_search.c
+++ b/src/uit_search.c
@@ -122,7 +122,13 @@ static void result(search_r_t *r, void *dat) {
}
-// Performs a seach and opens a new tab for the results.
+static const char *search_r_get_file(GSequenceIter *iter) {
+ search_r_t *r = g_sequence_get(iter);
+ return r->file;
+}
+
+
+// Performs a search and opens a new tab for the results.
// May return NULL on error, behaves similarly to search_add() w.r.t *err.
// Ownership of q is passed to the tab, and will be freed on error or close.
ui_tab_t *uit_search_create(hub_t *hub, search_q_t *q, GError **err) {
@@ -157,7 +163,7 @@ ui_tab_t *uit_search_create(hub_t *hub, search_q_t *q, GError **err) {
while(t->tab.name[strlen(t->tab.name)-1] == ' ')
t->tab.name[strlen(t->tab.name)-1] = 0;
- t->list = ui_listing_create(g_sequence_new(search_r_free), NULL, t, NULL);
+ t->list = ui_listing_create(g_sequence_new(search_r_free), NULL, t, search_r_get_file);
return (ui_tab_t *)t;
}