diff view/ViewManager.h @ 762:b75c95e7f906 tonioni

Fix potential for crash on reloading session file - loading selections should not emit signal as if user had just made them manually
author Chris Cannam
date Thu, 03 Apr 2014 08:51:30 +0100
parents 56ba2b03508e
children 4c8ca536b54f
line wrap: on
line diff
--- a/view/ViewManager.h	Wed Apr 02 21:50:04 2014 +0100
+++ b/view/ViewManager.h	Thu Apr 03 08:51:30 2014 +0100
@@ -86,6 +86,13 @@
     size_t constrainFrameToSelection(size_t frame) const;
 
     /**
+     * Adding a selection normally emits the selectionChangedByUser
+     * signal. Call this to add a selection without emitting that signal.
+     * This is used in session file load, for example.
+     */
+    void addSelectionQuietly(const Selection &selection);
+
+    /**
      * Return the selection that contains a given frame.
      * If defaultToFollowing is true, and if the frame is not in a
      * selected area, return the next selection after the given frame.
@@ -297,7 +304,7 @@
     bool m_playSoloMode;
     bool m_alignMode;
 
-    void setSelections(const MultiSelection &ms);
+    void setSelections(const MultiSelection &ms, bool quietly = false);
     void signalSelectionChange();
 
     class SetSelectionCommand : public Command