[Xfce4-commits] <ristretto:master> Open a folder from the CLI (Bug #8301)

Stephan Arts noreply at xfce.org
Fri Jan 6 17:28:01 CET 2012


Updating branch refs/heads/master
         to c331e49671a8cf578e7159732d6a84e08db42670 (commit)
       from 3045ac94f4634bb0565f5ff0b4d2e8828ba4c081 (commit)

commit c331e49671a8cf578e7159732d6a84e08db42670
Author: Stephan Arts <stephan at xfce.org>
Date:   Fri Jan 6 17:23:58 2012 +0100

    Open a folder from the CLI (Bug #8301)

 src/main.c |   18 +++++++++++++-----
 1 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/src/main.c b/src/main.c
index 1fa683c..6489ed7 100644
--- a/src/main.c
+++ b/src/main.c
@@ -236,13 +236,13 @@ cb_rstto_open_files (RsttoOpenFiles *rof)
             }
         }
 
+        /* 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));
+
         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 file's parent directory */
             p_file = g_file_get_parent (file);
 
@@ -255,6 +255,14 @@ cb_rstto_open_files (RsttoOpenFiles *rof)
             g_object_unref (r_file);
             r_file = NULL;
         }
+        else
+        {
+            /* Open the directory */
+            rstto_image_list_set_directory (rof->image_list, file, NULL);
+
+            /* Point the iterator to the correct image */
+            rstto_image_list_iter_set_position (iter, 0);
+        }
     }
     return FALSE;
 }


More information about the Xfce4-commits mailing list