Skip to content

Commit

Permalink
do not try to reload deleted image
Browse files Browse the repository at this point in the history
deleted image is replaced by the next one from the list, keep
the old image displayed until the new one is set
  • Loading branch information
nadvornik committed Jul 24, 2009
1 parent 00c99d2 commit 2d113f0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/image.c
Original file line number Diff line number Diff line change
Expand Up @@ -1442,6 +1442,8 @@ static void image_notify_cb(FileData *fd, NotifyType type, gpointer data)

if ((type & (NOTIFY_REREAD | NOTIFY_CHANGE)) && fd == imd->image_fd)
{
if ((type & NOTIFY_CHANGE) && fd->change && fd->change->type == FILEDATA_CHANGE_DELETE)
return; /* keep the image displayed, it will be replaced by the next image from the list soon */
DEBUG_1("Notify image: %s %04x", fd->path, type);
image_reload(imd);
}
Expand Down
6 changes: 4 additions & 2 deletions src/layout_image.c
Original file line number Diff line number Diff line change
Expand Up @@ -1879,9 +1879,11 @@ static void layout_image_maint_removed(LayoutWindow *lw, FileData *fd)
layout_image_set_collection(lw, cd, new);
return;
}
layout_image_set_fd(lw, NULL);
}

layout_image_set_fd(lw, NULL);

/* the image will be set to the next image from the list soon,
setting it to NULL here is not necessary*/
}
}

Expand Down

0 comments on commit 2d113f0

Please sign in to comment.