[evince] [libview] Don't emit selection-changed when selection doesn't change after clear_selection
- From: Carlos Garcia Campos <carlosgc src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [evince] [libview] Don't emit selection-changed when selection doesn't change after clear_selection
- Date: Mon, 11 Jan 2010 11:32:17 +0000 (UTC)
commit b4b109f954781cdcdcfb90202868d2f7efb43e40
Author: Carlos Garcia Campos <carlosgc gnome org>
Date: Mon Jan 11 12:18:16 2010 +0100
[libview] Don't emit selection-changed when selection doesn't change after clear_selection
libview/ev-view.c | 11 +++++++----
1 files changed, 7 insertions(+), 4 deletions(-)
---
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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]