}
}
-void cache_maint_moved(FileData *fd)
+static void cache_maint_moved(FileData *fd)
{
gchar *base;
mode_t mode = 0755;
}
}
-void cache_maint_removed(FileData *fd)
+static void cache_maint_removed(FileData *fd)
{
gchar *buf;
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;
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
gint cache_maintain_dir(const gchar *dir, gint recursive, gint clear);
#endif
-void cache_maint_moved(FileData *fd);
-void cache_maint_removed(FileData *fd);
-void cache_maint_copied(FileData *fd);
+void cache_notify_cb(FileData *fd, NotifyType type, gpointer data);
void cache_manager_show(void);
#include "ui_bookmark.h"
#include "ui_fileops.h"
#include "ui_utildlg.h"
+#include "cache_maint.h"
#include <gdk/gdkkeysyms.h> /* for keyboard values */
#if 1
log_printf("%s %s, This is an alpha release.\n", GQ_APPNAME, VERSION);
#endif
+
+ /* register global notify functions */
+ file_data_register_notify_func(cache_notify_cb, NULL, NOTIFY_PRIORITY_HIGH);
+
parse_command_line_for_debug_option(argc, argv);
options = init_options(NULL);
switch (type)
{
case FILEDATA_CHANGE_MOVE:
- cache_maint_moved(fd);
collection_maint_renamed(fd);
layout_maint_moved(fd, NULL);
search_maint_renamed(fd);
break;
case FILEDATA_CHANGE_COPY:
- cache_maint_copied(fd);
break;
case FILEDATA_CHANGE_RENAME:
- cache_maint_moved(fd);
collection_maint_renamed(fd);
layout_maint_renamed(fd);
search_maint_removed(fd);
collection_maint_removed(fd);
- cache_maint_removed(fd);
break;
case FILEDATA_CHANGE_UNSPECIFIED:
/* FIXME */