/*
- * GQview
- * (C) 2006 John Ellis
+ * Copyright (C) 2006 John Ellis
+ * Copyright (C) 2008 - 2016 The Geeqie Team
*
* Author: John Ellis
*
- * 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 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 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 "gqview.h"
+#include "main.h"
#include "pan-types.h"
#include "ui_fileops.h"
*-----------------------------------------------------------------------------
*/
-gint pan_date_compare(time_t a, time_t b, PanDateLengthType length)
+gboolean pan_date_compare(time_t a, time_t b, PanDateLengthType length)
{
struct tm ta;
struct tm tb;
*-----------------------------------------------------------------------------
*/
-gint pan_is_link_loop(const gchar *s)
+gboolean pan_is_link_loop(const gchar *s)
{
gchar *sl;
struct stat st;
- gint ret = FALSE;
+ gboolean ret = FALSE;
sl = path_from_utf8(s);
parse_out_relatives(sl);
- if (buf[0] == '/')
+ if (buf[0] == G_DIR_SEPARATOR)
{
if (strncmp(sl, buf, l) == 0 &&
- (sl[l] == '\0' || sl[l] == '/' || l == 1)) ret = TRUE;
+ (sl[l] == '\0' || sl[l] == G_DIR_SEPARATOR || l == 1)) ret = TRUE;
}
else
{
gchar *link_path;
- link_path = concat_dir_and_file(sl, buf);
+ link_path = g_build_filename(sl, buf, NULL);
parse_out_relatives(link_path);
if (strncmp(sl, link_path, l) == 0 &&
- (sl[l] == '\0' || sl[l] == '/' || l == 1)) ret = TRUE;
+ (sl[l] == '\0' || sl[l] == G_DIR_SEPARATOR || l == 1)) ret = TRUE;
g_free(link_path);
}
return ret;
}
-gint pan_is_ignored(const gchar *s, gint ignore_symlinks)
+gboolean pan_is_ignored(const gchar *s, gboolean ignore_symlinks)
{
struct stat st;
const gchar *n;
if (S_ISLNK(st.st_mode) && (ignore_symlinks || pan_is_link_loop(s))) return TRUE;
n = filename_from_path(s);
- if (n && strcmp(n, GQVIEW_RC_DIR) == 0) return TRUE;
+ if (n && strcmp(n, GQ_RC_DIR) == 0) return TRUE;
return FALSE;
}
-GList *pan_list_tree(const gchar *path, SortType sort, gint ascend,
- gint ignore_symlinks)
+GList *pan_list_tree(FileData *dir_fd, SortType sort, gboolean ascend,
+ gboolean ignore_symlinks)
{
- GList *flist = NULL;
- GList *dlist = NULL;
+ GList *flist;
+ GList *dlist;
GList *result;
GList *folders;
- filelist_read(path, &flist, &dlist);
+ filelist_read(dir_fd, &flist, &dlist);
if (sort != SORT_NONE)
{
flist = filelist_sort(flist, sort, ascend);
folders = g_list_remove(folders, fd);
if (!pan_is_ignored(fd->path, ignore_symlinks) &&
- filelist_read(fd->path, &flist, &dlist))
+ filelist_read(fd, &flist, &dlist))
{
if (sort != SORT_NONE)
{
return result;
}
-
+/* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */