static void thunar_image_file_changed (ThunarFileMonitor *monitor, ThunarFile *file, ThunarImage *image) { _thunar_return_if_fail (THUNAR_IS_FILE_MONITOR (monitor)); _thunar_return_if_fail (THUNAR_IS_FILE (file)); _thunar_return_if_fail (THUNAR_IS_IMAGE (image)); if (file == image->priv->file) thunar_image_update (image); }
static void thunar_folder_file_changed (ThunarFileMonitor *file_monitor, ThunarFile *file, ThunarFolder *folder) { _thunar_return_if_fail (THUNAR_IS_FILE (file)); _thunar_return_if_fail (THUNAR_IS_FOLDER (folder)); _thunar_return_if_fail (THUNAR_IS_FILE_MONITOR (file_monitor)); /* check if the corresponding file changed... */ if (G_UNLIKELY (folder->corresponding_file == file)) { /* ...and if so, reload the folder */ thunar_folder_reload (folder); } }
static void thunar_folder_file_destroyed (ThunarFileMonitor *file_monitor, ThunarFile *file, ThunarFolder *folder) { GList files; GList *lp; _thunar_return_if_fail (THUNAR_IS_FILE (file)); _thunar_return_if_fail (THUNAR_IS_FOLDER (folder)); _thunar_return_if_fail (THUNAR_IS_FILE_MONITOR (file_monitor)); /* check if the corresponding file was destroyed */ if (G_UNLIKELY (folder->corresponding_file == file)) { /* the folder is useless now */ gtk_object_destroy (GTK_OBJECT (folder)); } else { /* check if we have that file */ lp = g_list_find (folder->files, file); if (G_LIKELY (lp != NULL)) { /* remove the file from our list */ folder->files = g_list_delete_link (folder->files, lp); /* tell everybody that the file is gone */ files.data = file; files.next = files.prev = NULL; g_signal_emit (G_OBJECT (folder), folder_signals[FILES_REMOVED], 0, &files); /* drop our reference to the file */ g_object_unref (G_OBJECT (file)); } } }