+ // Some operations, notably scrubbing and scrolling, happen in so large increments
+ // that we want to group them instead of saving to disk every single time.
+ // If they happen (ie., we get a callback from the model that it's changed) while
+ // currently_deferring_model_changes, we fire off this timer. If it manages to elapse
+ // before some other event happens, we count the event. (If the other event is of the
+ // same kind, we just fire off the timer anew instead of taking any action.)
+ QTimer *defer_timeout;
+ std::string deferred_change_id;
+ StateProto deferred_state;
+
+ // Before a change that should be deferred (see above), currently_deferring_model_changes
+ // must be set to true, and current_change_id must be given contents describing what's
+ // changed to avoid accidental grouping.
+ bool currently_deferring_model_changes = false;
+ std::string current_change_id;
+