[pitivi] utils/timeline: Only emit "selection-changed" if actually changed



commit c2be24ba5e07925aece2799df96dfddc8d1dd1cd
Author: Jean-FranÃois Fortin Tam <nekohayo gmail com>
Date:   Sat Jun 2 19:53:31 2012 -0400

    utils/timeline: Only emit "selection-changed" if actually changed

 pitivi/utils/timeline.py |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/pitivi/utils/timeline.py b/pitivi/utils/timeline.py
index d889959..2ce823d 100644
--- a/pitivi/utils/timeline.py
+++ b/pitivi/utils/timeline.py
@@ -115,6 +115,10 @@ class Selection(Signallable):
             selection = self.selected | selection
         elif mode == UNSELECT:
             selection = self.selected - selection
+
+        if selection == old_selection:
+            # The user clicked on the same clip
+            return
         self.selected = selection
 
         if len(self.selected) == 1:
@@ -130,7 +134,6 @@ class Selection(Signallable):
                 if not isinstance(tckobj, ges.TrackEffect):
                     tckobj.selected.selected = False
 
-        # FIXME : shouldn't we ONLY emit this IFF the selection has changed ?
         self.emit("selection-changed")
 
     def getSelectedTrackObjs(self):



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