summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTill Theato <root@ttill.de>2014-05-06 19:44:22 (GMT)
committerTill Theato <root@ttill.de>2014-05-06 19:44:22 (GMT)
commit505017d82b98054a728f9a8725c6d51329ee8a0d (patch)
tree39738698aeada02dafff1529d338664e43930621
parent640d2a977c8e8411df9f2a36fb9d43ea4dd96c3b (diff)
Remove code duplication.
-rw-r--r--src/customtrackview.cpp19
1 files changed, 5 insertions, 14 deletions
diff --git a/src/customtrackview.cpp b/src/customtrackview.cpp
index f4d7a6f..5db4109 100644
--- a/src/customtrackview.cpp
+++ b/src/customtrackview.cpp
@@ -1029,15 +1029,10 @@ void CustomTrackView::mousePressEvent(QMouseEvent * event)
}
bool itemSelected = false;
- if (m_dragItem->isSelected()) {
+ if (m_dragItem->isSelected()
+ || (m_dragItem->parentItem() && m_dragItem->parentItem()->isSelected())
+ || (dragGroup && dragGroup->isSelected()))
itemSelected = true;
- }
- else if (m_dragItem->parentItem() && m_dragItem->parentItem()->isSelected()) {
- itemSelected = true;
- }
- else if (dragGroup && dragGroup->isSelected()) {
- itemSelected = true;
- }
if ((event->modifiers() == Qt::ControlModifier) || itemSelected == false) {
if (event->modifiers() != Qt::ControlModifier) {
@@ -1288,12 +1283,8 @@ void CustomTrackView::resetSelectionGroup(bool selectItems)
m_selectionGroup = NULL;
for (int i = 0; i < children.count(); ++i) {
if (children.at(i)->parentItem() == 0) {
- if ((children.at(i)->type() == AVWidget || children.at(i)->type() == TransitionWidget)) {
- if (!static_cast <AbstractClipItem *>(children.at(i))->isItemLocked()) {
- children.at(i)->setFlag(QGraphicsItem::ItemIsMovable, true);
- children.at(i)->setSelected(selectItems);
- }
- } else if (children.at(i)->type() == GroupWidget) {
+ if (((children.at(i)->type() == AVWidget || children.at(i)->type() == TransitionWidget) && !static_cast <AbstractClipItem *>(children.at(i))->isItemLocked())
+ || children.at(i)->type() == GroupWidget) {
children.at(i)->setFlag(QGraphicsItem::ItemIsMovable, true);
children.at(i)->setSelected(selectItems);
}