Changeset View
Changeset View
Standalone View
Standalone View
src/timeline2/view/timelinecontroller.cpp
Context not available. | |||||
108 | return m_model->tractor(); | 108 | return m_model->tractor(); | ||
---|---|---|---|---|---|
109 | } | 109 | } | ||
110 | 110 | | |||
111 | void TimelineController::removeSelection(int newSelection) | ||||
112 | { | ||||
113 | if (!m_selection.selectedItems.contains(newSelection)) { | ||||
114 | return; | ||||
115 | } | ||||
116 | m_selection.selectedItems.removeAll(newSelection); | ||||
117 | std::unordered_set<int> ids; | ||||
118 | ids.insert(m_selection.selectedItems.cbegin(), m_selection.selectedItems.cend()); | ||||
119 | m_model->m_temporarySelectionGroup = m_model->requestClipsGroup(ids, true, GroupType::Selection); | ||||
120 | | ||||
121 | std::unordered_set<int> newIds; | ||||
122 | if (m_model->m_temporarySelectionGroup >= 0) { | ||||
123 | // new items were selected, inform model to prepare for group drag | ||||
124 | newIds = m_model->getGroupElements(m_selection.selectedItems.constFirst()); | ||||
125 | } | ||||
126 | emit selectionChanged(); | ||||
127 | if (!m_selection.selectedItems.isEmpty()) | ||||
128 | emitSelectedFromSelection(); | ||||
129 | else | ||||
130 | emit selected(nullptr); | ||||
131 | } | ||||
132 | | ||||
111 | void TimelineController::addSelection(int newSelection) | 133 | void TimelineController::addSelection(int newSelection) | ||
112 | { | 134 | { | ||
113 | if (m_selection.selectedItems.contains(newSelection)) { | 135 | if (m_selection.selectedItems.contains(newSelection)) { | ||
114 | return; | 136 | return; | ||
115 | } | 137 | } | ||
116 | std::unordered_set<int> previousSelection = getCurrentSelectionIds(); | | |||
117 | m_selection.selectedItems << newSelection; | 138 | m_selection.selectedItems << newSelection; | ||
118 | std::unordered_set<int> ids; | 139 | std::unordered_set<int> ids; | ||
119 | ids.insert(m_selection.selectedItems.cbegin(), m_selection.selectedItems.cend()); | 140 | ids.insert(m_selection.selectedItems.cbegin(), m_selection.selectedItems.cend()); | ||
Context not available. |