Do not save in history Collections that have been deleted
authorColin Clark <cclark@carbon>
Sat, 23 Nov 2019 15:52:40 +0000 (15:52 +0000)
committerColin Clark <cclark@carbon>
Sat, 23 Nov 2019 15:52:40 +0000 (15:52 +0000)
When saving the history file, check if a Collection still exists.

It would be better if this was done when the delete key is pressed.

src/history_list.c

index d03ee05..ecf73cf 100644 (file)
@@ -308,7 +308,7 @@ gboolean history_list_save(const gchar *path)
                list_count = g_list_position(hd->list, g_list_last(hd->list)) + 1;
                while (work && secsave_errno == SS_ERR_NONE)
                        {
-                       if (!(strcmp(hd->key, "path_list") == 0 && list_count > options->open_recent_list_maxsize))
+                       if ((!(strcmp(hd->key, "path_list") == 0 && list_count > options->open_recent_list_maxsize)) && (!(strcmp(hd->key, "recent") == 0 && (!isfile(work->data)))))
                                {
                                secure_fprintf(ssi, "\"%s\"\n", (gchar *)work->data);
                                }