From 92c44dc05f29e5ce6612d17d59b5e15a7b719fc4 Mon Sep 17 00:00:00 2001 From: Aleksei Kanash Date: Tue, 14 Aug 2012 15:49:06 +0300 Subject: [PATCH 1/2] Fixed some merge errors. Fixed SANKORE-902 - undo and redo works fine for deleted Media Items. --- src/domain/UBGraphicsItemDelegate.cpp | 6 ------ src/domain/UBGraphicsItemDelegate.h | 2 +- src/domain/UBGraphicsMediaItemDelegate.cpp | 13 ++++--------- 3 files changed, 5 insertions(+), 16 deletions(-) diff --git a/src/domain/UBGraphicsItemDelegate.cpp b/src/domain/UBGraphicsItemDelegate.cpp index e279cfbe..416d9fbe 100644 --- a/src/domain/UBGraphicsItemDelegate.cpp +++ b/src/domain/UBGraphicsItemDelegate.cpp @@ -1190,8 +1190,6 @@ void DelegateMediaControl::positionHandles() mLCDTimerArea.setHeight(parentItem()->boundingRect().height()); lcdTimer->setRect(mLCDTimerArea); lcdTimer->setPos(mSeecArea.width()-mLCDTimerArea.width(),0); - //lcdTimer->setRect(mLCDTimerArea); - //lcdTimer->setPos(mSeecArea.width()-mLCDTimerArea.width(),0); mSeecArea.setWidth(rect().width()-mLCDTimerArea.width()); @@ -1200,8 +1198,6 @@ void DelegateMediaControl::positionHandles() setRect(selfRect); lcdTimer->setPos(rect().width() - mLCDTimerArea.width(), 0); - //lcdTimer->setPos(rect().width() - mLCDTimerArea.width(), 0); - } void DelegateMediaControl::update() @@ -1209,7 +1205,6 @@ void DelegateMediaControl::update() QTime t; t = t.addMSecs(mCurrentTimeInMs < 0 ? 0 : mCurrentTimeInMs); lcdTimer->display(t.toString("m:ss")); - //lcdTimer->display(t.toString("m:ss")); QGraphicsRectItem::update(); } @@ -1262,7 +1257,6 @@ void DelegateMediaControl::seekToMousePos(QPointF mousePos) minX = frameWidth; length = mSeecArea.width() - lcdTimer->rect().width(); - length = mSeecArea.width() /*- lcdTimer->rect().width()*/; qreal mouseX = mousePos.x(); if (mouseX >= (mSeecArea.width() - mSeecArea.height()/2)) diff --git a/src/domain/UBGraphicsItemDelegate.h b/src/domain/UBGraphicsItemDelegate.h index f135f66b..811b26a2 100644 --- a/src/domain/UBGraphicsItemDelegate.h +++ b/src/domain/UBGraphicsItemDelegate.h @@ -284,7 +284,7 @@ class UBGraphicsItemDelegate : public QObject qreal mAntiScaleRatio; QList mButtons; - + QList mToolBarButtons; UBGraphicsToolBarItem* mToolBarItem; protected slots: diff --git a/src/domain/UBGraphicsMediaItemDelegate.cpp b/src/domain/UBGraphicsMediaItemDelegate.cpp index 8411be34..40c93919 100644 --- a/src/domain/UBGraphicsMediaItemDelegate.cpp +++ b/src/domain/UBGraphicsMediaItemDelegate.cpp @@ -94,7 +94,7 @@ void UBGraphicsMediaItemDelegate::buildButtons() connect(mMuteButton, SIGNAL(clicked(bool)), delegated(), SLOT(toggleMute())); connect(mMuteButton, SIGNAL(clicked(bool)), this, SLOT(toggleMute())); // for changing button image - mButtons << mPlayPauseButton << mStopButton << mMuteButton; + mToolBarButtons << mPlayPauseButton << mStopButton << mMuteButton; mToolBarItem->setItemsOnToolBar(QList() << mPlayPauseButton << mStopButton << mMediaControl << mMuteButton); mToolBarItem->setVisibleOnBoard(true); @@ -156,13 +156,10 @@ void UBGraphicsMediaItemDelegate::positionHandles() int toolBarMinimumWidth = 0; int mediaItemWidth = mToolBarItem->boundingRect().width(); - foreach (DelegateButton* button, mButtons) + foreach (DelegateButton* button, mToolBarButtons) { - if (button->getSection() == Qt::TitleBarArea) - { - mediaItemWidth -= button->boundingRect().width() + mToolBarItem->getElementsPadding(); - toolBarMinimumWidth += button->boundingRect().width() + mToolBarItem->getElementsPadding(); - } + mediaItemWidth -= button->boundingRect().width() + mToolBarItem->getElementsPadding(); + toolBarMinimumWidth += button->boundingRect().width() + mToolBarItem->getElementsPadding(); } toolBarMinimumWidth += mToolBarItem->boundingRect().height(); @@ -196,8 +193,6 @@ void UBGraphicsMediaItemDelegate::remove(bool canUndo) QGraphicsScene* scene = mDelegated->scene(); - scene->removeItem(mMediaControl); - UBGraphicsItemDelegate::remove(canUndo); } From fecd1f95c73062bc33efa9bdcd44e5e7674701f4 Mon Sep 17 00:00:00 2001 From: Aleksei Kanash Date: Tue, 14 Aug 2012 15:57:19 +0300 Subject: [PATCH 2/2] Useless comment removed. --- src/domain/UBGraphicsItemDelegate.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/domain/UBGraphicsItemDelegate.cpp b/src/domain/UBGraphicsItemDelegate.cpp index 416d9fbe..fe9abe65 100644 --- a/src/domain/UBGraphicsItemDelegate.cpp +++ b/src/domain/UBGraphicsItemDelegate.cpp @@ -418,7 +418,6 @@ bool UBGraphicsItemDelegate::isLocked() void UBGraphicsItemDelegate::duplicate() { - // TODO UB 4.x .. rewrite .. .this is absurde ... we know what we are duplicating UBApplication::boardController->duplicateItem(dynamic_cast(delegated())); }