[gthumb] do not show the delete confirmation dialog when no file is selected



commit 852a6a37bcf0f2b07c1b5b6096e6c77a584a6e9e
Author: Paolo Bacchilega <paobac src gnome org>
Date:   Sun Jan 20 18:28:43 2013 +0100

    do not show the delete confirmation dialog when no file is selected

 extensions/file_manager/callbacks.c |   30 +++++++++++++++++-------------
 1 files changed, 17 insertions(+), 13 deletions(-)
---
diff --git a/extensions/file_manager/callbacks.c b/extensions/file_manager/callbacks.c
index b4520b1..689ca07 100644
--- a/extensions/file_manager/callbacks.c
+++ b/extensions/file_manager/callbacks.c
@@ -1203,19 +1203,23 @@ fm__gth_browser_file_list_key_press_cb (GthBrowser  *browser,
 				location = NULL;
 			}
 
-			if (source != NULL) {
-				items = gth_file_selection_get_selected (GTH_FILE_SELECTION (gth_browser_get_file_list_view (browser)));
-				file_data_list = gth_file_list_get_files (GTH_FILE_LIST (gth_browser_get_file_list (browser)), items);
-				gth_file_source_remove (source,
-							location,
-							file_data_list,
-							(event->state & modifiers) == GDK_SHIFT_MASK,
-							GTK_WINDOW (browser));
-
-				_g_object_list_unref (file_data_list);
-				_gtk_tree_path_list_free (items);
-				result = GINT_TO_POINTER (1);
-			}
+			if (source == NULL)
+				return result;
+
+			items = gth_file_selection_get_selected (GTH_FILE_SELECTION (gth_browser_get_file_list_view (browser)));
+			if (items == NULL)
+				return result;
+
+			file_data_list = gth_file_list_get_files (GTH_FILE_LIST (gth_browser_get_file_list (browser)), items);
+			gth_file_source_remove (source,
+						location,
+						file_data_list,
+						(event->state & modifiers) == GDK_SHIFT_MASK,
+						GTK_WINDOW (browser));
+			result = GINT_TO_POINTER (1);
+
+			_g_object_list_unref (file_data_list);
+			_gtk_tree_path_list_free (items);
 		}
 		break;
 	}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]