From b4b109f954781cdcdcfb90202868d2f7efb43e40 Mon Sep 17 00:00:00 2001 From: Carlos Garcia Campos Date: Mon, 11 Jan 2010 11:18:16 +0000 Subject: [libview] Don't emit selection-changed when selection doesn't change after clear_selection --- (limited to 'libview') diff --git a/libview/ev-view.c b/libview/ev-view.c index 7ef1dd8..47fb438 100644 --- a/libview/ev-view.c +++ b/libview/ev-view.c @@ -5454,13 +5454,16 @@ selection_free (EvViewSelection *selection) static void clear_selection (EvView *view) { - g_list_foreach (view->selection_info.selections, (GFunc)selection_free, NULL); - g_list_free (view->selection_info.selections); - view->selection_info.selections = NULL; + if (view->selection_info.selections) { + g_list_foreach (view->selection_info.selections, (GFunc)selection_free, NULL); + g_list_free (view->selection_info.selections); + view->selection_info.selections = NULL; + + g_signal_emit (view, signals[SIGNAL_SELECTION_CHANGED], 0, NULL); + } view->selection_info.in_selection = FALSE; if (view->pixbuf_cache) ev_pixbuf_cache_set_selection_list (view->pixbuf_cache, NULL); - g_signal_emit (view, signals[SIGNAL_SELECTION_CHANGED], 0, NULL); } void -- cgit v0.9.1