| 566 | } |
| 567 | |
| 568 | void |
| 569 | TrackerContext::addTracksToSelection(const std::list<TrackMarkerPtr>& marks, |
| 570 | TrackSelectionReason reason) |
| 571 | { |
| 572 | bool hasCalledBegin = false; |
| 573 | { |
| 574 | QMutexLocker k(&_imp->trackerContextMutex); |
| 575 | |
| 576 | if (!_imp->beginSelectionCounter) { |
| 577 | k.unlock(); |
| 578 | Q_EMIT selectionAboutToChange( (int)reason ); |
| 579 | k.relock(); |
| 580 | _imp->incrementSelectionCounter(); |
| 581 | hasCalledBegin = true; |
| 582 | } |
| 583 | |
| 584 | for (std::list<TrackMarkerPtr>::const_iterator it = marks.begin(); it != marks.end(); ++it) { |
| 585 | _imp->addToSelectionList(*it); |
| 586 | } |
| 587 | |
| 588 | if (hasCalledBegin) { |
| 589 | _imp->decrementSelectionCounter(); |
| 590 | } |
| 591 | } |
| 592 | |
| 593 | if (hasCalledBegin) { |
| 594 | endSelection(reason); |
| 595 | } |
| 596 | } |
| 597 | |
| 598 | void |
| 599 | TrackerContext::removeTrackFromSelection(const TrackMarkerPtr& mark, |
no test coverage detected