Remove commented out code.
[geeqie.git] / src / pan-util.c
index 9ff673b..5a6f91a 100644 (file)
@@ -1,6 +1,7 @@
 /*
  * Geeqie
  * (C) 2006 John Ellis
+ * Copyright (C) 2008 - 2012 The Geeqie Team
  *
  * Author: John Ellis
  *
@@ -21,7 +22,7 @@
  *-----------------------------------------------------------------------------
  */
 
-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;
@@ -133,11 +134,11 @@ time_t pan_date_to_time(gint year, gint month, gint day)
  *-----------------------------------------------------------------------------
  */
 
-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);
 
@@ -157,20 +158,20 @@ gint pan_is_link_loop(const gchar *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);
                                }
@@ -184,7 +185,7 @@ gint pan_is_link_loop(const gchar *s)
        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;
@@ -207,15 +208,15 @@ gint pan_is_ignored(const gchar *s, gint ignore_symlinks)
        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);
@@ -232,7 +233,7 @@ GList *pan_list_tree(const gchar *path, SortType sort, gint 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)
                                {
@@ -249,4 +250,4 @@ GList *pan_list_tree(const gchar *path, SortType sort, gint ascend,
 
        return result;
 }
-
+/* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */