Mercurial > hg > forks > geeqie
changeset 2637:78ab69af0d91
Fix #356: Select dirlist when entering a directory
https://github.com/BestImageViewer/geeqie/issues/356
author | unqwist <> |
---|---|
date | Wed, 18 Oct 2017 17:04:54 +0100 |
parents | 22479efb61d7 |
children | 9f7b291d76a4 |
files | src/view_dir_list.c |
diffstat | 1 files changed, 12 insertions(+), 21 deletions(-) [+] |
line wrap: on
line diff
--- a/src/view_dir_list.c Tue Oct 17 17:43:49 2017 +0100 +++ b/src/view_dir_list.c Wed Oct 18 17:04:54 2017 +0100 @@ -320,30 +320,21 @@ ret = vdlist_populate(vd, TRUE); - if (old_path) - { - /* scroll to make last path visible */ - FileData *found = NULL; - GList *work; + /* scroll to make last path visible */ + FileData *found = NULL; + GList *work; - work = VDLIST(vd)->list; - while (work && !found) - { - FileData *fd = work->data; - if (strcmp(old_path, fd->name) == 0) found = fd; - work = work->next; - } - - if (found) vdlist_scroll_to_row(vd, found, 0.5); - - g_free(old_path); - return ret; + work = VDLIST(vd)->list; + while (work && !found) + { + FileData *fd = work->data; + if (!old_path || strcmp(old_path, fd->name) == 0) found = fd; + work = work->next; } - if (gtk_widget_get_realized(vd->view)) - { - gtk_tree_view_scroll_to_point(GTK_TREE_VIEW(vd->view), 0, 0); - } + if (found) vdlist_scroll_to_row(vd, found, 0.5); + + if (old_path) g_free(old_path); return ret; }