diff src/cache_maint.c @ 793:baade53888be

used new notification in cache_maint
author nadvornik
date Fri, 06 Jun 2008 22:34:15 +0000
parents d6a7fb4b8e7c
children 764fd82dd099
line wrap: on
line diff
--- a/src/cache_maint.c	Fri Jun 06 22:11:03 2008 +0000
+++ b/src/cache_maint.c	Fri Jun 06 22:34:15 2008 +0000
@@ -520,7 +520,7 @@
 		}
 }
 
-void cache_maint_moved(FileData *fd)
+static void cache_maint_moved(FileData *fd)
 {
 	gchar *base;
 	mode_t mode = 0755;
@@ -579,7 +579,7 @@
 		}
 }
 
-void cache_maint_removed(FileData *fd)
+static void cache_maint_removed(FileData *fd)
 {
 	gchar *buf;
 
@@ -599,7 +599,7 @@
 		thumb_std_maint_removed(fd->path);
 }
 
-void cache_maint_copied(FileData *fd)
+static void cache_maint_copied(FileData *fd)
 {
 	gchar *dest_base;
 	gchar *src_cache;
@@ -625,6 +625,28 @@
 	g_free(src_cache);
 }
 
+void cache_notify_cb(FileData *fd, NotifyType type, gpointer data)
+{
+	if (!fd->change) return;
+	
+	switch(fd->change->type)
+		{
+		case FILEDATA_CHANGE_MOVE:
+		case FILEDATA_CHANGE_RENAME:
+			cache_maint_moved(fd);
+			break;
+		case FILEDATA_CHANGE_COPY:
+			cache_maint_copied(fd);
+			break;
+		case FILEDATA_CHANGE_DELETE:
+			cache_maint_removed(fd);
+			break;
+		case FILEDATA_CHANGE_UNSPECIFIED:
+			break;
+		}
+}
+
+
 /*
  *-------------------------------------------------------------------
  * new cache maintenance utilities