summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ad7a504)
raw | patch | inline | side by side (parent: ad7a504)
author | Max Kellermann <max@duempel.org> | |
Sat, 3 Oct 2009 18:13:16 +0000 (20:13 +0200) | ||
committer | Max Kellermann <max@duempel.org> | |
Sat, 3 Oct 2009 18:13:16 +0000 (20:13 +0200) |
This function creates an empty list when the search query has failed.
It is now used on CMD_SCREEN_UPDATE.
It is now used on CMD_SCREEN_UPDATE.
src/screen_search.c | patch | blob | history |
diff --git a/src/screen_search.c b/src/screen_search.c
index 2dd911d09b3a8cc3c9cccb5518c62176889845a8..9742410d9b610277a2b0a6c97a64694f46b53a81 100644 (file)
--- a/src/screen_search.c
+++ b/src/screen_search.c
return fl;
}
+static void
+screen_search_reload(struct mpdclient *c)
+{
+ if (pattern == NULL)
+ return;
+
+ if (browser.filelist != NULL) {
+ filelist_free(browser.filelist);
+ browser.filelist = NULL;
+ }
+
+ browser.filelist = do_search(c, pattern);
+ if (browser.filelist == NULL)
+ browser.filelist = filelist_new();
+
+ screen_browser_sync_highlights(browser.filelist, &c->playlist);
+ list_window_check_selected(browser.lw,
+ filelist_length(browser.filelist));
+}
+
static void
search_new(struct mpdclient *c)
{
return;
}
- if (browser.filelist != NULL) {
- filelist_free(browser.filelist);
- browser.filelist = NULL;
- }
-
- browser.filelist = do_search(c, pattern);
- if (browser.filelist == NULL)
- browser.filelist = filelist_new();
-
- screen_browser_sync_highlights(browser.filelist, &c->playlist);
- list_window_check_selected(browser.lw, filelist_length(browser.filelist));
+ screen_search_reload(c);
}
static void
_(mode[options.search_mode].label));
/* continue and update... */
case CMD_SCREEN_UPDATE:
- if (pattern) {
- search_clear(false);
- browser.filelist = do_search(c, pattern);
- screen_browser_sync_highlights(browser.filelist,
- &c->playlist);
- }
+ screen_search_reload(c);
search_repaint();
return true;