diff src/view_dir_tree.c @ 1523:24a12aa0cb54

Fix up event source ids type: gint -> guint. Functions like g_timeout_add() or g_idle_add() return a guint greater than 0, but in most places it was wrongly stored as int and initialized to -1. This broke assertions matching in g_source_remove() for example since id was always greater than 0 even when timer was not set (-1 was casted to the biggest guint).
author zas_
date Mon, 06 Apr 2009 22:13:54 +0000
parents 299d45d4b1cc
children 66bf394d162a
line wrap: on
line diff
--- a/src/view_dir_tree.c	Mon Apr 06 21:52:49 2009 +0000
+++ b/src/view_dir_tree.c	Mon Apr 06 22:13:54 2009 +0000
@@ -173,14 +173,17 @@
 		vdtree_expand_by_data(vd, vd->drop_fd, TRUE);
 		}
 
-	VDTREE(vd)->drop_expand_id = -1;
+	VDTREE(vd)->drop_expand_id = 0;
 	return FALSE;
 }
 
 static void vdtree_dnd_drop_expand_cancel(ViewDir *vd)
 {
-	if (VDTREE(vd)->drop_expand_id != -1) g_source_remove(VDTREE(vd)->drop_expand_id);
-	VDTREE(vd)->drop_expand_id = -1;
+	if (VDTREE(vd)->drop_expand_id)
+		{
+		g_source_remove(VDTREE(vd)->drop_expand_id);
+		VDTREE(vd)->drop_expand_id = 0;
+		}
 }
 
 static void vdtree_dnd_drop_expand(ViewDir *vd)
@@ -959,7 +962,6 @@
 	vd->info = g_new0(ViewDirInfoTree, 1);
 
 	vd->type = DIRVIEW_TREE;
-	VDTREE(vd)->drop_expand_id = -1;
 
 	vd->dnd_drop_leave_func = vdtree_dnd_drop_expand_cancel;
 	vd->dnd_drop_update_func = vdtree_dnd_drop_expand;