diff --git a/src/trackerd/tracker-inotify.c b/src/trackerd/tracker-inotify.c index 265f9d3..41321a0 100644 --- a/src/trackerd/tracker-inotify.c +++ b/src/trackerd/tracker-inotify.c @@ -163,6 +163,12 @@ process_event (const char *uri, gboolean is_dir, TrackerChangeAction action, gui tracker_info ("found matching inotify pair for from %s to %s", moved_from_info->uri, moved_to_info->uri); if (!tracker_is_directory (moved_to_info->uri)) { + if (g_file_test (moved_to_info->uri, G_FILE_TEST_EXISTS)) { + guint id = tracker_get_file_id (main_thread_db_con, moved_to_info->uri); + if (id) { + tracker_db_delete_file (main_thread_db_con, main_thread_db_con->blob, id); + } + } tracker_db_move_file (main_thread_db_con, moved_from_info->uri, moved_to_info->uri); } else { tracker_db_move_directory (main_thread_db_con, moved_from_info->uri, moved_to_info->uri);