Preferences: Open recent list maximum size
authorColin Clark <cclark@mcb.net>
Thu, 5 Jan 2017 13:53:31 +0000 (13:53 +0000)
committerColin Clark <cclark@mcb.net>
Thu, 5 Jan 2017 13:53:31 +0000 (13:53 +0000)
Implement this function, and change the name to "Recent folder list
maximum size"

doc/docbook/GuideOptionsBehavior.xml
src/history_list.c
src/preferences.c

index c98bd5b..7688e7d 100644 (file)
       </varlistentry>\r
       <varlistentry>\r
         <term>\r
-          <guilabel>Open recent list maximum size</guilabel>\r
+          <guilabel>Recent folder list maximum size</guilabel>\r
         </term>\r
         <listitem>\r
-          <para>This is the number of entries saved in the recent open file list.</para>\r
+          <para>This is the number of entries to be saved from the recent open folder list drop-down box. The number of entries displayed in the current session is unlimited.</para>\r
         </listitem>\r
       </varlistentry>\r
       <varlistentry>\r
index 299840d..505c499 100644 (file)
@@ -130,6 +130,7 @@ gboolean history_list_save(const gchar *path)
        SecureSaveInfo *ssi;
        GList *list;
        gchar *pathl;
+       gint list_count;
 
        pathl = path_from_utf8(path);
        ssi = secure_open(pathl);
@@ -157,10 +158,15 @@ gboolean history_list_save(const gchar *path)
                 * so that when reading they are added correctly
                 */
                work = g_list_last(hd->list);
+               list_count = g_list_position(hd->list, g_list_last(hd->list)) + 1;
                while (work && secsave_errno == SS_ERR_NONE)
                        {
-                       secure_fprintf(ssi, "\"%s\"\n", (gchar *)work->data);
+                       if (!(strcmp(hd->key, "path_list") == 0 && list_count > options->open_recent_list_maxsize))
+                               {
+                               secure_fprintf(ssi, "\"%s\"\n", (gchar *)work->data);
+                               }
                        work = work->prev;
+                       list_count--;
                        }
                secure_fputc(ssi, '\n');
                }
index 27773a0..7c6733b 100644 (file)
@@ -2154,7 +2154,7 @@ static void config_tab_behavior(GtkWidget *notebook)
        pref_checkbox_new_int(group, _("List directory view uses single click to enter"),
                              options->view_dir_list_single_click_enter, &c_options->view_dir_list_single_click_enter);
 
-       pref_spin_new_int(group, _("Open recent list maximum size"), NULL,
+       pref_spin_new_int(group, _("Recent folder list maximum size"), NULL,
                          1, 50, 1, options->open_recent_list_maxsize, &c_options->open_recent_list_maxsize);
 
        pref_spin_new_int(group, _("Drag'n drop icon size"), NULL,