]> www.fi.muni.cz Git - evince.git/commitdiff
[libview] Don't emit selection-changed when selection doesn't change after clear_sele...
authorCarlos Garcia Campos <carlosgc@gnome.org>
Mon, 11 Jan 2010 11:18:16 +0000 (12:18 +0100)
committerCarlos Garcia Campos <carlosgc@gnome.org>
Mon, 11 Jan 2010 11:20:17 +0000 (12:20 +0100)
libview/ev-view.c

index 7ef1dd862b462db4b29f3e79f76ff6e34232421e..47fb438c94f2c97b90e09f71a3feafffb31b58df 100644 (file)
@@ -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