From: Max Kellermann Date: Sun, 13 Sep 2009 09:05:45 +0000 (+0200) Subject: screen_browser: export browser_get_selected_entry() X-Git-Tag: release-0.15~16 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=8a5b8900e968f04e2a6df67f182f44896c9ac7c1;p=ncmpc.git screen_browser: export browser_get_selected_entry() Rename browser_get_selected() to browser_get_selected_entry() first. --- diff --git a/src/screen_browser.c b/src/screen_browser.c index 6dbb2f8..7af1f25 100644 --- a/src/screen_browser.c +++ b/src/screen_browser.c @@ -267,8 +267,8 @@ enqueue_and_play(mpdclient_t *c, filelist_entry_t *entry) return true; } -static struct filelist_entry * -browser_get_selected(const struct screen_browser *browser) +struct filelist_entry * +browser_get_selected_entry(const struct screen_browser *browser) { if (browser->filelist == NULL || browser->lw->selected_start < browser->lw->selected_end || @@ -281,7 +281,7 @@ browser_get_selected(const struct screen_browser *browser) static struct mpd_InfoEntity * browser_get_selected_entity(const struct screen_browser *browser) { - struct filelist_entry *entry = browser_get_selected(browser); + struct filelist_entry *entry = browser_get_selected_entry(browser); return entry != NULL ? entry->entity @@ -311,7 +311,7 @@ browser_get_index(const struct screen_browser *browser, unsigned i) static bool browser_handle_enter(struct screen_browser *browser, mpdclient_t *c) { - struct filelist_entry *entry = browser_get_selected(browser); + struct filelist_entry *entry = browser_get_selected_entry(browser); mpd_InfoEntity *entity; if (entry == NULL) @@ -402,7 +402,7 @@ browser_handle_select(struct screen_browser *browser, mpdclient_t *c) } return false; } else { - entry = browser_get_selected(browser); + entry = browser_get_selected_entry(browser); if (entry == NULL || entry->entity == NULL) return false; @@ -426,7 +426,7 @@ browser_handle_add(struct screen_browser *browser, mpdclient_t *c) } return false; } else { - entry = browser_get_selected(browser); + entry = browser_get_selected_entry(browser); if (entry == NULL || entry->entity == NULL) return false; diff --git a/src/screen_browser.h b/src/screen_browser.h index 3954c8d..7f61954 100644 --- a/src/screen_browser.h +++ b/src/screen_browser.h @@ -48,6 +48,9 @@ browser_playlist_changed(struct screen_browser *browser, mpdclient_t *c, const char *browser_lw_callback(unsigned index, bool *highlight, char** second_column, void *filelist); +struct filelist_entry * +browser_get_selected_entry(const struct screen_browser *browser); + bool browser_change_directory(struct screen_browser *browser, mpdclient_t *c, filelist_entry_t *entry, const char *new_path);