[Xfce4-commits] <ristretto:master> Set iter-position to 0 when opening a folder from the recently-used-items list.

Stephan Arts noreply at xfce.org
Fri Sep 2 23:52:03 CEST 2011


Updating branch refs/heads/master
         to 43bb0e2407c532178b51a9fb233d9ce42ce3fada (commit)
       from c0de3470d959d11c7427bac9e93958b9255fc116 (commit)

commit 43bb0e2407c532178b51a9fb233d9ce42ce3fada
Author: Stephan Arts <stephan at xfce.org>
Date:   Wed Aug 31 22:35:51 2011 +0200

    Set iter-position to 0 when opening a folder from the recently-used-items
    list.

 src/main_window.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/src/main_window.c b/src/main_window.c
index 3b6c17d..f8e32d5 100644
--- a/src/main_window.c
+++ b/src/main_window.c
@@ -2152,8 +2152,10 @@ cb_rstto_main_window_open_folder (GtkWidget *widget, RsttoMainWindow *window)
             g_object_unref (file_info);
         }
 
-        if (pos == -1)
+        if (-1 == pos)
+        {
             rstto_image_list_iter_set_position (window->priv->iter, 0);
+        }
 
         g_idle_add_full(G_PRIORITY_LOW, (GSourceFunc) rstto_main_window_add_file_to_recent_files,
         file, NULL);
@@ -2192,11 +2194,13 @@ cb_rstto_main_window_open_recent(GtkRecentChooser *chooser, RsttoMainWindow *win
     GFileEnumerator *file_enumarator = NULL;
     GFileInfo *child_file_info = NULL;
     GFileInfo *file_info = g_file_query_info (file, "standard::type", 0, NULL, &error);
+    gint pos = 0;
 
     if (error == NULL)
     {
         if (g_file_info_get_file_type (file_info) == G_FILE_TYPE_DIRECTORY)
         {
+            pos = rstto_image_list_iter_get_position(window->priv->iter);
             file_enumarator = g_file_enumerate_children (file, "standard::*", 0, NULL, NULL);
             for(child_file_info = g_file_enumerator_next_file (file_enumarator, NULL, NULL); child_file_info != NULL; child_file_info = g_file_enumerator_next_file (file_enumarator, NULL, NULL))
             {
@@ -2213,6 +2217,11 @@ cb_rstto_main_window_open_recent(GtkRecentChooser *chooser, RsttoMainWindow *win
                 g_object_unref (child_file_info);
             }
 
+            if (-1 == pos)
+            {
+                rstto_image_list_iter_set_position (window->priv->iter, 0);
+            }
+
         }
         else
         {


More information about the Xfce4-commits mailing list