removed unsed code

preferencesAboutTextFull
Claudio Valerio 12 years ago
parent b3c94fd3d0
commit dad668683f
  1. 22
      src/domain/UBGraphicsAudioItem.h
  2. 32
      src/domain/UBGraphicsMediaItem.cpp
  3. 1
      src/domain/UBGraphicsMediaItem.h
  4. 10
      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)
{
}
@ -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);
@ -188,14 +187,9 @@ void UBGraphicsMediaItemDelegate::positionHandles()
mToolBarItem->positionHandles();
mMediaControl->positionHandles();
if (mediaItem)
{
if (mediaItem->getMediaType() == UBGraphicsMediaItem::mediaType_Audio)
{
if (mediaItem && mediaItem->getMediaType() == UBGraphicsMediaItem::mediaType_Audio)
mToolBarItem->show();
}
}
}
void UBGraphicsMediaItemDelegate::remove(bool canUndo)
{

Loading…
Cancel
Save