static void
cached_dir_remove_reference (CachedDir *dir)
{
  CachedDir *parent;

  parent = dir->parent;

  cached_dir_unref (dir);

  if (parent != NULL)
    {
      cached_dir_remove_reference (parent);
    }
}
static gboolean
cached_dir_remove_subdir (CachedDir  *dir,
                          const char *basename)
{
  CachedDir *subdir;

  subdir = find_subdir (dir, basename);

  if (subdir != NULL)
    {
      subdir->deleted = TRUE;

      cached_dir_unref (subdir);
      dir->subdirs = g_slist_remove (dir->subdirs, subdir);

      return TRUE;
    }

  return FALSE;
}