From: Carlos Garcia Campos Date: Mon, 11 Jan 2010 11:18:16 +0000 (+0100) Subject: [libview] Don't emit selection-changed when selection doesn't change after clear_sele... X-Git-Tag: EVINCE_2_29_5~3 X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=commitdiff_plain;h=b4b109f954781cdcdcfb90202868d2f7efb43e40;p=evince.git [libview] Don't emit selection-changed when selection doesn't change after clear_selection --- diff --git a/libview/ev-view.c b/libview/ev-view.c index 7ef1dd86..47fb438c 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