removed unsed code

preferencesAboutTextFull
Claudio Valerio 12 years ago
parent b3c94fd3d0
commit dad668683f
  1. 22
      src/domain/UBGraphicsAudioItem.h
  2. 34
      src/domain/UBGraphicsMediaItem.cpp
  3. 1
      src/domain/UBGraphicsMediaItem.h
  4. 20
      src/domain/UBGraphicsMediaItemDelegate.cpp

@ -1,22 +0,0 @@
/*
* Copyright (C) 2012 Webdoc SA
*
* This file is part of Open-Sankoré.
*
* Open-Sankoré is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3 of the License,
* with a specific linking exception for the OpenSSL project's
* "OpenSSL" library (or with modified versions of it that use the
* same license as the "OpenSSL" library).
*
* Open-Sankoré is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Open-Sankoré. If not, see <http://www.gnu.org/licenses/>.
*/

@ -35,7 +35,6 @@
UBAudioPresentationWidget::UBAudioPresentationWidget(QWidget *parent)
: QWidget(parent)
, mBorderSize(10)
, mTitleSize(10)
{
}
@ -44,7 +43,7 @@ void UBAudioPresentationWidget::paintEvent(QPaintEvent *event)
{
QPainter painter(this);
painter.fillRect(rect(), QBrush(Qt::white));
QPen borderPen;
borderPen.setWidth(2);
borderPen.setColor(QColor(Qt::black));
@ -52,16 +51,6 @@ void UBAudioPresentationWidget::paintEvent(QPaintEvent *event)
painter.setPen(borderPen);
painter.drawRect(0,0, width(), height());
if (QString() != mTitle)
{
painter.setPen(QPen(Qt::black));
QRect titleRect = rect();
titleRect.setX(mBorderSize);
titleRect.setY(2);
titleRect.setHeight(15);
painter.drawText(titleRect, mTitle);
}
QWidget::paintEvent(event);
}
@ -112,9 +101,7 @@ UBGraphicsMediaItem::UBGraphicsMediaItem(const QUrl& pMediaFileUrl, QGraphicsIte
int borderSize = 0;
UBAudioPresentationWidget* pAudioWidget = dynamic_cast<UBAudioPresentationWidget*>(mAudioWidget);
if (pAudioWidget)
{
borderSize = pAudioWidget->borderSize();
}
mAudioWidget->resize(320,26+2*borderSize); //3*border size with enabled title
mAudioWidget->setMinimumSize(150,26+borderSize);
@ -166,26 +153,19 @@ QVariant UBGraphicsMediaItem::itemChange(GraphicsItemChange change, const QVaria
|| (change == QGraphicsItem::ItemVisibleChange))
{
if (mMediaObject && (!isEnabled() || !isVisible() || !scene()))
{
mMediaObject->pause();
}
}
else if (change == QGraphicsItem::ItemSceneHasChanged)
{
if (!scene())
{
mMediaObject->stop();
}
else
{
else {
QString absoluteMediaFilename;
if(mMediaFileUrl.toLocalFile().startsWith("audios/") || mMediaFileUrl.toLocalFile().startsWith("videos/")){
if(mMediaFileUrl.toLocalFile().startsWith("audios/") || mMediaFileUrl.toLocalFile().startsWith("videos/"))
absoluteMediaFilename = scene()->document()->persistencePath() + "/" + mMediaFileUrl.toLocalFile();
}
else{
else
absoluteMediaFilename = mMediaFileUrl.toLocalFile();
}
if (absoluteMediaFilename.length() > 0)
mMediaObject->setCurrentSource(Phonon::MediaSource(absoluteMediaFilename));
@ -199,12 +179,6 @@ QVariant UBGraphicsMediaItem::itemChange(GraphicsItemChange change, const QVaria
void UBGraphicsMediaItem::setSourceUrl(const QUrl &pSourceUrl)
{
UBAudioPresentationWidget* pAudioWidget = dynamic_cast<UBAudioPresentationWidget*>(mAudioWidget);
if (pAudioWidget)
{
pAudioWidget->setTitle(UBFileSystemUtils::lastPathComponent(pSourceUrl.toString()));
}
UBItem::setSourceUrl(pSourceUrl);
}

@ -45,7 +45,6 @@ private:
virtual void paintEvent(QPaintEvent *event);
int mBorderSize;
int mTitleSize;
QString mTitle;
};

@ -60,10 +60,9 @@ UBGraphicsMediaItemDelegate::UBGraphicsMediaItemDelegate(UBGraphicsMediaItem* pD
connect(mToolBarShowTimer, SIGNAL(timeout()), this, SLOT(hideToolBar()));
mToolBarShowTimer->setInterval(m_iToolBarShowingInterval);
}
if (delegated()->isMuted())
{
delegated()->setMute(true);
}
//Wrapper function. Use it to set correct data() to QGraphicsItem as well
setFlippable(false);
@ -97,13 +96,13 @@ void UBGraphicsMediaItemDelegate::buildButtons()
mMediaControl = new DelegateMediaControl(delegated(), mToolBarItem);
mMediaControl->setFlag(QGraphicsItem::ItemIsSelectable, true);
UBGraphicsItem::assignZValue(mMediaControl, delegated()->zValue());
if (delegated()->isMuted())
mMuteButton = new DelegateButton(":/images/soundOff.svg", mDelegated, mToolBarItem, Qt::TitleBarArea);
else
mMuteButton = new DelegateButton(":/images/soundOn.svg", mDelegated, mToolBarItem, Qt::TitleBarArea);
connect(mMuteButton, SIGNAL(clicked(bool)), delegated(), SLOT(toggleMute()));
connect(mMuteButton, SIGNAL(clicked(bool)), delegated(), SLOT(toggleMute()));
connect(mMuteButton, SIGNAL(clicked(bool)), this, SLOT(toggleMute())); // for changing button image
mToolBarButtons << mPlayPauseButton << mStopButton << mMuteButton;
@ -145,7 +144,7 @@ void UBGraphicsMediaItemDelegate::positionHandles()
{
QRectF toolBarRect = mToolBarItem->rect();
if (mediaItem->getMediaType() == UBGraphicsMediaItem::mediaType_Video)
{
{
mToolBarItem->setPos(0, delegated()->boundingRect().height()-mToolBarItem->rect().height());
toolBarRect.setWidth(delegated()->boundingRect().width());
@ -186,15 +185,10 @@ void UBGraphicsMediaItemDelegate::positionHandles()
mMediaControl->setRect(mediaItemRect);
mToolBarItem->positionHandles();
mMediaControl->positionHandles();
mMediaControl->positionHandles();
if (mediaItem)
{
if (mediaItem->getMediaType() == UBGraphicsMediaItem::mediaType_Audio)
{
mToolBarItem->show();
}
}
if (mediaItem && mediaItem->getMediaType() == UBGraphicsMediaItem::mediaType_Audio)
mToolBarItem->show();
}
void UBGraphicsMediaItemDelegate::remove(bool canUndo)

Loading…
Cancel
Save