From d1f429af7e98a76cf3e01f1ac593345efaa7937b Mon Sep 17 00:00:00 2001 From: Luca Berruti Date: Thu, 5 Jan 2012 13:58:53 +0100 Subject: [PATCH] Displays all images when arg is a folder --- src/main.c | 22 +++++++++++----------- 1 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/main.c b/src/main.c index 1fa683c..a8664cb 100644 --- a/src/main.c +++ b/src/main.c @@ -236,20 +236,20 @@ cb_rstto_open_files (RsttoOpenFiles *rof) } } - if (file_type != G_FILE_TYPE_DIRECTORY && r_file != NULL) - { - /* Get the iterator used by the main-window, it should be - * set to point to the right file later. - */ - iter = rstto_main_window_get_iter (RSTTO_MAIN_WINDOW (rof->window)); + /* Get the iterator used by the main-window, it should be + * set to point to the right file later. + */ + iter = rstto_main_window_get_iter (RSTTO_MAIN_WINDOW (rof->window)); - /* Get the file's parent directory */ - p_file = g_file_get_parent (file); + /* Get the file's parent directory */ + p_file = (file_type == G_FILE_TYPE_DIRECTORY) ? file : g_file_get_parent (file); - /* Open the directory */ - rstto_image_list_set_directory (rof->image_list, p_file, NULL); + /* Open the directory */ + rstto_image_list_set_directory (rof->image_list, p_file, NULL); - /* Point the iterator to the correct image */ + /* Point the iterator to the correct image */ + if (r_file != NULL) + { rstto_image_list_iter_find_file (iter, r_file); g_object_unref (r_file); -- 1.7.7.3