[Xfce4-commits] <ristretto:master> Add files opened from the cli to recently-used list

Stephan Arts noreply at xfce.org
Sun Aug 14 14:24:01 CEST 2011


Updating branch refs/heads/master
         to 525ec6ebc3635a107e3a6176186b9bad7da6832b (commit)
       from 9ea5d3f3b37c107e25d0957d3416ee395ef97038 (commit)

commit 525ec6ebc3635a107e3a6176186b9bad7da6832b
Author: Stephan Arts <stephan at xfce.org>
Date:   Sun Aug 14 14:22:50 2011 +0200

    Add files opened from the cli to recently-used list

 src/main.c        |   14 +++++++++++---
 src/main_window.c |    2 --
 2 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/src/main.c b/src/main.c
index c377c8f..1810a4a 100644
--- a/src/main.c
+++ b/src/main.c
@@ -118,7 +118,6 @@ main(int argc, char **argv)
         rof.argc = argc;
         rof.argv = argv;
     	rof.iter = 1;
-        rof.window = RSTTO_MAIN_WINDOW (window);
         rof.open_entire_folder = rstto_settings_get_boolean_property (settings, "open-entire-folder");
 
         g_idle_add ((GSourceFunc )cb_rstto_open_files, &rof);
@@ -171,7 +170,10 @@ cb_rstto_open_files (RsttoOpenFiles *rof)
 
                     if (strncmp (content_type, "image/", 6) == 0)
                     {
-                        rstto_image_list_add_file (rof->image_list, file, NULL);
+                        if (rstto_image_list_add_file (rof->image_list, file, NULL) == TRUE)
+                        {
+                            rstto_main_window_add_file_to_recent_files (file);
+                        }
                     }
 
                     if (rof->open_entire_folder) 
@@ -179,6 +181,8 @@ cb_rstto_open_files (RsttoOpenFiles *rof)
                         file_type = g_file_info_get_file_type(file_info);
                         if (file_type == G_FILE_TYPE_DIRECTORY)
                         {
+                            rstto_main_window_add_file_to_recent_files (file);
+
                             file_enumarator = g_file_enumerate_children (file, "standard::*", 0, NULL, NULL);
                             for(file_info = g_file_enumerator_next_file (file_enumarator, NULL, NULL); file_info != NULL; file_info = g_file_enumerator_next_file (file_enumarator, NULL, NULL))
                             {
@@ -215,7 +219,10 @@ cb_rstto_open_files (RsttoOpenFiles *rof)
 
                 if (strncmp (content_type, "image/", 6) == 0)
                 {
-                    rstto_image_list_add_file (rof->image_list, file, NULL);
+                    if (rstto_image_list_add_file (rof->image_list, file, NULL) == TRUE)
+                    {
+                        rstto_main_window_add_file_to_recent_files (file);
+                    }
                 }
             }
         }
@@ -224,6 +231,7 @@ cb_rstto_open_files (RsttoOpenFiles *rof)
         }
         else
         {
+            rstto_main_window_add_file_to_recent_files (file);
             p_file = file;
         }
         file_enumarator = g_file_enumerate_children (p_file, "standard::*", 0, NULL, NULL);
diff --git a/src/main_window.c b/src/main_window.c
index 5076a06..970ecda 100644
--- a/src/main_window.c
+++ b/src/main_window.c
@@ -263,8 +263,6 @@ cb_rstto_main_window_vpaned_pos_changed (GtkWidget *widget, gpointer user_data);
 static void
 cb_rstto_main_window_hpaned_pos_changed (GtkWidget *widget, gpointer user_data);
 
-gboolean
-rstto_main_window_add_file_to_recent_files (GFile *file);
 
 
 static GtkWidgetClass *parent_class = NULL;


More information about the Xfce4-commits mailing list