Commit f02794eb authored by Gaël Bonithon's avatar Gaël Bonithon
Browse files

Do not keep sticky state when current file is removed

Unlike what was done in d135e3ad. This
allows in particular to stay on the current image when renaming it,
which is done via a deleted-created pair, at least when the monitoring
is done at the directory level. The case of file monitoring, which only
works halfway, is treated in the next commit.
parent 89dfeeb7
......@@ -366,7 +366,10 @@ rstto_image_list_add_file (RsttoImageList *image_list,
r_iter = iter->data;
if (! r_iter->priv->sticky)
rstto_image_list_iter_find_file (iter->data, r_file);
r_iter->priv->sticky = TRUE;
rstto_image_list_iter_find_file (r_iter, r_iter->priv->r_file);
......@@ -433,9 +436,9 @@ rstto_image_list_remove_file (RsttoImageList *image_list,
if (r_iter->priv->link == image_list->priv->images->tail)
iter_previous (r_iter, r_iter->priv->sticky);
iter_previous (r_iter, FALSE);
iter_next (r_iter, r_iter->priv->sticky);
iter_next (r_iter, FALSE);
if (image_list->priv->images->length == 1)
......@@ -889,7 +892,6 @@ rstto_image_list_iter_find_file (
iter->priv->r_file = r_file;
iter->priv->index = index;
iter->priv->link = g_queue_peek_nth_link (image_list->priv->images, iter->priv->index);
iter->priv->sticky = TRUE;
g_signal_emit (iter,
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment