diff options
author | Max Kellermann <max@duempel.org> | 2008-10-03 11:56:00 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2008-10-03 11:56:00 +0200 |
commit | 4ca0f663a918fc04389ff4351b596209902bd11c (patch) | |
tree | f96185f6b9ad29c5d6095f5da8f9903b4923c2d4 /src/list_window.c | |
parent | e2c8e28ef7ccda32fb32792b086c40144df2a916 (diff) | |
download | mpd-4ca0f663a918fc04389ff4351b596209902bd11c.tar.gz mpd-4ca0f663a918fc04389ff4351b596209902bd11c.tar.xz mpd-4ca0f663a918fc04389ff4351b596209902bd11c.zip |
list_window: remove list_window_state_t
We do not need to save a stack of list window states. When we return
to a parent directory, we just have to find the directory which we
come from in the parent list. Note that this patch resets the cursor
when going to the root directory, but I think it's not that important,
and I will deal with that later.
Diffstat (limited to '')
-rw-r--r-- | src/list_window.c | 54 |
1 files changed, 0 insertions, 54 deletions
diff --git a/src/list_window.c b/src/list_window.c index 93bed8666..55b621b4a 100644 --- a/src/list_window.c +++ b/src/list_window.c @@ -382,57 +382,3 @@ list_window_mouse(struct list_window *lw, unsigned rows, return 0; } #endif - -list_window_state_t * -list_window_init_state(void) -{ - return g_malloc0(sizeof(list_window_state_t)); -} - -void -list_window_free_state(list_window_state_t *state) -{ - if (state) { - if (state->list) { - GList *list = state->list; - - while (list) { - g_free(list->data); - list->data = NULL; - list = list->next; - } - - g_list_free(state->list); - state->list = NULL; - } - - g_free(state); - } -} - -void -list_window_push_state(list_window_state_t *state, struct list_window *lw) -{ - if (state) { - struct list_window *tmp = g_malloc(sizeof(list_window_t)); - memcpy(tmp, lw, sizeof(list_window_t)); - state->list = g_list_prepend(state->list, (gpointer) tmp); - list_window_reset(lw); - } -} - -bool -list_window_pop_state(list_window_state_t *state, struct list_window *lw) -{ - if (state && state->list) { - struct list_window *tmp = state->list->data; - - memcpy(lw, tmp, sizeof(list_window_t)); - g_free(tmp); - state->list->data = NULL; - state->list = g_list_delete_link(state->list, state->list); - } - - // return TRUE if there are still states in the list - return (state && state->list) ? TRUE : FALSE; -} |