changeset 780:44128da39e13

Drop initialization to NULL since filelist_read() will take care of it.
author zas_
date Tue, 03 Jun 2008 11:24:16 +0000
parents 8b21337bc47b
children 2d2cca2bceb0
files src/bar_sort.c src/cache_maint.c src/collect-io.c src/collect-table.c src/dupe.c src/filedata.c src/img-view.c src/main.c src/pan-util.c src/utilops.c src/view_dir_list.c src/view_dir_tree.c src/view_file_list.c
diffstat 13 files changed, 28 insertions(+), 36 deletions(-) [+]
line wrap: on
line diff
--- a/src/bar_sort.c	Tue Jun 03 09:41:00 2008 +0000
+++ b/src/bar_sort.c	Tue Jun 03 11:24:16 2008 +0000
@@ -89,7 +89,7 @@
 static void bar_sort_collection_list_build(GtkWidget *bookmarks)
 {
 	gchar *collect_path;
-	GList *list = NULL;
+	GList *list;
 	GList *work;
 
 	history_list_free_key(SORT_KEY_COLLECTIONS);
--- a/src/cache_maint.c	Tue Jun 03 09:41:00 2008 +0000
+++ b/src/cache_maint.c	Tue Jun 03 11:24:16 2008 +0000
@@ -274,7 +274,7 @@
 void cache_maintain_home(gint metadata, gint clear, GtkWidget *parent)
 {
 	CMData *cm;
-	GList *dlist = NULL;
+	GList *dlist;
 	gchar *base;
 	const gchar *msg;
 	const gchar *cache_folder;
@@ -290,7 +290,7 @@
 		}
 
 	base = g_build_filename(homedir(), cache_folder, NULL);
-
+	
 	if (!filelist_read(base, NULL, &dlist))
 		{
 		g_free(base);
@@ -1011,19 +1011,16 @@
 	gtk_progress_bar_set_text(GTK_PROGRESS_BAR(cd->progress), _("running..."));
 
 	path = g_build_filename(homedir(), THUMB_FOLDER_GLOBAL, THUMB_FOLDER_NORMAL, NULL);
-	list = NULL;
 	filelist_read(path, &list, NULL);
 	cd->list = list;
 	g_free(path);
 
 	path = g_build_filename(homedir(), THUMB_FOLDER_GLOBAL, THUMB_FOLDER_LARGE, NULL);
-	list = NULL;
 	filelist_read(path, &list, NULL);
 	cd->list = g_list_concat(cd->list, list);
 	g_free(path);
 
 	path = g_build_filename(homedir(), THUMB_FOLDER_GLOBAL, THUMB_FOLDER_FAIL, NULL);
-	list = NULL;
 	filelist_read(path, &list, NULL);
 	cd->list = g_list_concat(cd->list, list);
 	g_free(path);
--- a/src/collect-io.c	Tue Jun 03 09:41:00 2008 +0000
+++ b/src/collect-io.c	Tue Jun 03 11:24:16 2008 +0000
@@ -665,7 +665,7 @@
 
 static void collect_manager_refresh(void)
 {
-	GList *list = NULL;
+	GList *list;
 	GList *work;
 	gchar *base;
 
--- a/src/collect-table.c	Tue Jun 03 09:41:00 2008 +0000
+++ b/src/collect-table.c	Tue Jun 03 11:24:16 2008 +0000
@@ -1900,8 +1900,8 @@
 
 static void collection_table_add_dir_recursive(CollectTable *ct, gchar *path, gint recursive)
 {
-	GList *d = NULL;
-	GList *f = NULL;
+	GList *d;
+	GList *f;
 	GList *work;
 
 	if (!filelist_read(path, &f, recursive ? &d : NULL))
--- a/src/dupe.c	Tue Jun 03 09:41:00 2008 +0000
+++ b/src/dupe.c	Tue Jun 03 11:24:16 2008 +0000
@@ -1733,6 +1733,7 @@
 		else if (isdir(fd->path) && recurse)
 			{
 			GList *f, *d;
+
 			if (filelist_read(fd->path, &f, &d))
 				{
 				GList *work;
@@ -3306,7 +3307,7 @@
 		work = work->next;
 		if (isdir(fd->path))
 			{
-			GList *list = NULL;
+			GList *list;
 
 			filelist_read(fd->path, &list, NULL);
 			list = filelist_filter(list, FALSE);
--- a/src/filedata.c	Tue Jun 03 09:41:00 2008 +0000
+++ b/src/filedata.c	Tue Jun 03 11:24:16 2008 +0000
@@ -829,8 +829,8 @@
 		{
 		FileData *fd = (FileData *)(work->data);
 		const gchar *path = fd->path;
-		GList *f = NULL;
-		GList *d = NULL;
+		GList *f;
+		GList *d;
 
 		if (filelist_read(path, &f, &d))
 			{
@@ -850,8 +850,8 @@
 
 GList *filelist_recursive(const gchar *path)
 {
-	GList *list = NULL;
-	GList *d = NULL;
+	GList *list;
+	GList *d;
 
 	if (!filelist_read(path, &list, &d)) return NULL;
 	list = filelist_filter(list, FALSE);
--- a/src/img-view.c	Tue Jun 03 09:41:00 2008 +0000
+++ b/src/img-view.c	Tue Jun 03 11:24:16 2008 +0000
@@ -937,6 +937,8 @@
 
 void view_window_new(FileData *fd)
 {
+	GList *list;
+
 	if (file_extension_match(fd->path, ".gqv"))
 		{
 		ViewWindow *vw;
@@ -961,15 +963,10 @@
 					 G_CALLBACK(view_window_collection_unref_cb), cd);
 			}
 		}
-	else if (isdir(fd->path))
-		{
-		GList *list = NULL;
-
-		if (filelist_read(fd->path, &list, NULL))
-			{
-			list = filelist_sort_path(list);
-			list = filelist_filter(list, FALSE);
-			}
+	else if (isdir(fd->path) && filelist_read(fd->path, &list, NULL))
+		{	
+		list = filelist_sort_path(list);
+		list = filelist_filter(list, FALSE);
 		real_view_window_new(NULL, list, NULL, NULL);
 		filelist_free(list);
 		}
--- a/src/main.c	Tue Jun 03 09:41:00 2008 +0000
+++ b/src/main.c	Tue Jun 03 11:24:16 2008 +0000
@@ -195,7 +195,7 @@
 static void parse_command_line_add_dir(const gchar *dir, gchar **path, gchar **file,
 				       GList **list)
 {
-	GList *files = NULL;
+	GList *files;
 	gchar *path_parsed;
 
 	path_parsed = g_strdup(dir);
--- a/src/pan-util.c	Tue Jun 03 09:41:00 2008 +0000
+++ b/src/pan-util.c	Tue Jun 03 11:24:16 2008 +0000
@@ -211,8 +211,8 @@
 GList *pan_list_tree(const gchar *path, SortType sort, gint ascend,
 		     gint ignore_symlinks)
 {
-	GList *flist = NULL;
-	GList *dlist = NULL;
+	GList *flist;
+	GList *dlist;
 	GList *result;
 	GList *folders;
 
--- a/src/utilops.c	Tue Jun 03 09:41:00 2008 +0000
+++ b/src/utilops.c	Tue Jun 03 11:24:16 2008 +0000
@@ -1522,8 +1522,8 @@
 
 FileData *file_util_delete_dir_empty_path(FileData *fd, gint real_content, gint level)
 {
-	GList *dlist = NULL;
-	GList *flist = NULL;
+	GList *dlist;
+	GList *flist;
 	GList *work;
 	FileData *fail = NULL;
 
@@ -1690,8 +1690,8 @@
 
 void file_util_delete_dir(FileData *fd, GtkWidget *parent)
 {
-	GList *dlist = NULL;
-	GList *flist = NULL;
+	GList *dlist;
+	GList *flist;
 	GList *rlist;
 
 	if (!isdir(fd->path)) return;
--- a/src/view_dir_list.c	Tue Jun 03 09:41:00 2008 +0000
+++ b/src/view_dir_list.c	Tue Jun 03 11:24:16 2008 +0000
@@ -219,10 +219,8 @@
 	vd->path = g_strdup(path);
 
 	filelist_free(VDLIST_INFO(vd, list));
-	VDLIST_INFO(vd, list) = NULL;
 
 	ret = filelist_read(vd->path, NULL, &VDLIST_INFO(vd, list));
-
 	VDLIST_INFO(vd, list) = filelist_sort(VDLIST_INFO(vd, list), SORT_NAME, TRUE);
 
 	/* add . and .. */
--- a/src/view_dir_tree.c	Tue Jun 03 09:41:00 2008 +0000
+++ b/src/view_dir_tree.c	Tue Jun 03 11:24:16 2008 +0000
@@ -452,7 +452,6 @@
 
 	vdtree_busy_push(vd);
 
-	list = NULL;
 	filelist_read(nd->fd->path, NULL, &list);
 
 	/* when hidden files are not enabled, and the user enters a hidden path,
--- a/src/view_file_list.c	Tue Jun 03 09:41:00 2008 +0000
+++ b/src/view_file_list.c	Tue Jun 03 11:24:16 2008 +0000
@@ -1564,10 +1564,10 @@
 	if (vf->path)
 		{
 		ret = filelist_read(vf->path, &vf->list, NULL);
+
+		DEBUG_1("%s vflist_refresh: sort", get_exec_time());
+		vf->list = filelist_sort(vf->list, vf->sort_method, vf->sort_ascend);
 		}
-	DEBUG_1("%s vflist_refresh: sort", get_exec_time());
-
-	vf->list = filelist_sort(vf->list, vf->sort_method, vf->sort_ascend);
 
 	DEBUG_1("%s vflist_refresh: populate view", get_exec_time());