/*
- * Geeqie
- * Copyright (C) 2008 The Geeqie Team
+ * Copyright (C) 2008 - 2016 The Geeqie Team
*
* Authors: John Ellis, Vladimir Nadvornik, Laurent Monin
*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
*
- * This software is released under the GNU General Public License (GNU GPL).
- * Please read the included file COPYING for more information.
- * This software comes with no warranty of any kind, use at your own risk!
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "main.h"
return NULL;
}
-gint history_list_load(const gchar *path)
+gboolean history_list_load(const gchar *path)
{
FILE *f;
gchar *key = NULL;
return TRUE;
}
-gint history_list_save(const gchar *path)
+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);
* 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');
}
g_free(hd);
}
-static HistoryData *history_list_find_by_key(const gchar* key)
+static HistoryData *history_list_find_by_key(const gchar *key)
{
GList *work = history_list;
return NULL;
}
-const gchar *history_list_find_last_path_by_key(const gchar* key)
+const gchar *history_list_find_last_path_by_key(const gchar *key)
{
HistoryData *hd;
return hd->list;
}
+/* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */