Significantly reduce signal emission for Location undo
Undo sets the state of ALL Locations, which resulted in at least two signals for each Location (name changed, start+end changed), even if there was no change.
This commit is contained in:
parent
62f20d126f
commit
1de91fa0fb
@ -185,6 +185,7 @@ Location::resume_signals ()
|
|||||||
for (auto const& s : _postponed_signals) {
|
for (auto const& s : _postponed_signals) {
|
||||||
actually_emit_signal (s);
|
actually_emit_signal (s);
|
||||||
}
|
}
|
||||||
|
_postponed_signals.clear ();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -267,6 +268,9 @@ Location::set_time_domain (TimeDomain domain)
|
|||||||
void
|
void
|
||||||
Location::set_name (const std::string& str)
|
Location::set_name (const std::string& str)
|
||||||
{
|
{
|
||||||
|
if (_name == str) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
_name = str;
|
_name = str;
|
||||||
emit_signal (Name); /* EMIT SIGNAL*/
|
emit_signal (Name); /* EMIT SIGNAL*/
|
||||||
}
|
}
|
||||||
@ -712,6 +716,9 @@ Location::set_state (const XMLNode& node, int version)
|
|||||||
may make the value of _start illegal.
|
may make the value of _start illegal.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
timepos_t old_start (_start);
|
||||||
|
timepos_t old_end (_end);
|
||||||
|
|
||||||
if (!node.get_property ("start", _start)) {
|
if (!node.get_property ("start", _start)) {
|
||||||
error << _("XML node for Location has no start information") << endmsg;
|
error << _("XML node for Location has no start information") << endmsg;
|
||||||
return -1;
|
return -1;
|
||||||
@ -765,7 +772,9 @@ Location::set_state (const XMLNode& node, int version)
|
|||||||
_scene_change = SceneChange::factory (*scene_child, version);
|
_scene_change = SceneChange::factory (*scene_child, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
emit_signal (StartEnd); /* EMIT SIGNAL */
|
if (old_start != _start || old_end != _end) {
|
||||||
|
emit_signal (StartEnd); /* EMIT SIGNAL */
|
||||||
|
}
|
||||||
|
|
||||||
assert (_start.is_positive() || _start.is_zero());
|
assert (_start.is_positive() || _start.is_zero());
|
||||||
assert (_end.is_positive() || _end.is_zero());
|
assert (_end.is_positive() || _end.is_zero());
|
||||||
|
Loading…
Reference in New Issue
Block a user