[eog] When deleting images make sure there's is actually something to delete
- From: Felix Riemann <friemann src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [eog] When deleting images make sure there's is actually something to delete
- Date: Tue, 18 Jun 2013 16:55:27 +0000 (UTC)
commit d8131568a9129dd8a322fa9b328fb0a9cb0953d8
Author: Felix Riemann <friemann gnome org>
Date: Tue Jun 18 18:52:27 2013 +0200
When deleting images make sure there's is actually something to delete
Fixes crashes when one tries to delete an image that was already
deleted outside of eog. The result is not nice, but it is
analogous to what "Move to Trash" does in that case.
https://bugzilla.gnome.org/show_bug.cgi?id=702523
src/eog-window.c | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/src/eog-window.c b/src/eog-window.c
index 84b1dee..4d30a51 100644
--- a/src/eog-window.c
+++ b/src/eog-window.c
@@ -3548,10 +3548,13 @@ eog_window_cmd_delete (GtkAction *action, gpointer user_data)
window = EOG_WINDOW (user_data);
images = eog_thumb_view_get_selected_images (EOG_THUMB_VIEW (window->priv->thumbview));
- result = show_force_image_delete_confirm_dialog (window, images);
+ if (G_LIKELY (g_list_length (images) > 0))
+ {
+ result = show_force_image_delete_confirm_dialog (window, images);
- if (result == GTK_RESPONSE_OK)
- eog_window_force_image_delete (window, images);
+ if (result == GTK_RESPONSE_OK)
+ eog_window_force_image_delete (window, images);
+ }
}
static int
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]