Message info
 
To:kde-commits@kde.org From:Shantanu Tushar Subject:[plasma-mediacenter] /: Remove some more unneeded stuff Date:Sun, 18 Mar 2012 17:03:02 +0100 (CET)
 

Git commit 5d23cd0fe35ae4233bb1dc96eb75a5f5af26cbbb by Shantanu Tushar.
Committed on 18/03/2012 at 17:02.
Pushed by shantanu into branch 'master'.

Remove some more unneeded stuff

CCMAIL: ksinny@gmail.com

M +3 -27 libs/mediacenter/CMakeLists.txt
D +0 -154 libs/mediacenter/widgets/blur.cpp
D +0 -164 libs/mediacenter/widgets/navigationtoolbar.cpp
D +0 -71 libs/mediacenter/widgets/navigationtoolbar.h
D +0 -388 libs/mediacenter/widgets/viewitem.cpp
D +0 -131 libs/mediacenter/widgets/viewitem.h
R +0 -0 old/libs/mediacenter/browser.cpp [from: libs/mediacenter/browser.cpp - 100% similarity]
R +0 -0 old/libs/mediacenter/browser.h [from: libs/mediacenter/browser.h - 100% similarity]
R +0 -0 old/libs/mediacenter/browsergesture.cpp [from: libs/mediacenter/browsergesture.cpp - 100% similarity]
R +0 -0 old/libs/mediacenter/browsergesture.h [from: libs/mediacenter/browsergesture.h - 100% similarity]
R +0 -0 old/libs/mediacenter/gesturerecognizer.cpp [from: libs/mediacenter/gesturerecognizer.cpp - 100% similarity]
R +0 -0 old/libs/mediacenter/gesturerecognizer.h [from: libs/mediacenter/gesturerecognizer.h - 100% similarity]
R +0 -0 old/libs/mediacenter/homeapplet.cpp [from: libs/mediacenter/homeapplet.cpp - 100% similarity]
R +0 -0 old/libs/mediacenter/homeapplet.h [from: libs/mediacenter/homeapplet.h - 100% similarity]
R +0 -0 old/libs/mediacenter/playbackcontrol.cpp [from: libs/mediacenter/playbackcontrol.cpp - 100% similarity]
R +0 -0 old/libs/mediacenter/playbackcontrol.h [from: libs/mediacenter/playbackcontrol.h - 100% similarity]
R +0 -0 old/libs/mediacenter/playbackgesture.cpp [from: libs/mediacenter/playbackgesture.cpp - 100% similarity]
R +0 -0 old/libs/mediacenter/playbackgesture.h [from: libs/mediacenter/playbackgesture.h - 100% similarity]
R +0 -0 old/libs/mediacenter/playlist.cpp [from: libs/mediacenter/playlist.cpp - 100% similarity]
R +0 -0 old/libs/mediacenter/playlist.h [from: libs/mediacenter/playlist.h - 100% similarity]
R +0 -0 old/shells/plasmediacenter/CMakeLists.txt [from: shells/plasmediacenter/CMakeLists.txt - 100% similarity]
R +0 -0 old/shells/plasmediacenter/Messages.sh [from: shells/plasmediacenter/Messages.sh - 100% similarity]
R +0 -0 old/shells/plasmediacenter/backgrounddialog.ui [from: shells/plasmediacenter/backgrounddialog.ui - 100% similarity]
R +0 -0 old/shells/plasmediacenter/main.cpp [from: shells/plasmediacenter/main.cpp - 100% similarity]
R +0 -0 old/shells/plasmediacenter/mainwindow.cpp [from: shells/plasmediacenter/mainwindow.cpp - 100% similarity]
R +0 -0 old/shells/plasmediacenter/mainwindow.h [from: shells/plasmediacenter/mainwindow.h - 100% similarity]
R +0 -0 old/shells/plasmediacenter/theme.ui [from: shells/plasmediacenter/theme.ui - 100% similarity]
M +0 -1 shells/CMakeLists.txt

http://commits.kde.org/plasma-mediacenter/5d23cd0fe35ae4233bb1dc96eb75a5f5af26cbbb

diff --git a/libs/mediacenter/CMakeLists.txt b/libs/mediacenter/CMakeLists.txt
index 6138007..0b3db33 100644
--- a/libs/mediacenter/CMakeLists.txt
+++ b/libs/mediacenter/CMakeLists.txt
@@ -1,18 +1,7 @@
set (mediacenterlibs_SRCS
-gesturerecognizer.cpp
-playbackgesture.cpp
-browsergesture.cpp
-browser.cpp
-playbackcontrol.cpp
-playlist.cpp
-mediacenter.cpp
-abstractbrowsingbackend.cpp
-homeapplet.cpp
-backendsmodel.cpp
-
-# widgets
-widgets/navigationtoolbar.cpp
-widgets/viewitem.cpp
+ mediacenter.cpp
+ abstractbrowsingbackend.cpp
+ backendsmodel.cpp
)

kde4_add_library(mediacenterlibs SHARED ${mediacenterlibs_SRCS})
@@ -22,22 +11,9 @@ install(TARGETS mediacenterlibs ${INSTALL_TARGETS_DEFAULT_ARGS})

set (mediacenterlibs_HDRS
mediacenter.h
- browser.h
- playbackcontrol.h
- playlist.h
- gesturerecognizer.h
- playbackgesture.h
- browsergesture.h
abstractbrowsingbackend.h
- homeapplet.h
backendsmodel.h
)

-set (mediacenterlibs_WIDGETS_HDRS
- widgets/navigationtoolbar.h
- widgets/viewitem.h
-)
-
install(FILES ${mediacenterlibs_HDRS} DESTINATION ${INCLUDE_INSTALL_DIR}/mediacenter COMPONENT Devel)
-install(FILES ${mediacenterlibs_WIDGETS_HDRS} DESTINATION ${INCLUDE_INSTALL_DIR}/mediacenter/widgets COMPONENT Devel)
install(FILES data/servicetypes/pmc_browsingbackend.desktop DESTINATION ${SERVICETYPES_INSTALL_DIR})
diff --git a/libs/mediacenter/widgets/blur.cpp b/libs/mediacenter/widgets/blur.cpp
deleted file mode 100644
index 7135e9c..0000000
--- a/libs/mediacenter/widgets/blur.cpp
+++ /dev/null
@@ -1,154 +0,0 @@
-#ifndef BLUR_CPP
-#define BLUR_CPP
-
-/*
- * Copyright 2007 Jani Huhtanen <jani.huhtanen@tut.fi>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Library General Public License version 2 as
- * published by the Free Software Foundation
- *
- * This program 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 Library General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-#include <cmath>
-
-// Exponential blur, Jani Huhtanen, 2006
-//
-template<int aprec, int zprec>
-static inline void blurinner(unsigned char *bptr, int &zR, int &zG, int &zB, int &zA, int alpha);
-
-template<int aprec,int zprec>
-static inline void blurrow(QImage &im, int line, int alpha);
-
-template<int aprec, int zprec>
-static inline void blurcol(QImage &im, int col, int alpha);
-
-/*
-* expblur(QImage &img, int radius)
-*
-* In-place blur of image 'img' with kernel
-* of approximate radius 'radius'.
-*
-* Blurs with two sided exponential impulse
-* response.
-*
-* aprec = precision of alpha parameter
-* in fixed-point format 0.aprec
-*
-* zprec = precision of state parameters
-* zR,zG,zB and zA in fp format 8.zprec
-*/
-template<int aprec,int zprec>
-void expblur(QImage &img, int radius)
-{
- if (radius < 1) {
- return;
- }
-
- img = img.convertToFormat(QImage::Format_ARGB32_Premultiplied);
-
- /* Calculate the alpha such that 90% of
- the kernel is within the radius.
- (Kernel extends to infinity)
- */
- int alpha = (int)((1 << aprec) * (1.0f - std::exp(-2.3f / (radius + 1.f))));
-
- int height = img.height();
- int width = img.width();
- for (int row=0; row<height; row++) {
- blurrow<aprec,zprec>(img, row, alpha);
- }
-
- for (int col=0; col<width; col++) {
- blurcol<aprec,zprec>(img, col, alpha);
- }
- return;
-}
-
-template<int aprec, int zprec>
-static inline void blurinner(unsigned char *bptr, int &zR, int &zG, int &zB, int &zA, int alpha)
-{
- int R, G, B, A;
- R = *bptr;
- G = *(bptr + 1);
- B = *(bptr + 2);
- A = *(bptr + 3);
-
- zR += (alpha * ((R << zprec) - zR)) >> aprec;
- zG += (alpha * ((G << zprec) - zG)) >> aprec;
- zB += (alpha * ((B << zprec) - zB)) >> aprec;
- zA += (alpha * ((A << zprec) - zA)) >> aprec;
-
- *bptr = zR >> zprec;
- *(bptr+1) = zG >> zprec;
- *(bptr+2) = zB >> zprec;
- *(bptr+3) = zA >> zprec;
-}
-
-template<int aprec,int zprec>
-static inline void blurrow(QImage &im, int line, int alpha)
-{
- int zR, zG, zB, zA;
-
- QRgb *ptr = (QRgb *)im.scanLine(line);
- int width = im.width();
-
- zR = *((unsigned char *)ptr ) << zprec;
- zG = *((unsigned char *)ptr + 1) << zprec;
- zB = *((unsigned char *)ptr + 2) << zprec;
- zA = *((unsigned char *)ptr + 3) << zprec;
-
- for (int index=1; index<width; index++) {
- blurinner<aprec,zprec>((unsigned char *)&ptr[index],zR,zG,zB,zA,alpha);
- }
- for (int index=width-2; index>=0; index--) {
- blurinner<aprec,zprec>((unsigned char *)&ptr[index],zR,zG,zB,zA,alpha);
- }
-}
-
-template<int aprec, int zprec>
-static inline void blurcol(QImage &im, int col, int alpha)
-{
- int zR, zG, zB, zA;
-
- QRgb *ptr = (QRgb *)im.bits();
- ptr += col;
- int height = im.height();
- int width = im.width();
-
- zR = *((unsigned char *)ptr ) << zprec;
- zG = *((unsigned char *)ptr + 1) << zprec;
- zB = *((unsigned char *)ptr + 2) << zprec;
- zA = *((unsigned char *)ptr + 3) << zprec;
-
- for (int index=width; index<(height-1)*width; index+=width) {
- blurinner<aprec,zprec>((unsigned char *)&ptr[index], zR, zG, zB, zA, alpha);
- }
-
- for (int index=(height-2)*width; index>=0; index-=width) {
- blurinner<aprec,zprec>((unsigned char *)&ptr[index], zR, zG, zB, zA, alpha);
- }
-}
-
-template<class T>
-inline const T &qClamp(const T &x, const T &low, const T &high)
-{
- if (x < low) {
- return low;
- } else if (x > high) {
- return high;
- } else {
- return x;
- }
-}
-
-#endif
diff --git a/libs/mediacenter/widgets/navigationtoolbar.cpp b/libs/mediacenter/widgets/navigationtoolbar.cpp
deleted file mode 100644
index e6133a9..0000000
--- a/libs/mediacenter/widgets/navigationtoolbar.cpp
+++ /dev/null
@@ -1,164 +0,0 @@
-/***************************************************************************
- * Copyright 2009 by Alessandro Diaferia <alediaferia@gmail.com> *
- * *
- * This program 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; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program 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 this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . *
- ***************************************************************************/
-#include "navigationtoolbar.h"
-
-// Qt
-#include <QGraphicsLinearLayout>
-// KDE
-#include <KIcon>
-#include <KComboBox>
-#include <KDebug>
-// Plasma
-#include <Plasma/ToolButton>
-#include <Plasma/ComboBox>
-#include <Plasma/TabBar>
-
-using namespace MediaCenter;
-
-class NavigationToolbar::NavigationToolbarPrivate
-{
-public:
- NavigationToolbarPrivate(NavigationToolbar *q) :
- q(q),
- controls(AllControls),
- navigationCombo(false),
- backwardButton(0),
- forwardButton(0),
- upLevelButton(0),
- combo(0)
- {}
-
- NavigationToolbar *q;
- NavigationControls controls;
- bool navigationCombo;
-
- Plasma::ToolButton *backwardButton;
- Plasma::ToolButton *forwardButton;
- Plasma::ToolButton *upLevelButton;
-
- Plasma::ComboBox *combo;
-};
-
-NavigationToolbar::NavigationToolbar(QGraphicsItem *parent) : QGraphicsWidget(parent),
-d(new NavigationToolbarPrivate(this))
-{
- QGraphicsLinearLayout *layout = new QGraphicsLinearLayout(Qt::Horizontal);
- setLayout(layout);
-
- setNavigationControls(BackwardControl);
- setShowNavigationComboBox(false);
-}
-
-NavigationToolbar::~NavigationToolbar()
-{
- delete d;
-}
-
-void NavigationToolbar::setNavigationControls(NavigationControls controls)
-{
- d->controls = controls;
- QGraphicsLinearLayout *layout = static_cast<QGraphicsLinearLayout*>(this->layout());
-
- if (d->backwardButton) {
- layout->removeItem(d->backwardButton);
- }
- if (d->forwardButton) {
- layout->removeItem(d->forwardButton);
- }
- if (d->upLevelButton) {
- layout->removeItem(d->upLevelButton);
- }
-
- if (d->controls == NoControls) {
- kDebug() << "no controls!!";
- if (d->backwardButton) {
- layout->removeItem(d->backwardButton);
- delete d->backwardButton;
- d->backwardButton = 0;
- }
- if (d->forwardButton) {
- layout->removeItem(d->forwardButton);
- delete d->forwardButton;
- d->forwardButton = 0;
- }
- if (d->upLevelButton) {
- layout->removeItem(d->upLevelButton);
- delete d->upLevelButton;
- d->upLevelButton = 0;
- }
- return;
- }
-
- if (d->controls & UpLevelControl) {
- if (!d->upLevelButton) {
- d->upLevelButton = new Plasma::ToolButton(this);
- d->upLevelButton->setIcon(KIcon("go-up"));
- connect (d->upLevelButton, SIGNAL(clicked()), this, SIGNAL(browseUp()));
- }
- layout->insertItem(0, d->upLevelButton);
- }
-
- if (d->controls & ForwardControl) {
- if (!d->forwardButton) {
- d->forwardButton = new Plasma::ToolButton(this);
- d->forwardButton->setIcon(KIcon("go-next"));
- connect (d->forwardButton, SIGNAL(clicked()), this, SIGNAL(browseHistoryNext()));
- }
- layout->insertItem(0, d->forwardButton);
- }
-
- if (d->controls & BackwardControl); /*{
- if (!d->backwardButton) {
- d->backwardButton = new Plasma::ToolButton(this);
- d->backwardButton->setIcon(KIcon("go-previous"));
- connect (d->backwardButton, SIGNAL(clicked()), this, SIGNAL(browseHistoryBack()));
- }
- layout->insertItem(0, d->backwardButton);
- }
-
- setLayout(layout);*/
-}
-
-NavigationToolbar::NavigationControls NavigationToolbar::navigationControls()
-{
- return d->controls;
-}
-
-void NavigationToolbar::setShowNavigationComboBox(bool set)
-{
- if (d->navigationCombo == set) {
- return;
- }
-
- QGraphicsLinearLayout *layout = static_cast<QGraphicsLinearLayout*>(this->layout());
- d->navigationCombo = set;
- if (d->navigationCombo) {
- if (!d->combo) {
- d->combo = new Plasma::ComboBox(this);
- d->combo->nativeWidget()->setEditable(true);
- connect (d->combo->nativeWidget(), SIGNAL(returnPressed(const QString&)), this, SIGNAL(browsePath(const QString&)));
- }
- layout->addItem(d->combo);
- } else {
- layout->removeItem(d->combo);
- delete d->combo;
- d->combo = 0;
- }
- setLayout(layout);
-}
diff --git a/libs/mediacenter/widgets/navigationtoolbar.h b/libs/mediacenter/widgets/navigationtoolbar.h
deleted file mode 100644
index b9de113..0000000
--- a/libs/mediacenter/widgets/navigationtoolbar.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/***************************************************************************
- * Copyright 2009-2010 by Alessandro Diaferia <alediaferia@gmail.com> *
- * *
- * This program 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; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program 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 this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . *
- ***************************************************************************/
-#ifndef NAVIGATIONTOOLBAR_H
-#define NAVIGATIONTOOLBAR_H
-
-#include <QGraphicsWidget>
-#include "mediacenter/mediacenter_export.h"
-
-namespace Plasma {
- class ToolButton;
- class ComboBox;
- class TabBar;
-}
-
-namespace MediaCenter {
-
-class MEDIACENTER_EXPORT NavigationToolbar : public QGraphicsWidget
-{
- Q_OBJECT
-public:
- enum NavigationControl {
- NoControls = 0x0,
- BackwardControl = 0x1,
- ViewModeControl = 0x2,
- ForwardControl = 0x4,
- UpLevelControl = 0x8,
- AllControls = 0x15
- };
- Q_DECLARE_FLAGS(NavigationControls, NavigationControl)
-
- NavigationToolbar(QGraphicsItem *parent);
- ~NavigationToolbar();
-
- void setNavigationControls(NavigationControls controls);
- NavigationControls navigationControls();
-
- void setShowNavigationComboBox(bool set);
- bool showNavigationComboBox();
-
-signals:
- void browsePath(const QString &path);
- void browseHistoryBack();
- void browseHistoryNext();
- void browseUp();
-
-private:
- class NavigationToolbarPrivate;
- NavigationToolbarPrivate *d;
-};
-
-Q_DECLARE_OPERATORS_FOR_FLAGS(NavigationToolbar::NavigationControls)
-
-} // MediaCenter namespace
-
-#endif // BROWSINGWIDGET_H
diff --git a/libs/mediacenter/widgets/viewitem.cpp b/libs/mediacenter/widgets/viewitem.cpp
deleted file mode 100644
index 175ced8..0000000
--- a/libs/mediacenter/widgets/viewitem.cpp
+++ /dev/null
@@ -1,388 +0,0 @@
-/***************************************************************************
- * Copyright 2009 by Alessandro Diaferia <alediaferia@gmail.com> *
- * *
- * This program 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; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program 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 this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . *
- ***************************************************************************/
-#include "viewitem.h"
-#include "blur.cpp"
-
-#include <QAbstractItemModel>
-#include <QAbstractItemDelegate>
-#include <QPainter>
-#include <QVariant>
-#include <QIcon>
-#include <QPixmap>
-#include <QLinearGradient>
-#include <QGraphicsSceneHoverEvent>
-
-#include <KFileItem>
-#include <KDirModel>
-#include <KUrl>
-#include <KIconLoader>
-
-#include <KDebug>
-
-#include <Plasma/FrameSvg>
-#include <Plasma/Theme>
-#include <Plasma/PaintUtils>
-
-using namespace MediaCenter;
-
-static const int ITEM_VERTICAL_MARGIN = 15;
-static const float s_itemSpacing = 0.1; //Factor of the size to be left as the margin/spacing
-
-class ViewItem::ViewItemPrivate
-{
-public:
- ViewItemPrivate(ViewItem *q) : q(q),
- frameSvg(0),
- blurred(true)
- {}
-
- ViewItem *q;
- QStyleOptionViewItemV4 option;
- QModelIndex index;
- Plasma::FrameSvg *frameSvg;
- QPixmap pixmap;
- QPixmap blurredText;
- QPixmap reflection;
- bool blurred;
- QIcon icon;
- QString text;
- int decorationSize;
-};
-
-ViewItem::ViewItem(const QStyleOptionViewItemV4 &option, QGraphicsItem *parent) : QGraphicsWidget(parent),
- d(new ViewItemPrivate(this))
-{
- d->option = option;
- d->decorationSize = d->option.decorationSize.width();
-
- setContentsMargins(0, 0, 0, 0);
-
- d->frameSvg = new Plasma::FrameSvg(this);
- d->frameSvg->setImagePath("widgets/viewitem");
- d->frameSvg->setEnabledBorders(Plasma::FrameSvg::AllBorders);
- d->frameSvg->setCacheAllRenderedFrames(true);
- d->frameSvg->setElementPrefix("hover");
-
- setAcceptedMouseButtons(0);
-
-}
-
-ViewItem::ViewItem(QGraphicsItem *parent) : QGraphicsWidget(parent),
- d(new ViewItemPrivate(this))
-{
- ViewItem(QStyleOptionViewItemV4(), parent);
-
- // this ctor has no way to pass the QStyleOptionViewItemV4
- // we create one with some convenient default values
- d->option.palette.setColor(QPalette::Text, Plasma::Theme::defaultTheme()->color(Plasma::Theme::TextColor));
- d->option.font = Plasma::Theme::defaultTheme()->font(Plasma::Theme::DesktopFont);
- d->option.fontMetrics = QFontMetrics(d->option.font);
- d->option.decorationSize = QSize(KIconLoader::SizeEnormous, KIconLoader::SizeEnormous);
- d->option.locale = QLocale::system();
- d->option.widget = 0;
- d->option.state |= QStyle::State_Enabled;
- d->option.decorationPosition = QStyleOptionViewItem::Top;
- d->option.displayAlignment = Qt::AlignHCenter | Qt::AlignBottom;
-
- d->decorationSize = d->option.decorationSize.width();
-}
-
-ViewItem::~ViewItem()
-{
- delete d;
-}
-
-void ViewItem::setStyleOption(const QStyleOptionViewItemV4 &option)
-{
- d->option = option;
-}
-
-QStyleOptionViewItemV4 ViewItem::styleOption() const
-{
- return d->option;
-}
-
-void ViewItem::setModelIndex(const QModelIndex &index)
-{
- if (d->index == index) {
- return;
- }
-
- d->blurredText = QPixmap();
- d->index = index;
-
- d->text = d->index.data().toString();
- d->icon = d->index.data(Qt::DecorationRole).value<QIcon>();
-}
-
-QModelIndex ViewItem::modelIndex() const
-{
- return d->index;
-}
-
-void ViewItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
-{
- Q_UNUSED(widget)
-
- if (d->option.state & QStyle::State_MouseOver || d->option.state & QStyle::State_Selected) {
- if (d->frameSvg->size() != option->rect.size()) {
- d->frameSvg->resizeFrame(option->rect.size());
- }
- d->frameSvg->paintFrame(painter, option->rect.topLeft());
- }
-
- QRect textRect;
- QRect decorationRect;
- QRect reflectionRect;
-
- const int decorationSize = d->decorationSize;
- const int reflectionHeight = decorationSize * 0.33;
-
- decorationRect.setSize(QSize(decorationSize, decorationSize));
- reflectionRect.setSize(QSize(decorationSize, reflectionHeight));
-
- if (d->option.decorationPosition == QStyleOptionViewItem::Left) {
- const int x = (option->rect.height() - decorationSize) / 2;
- const int y = (option->rect.height() - decorationSize - reflectionHeight) / 2;
- decorationRect.moveTo(x, y);
-
- reflectionRect.moveTo(decorationRect.bottomLeft());
-
- textRect.setSize(QSize(option->rect.width() - option->rect.height(), option->rect.height()));
- textRect.moveTo(option->rect.height(), 0);
-
- } else if (d->option.decorationPosition == QStyleOptionViewItem::Top) {
- textRect.setSize(textRectSize());
-
- const int x = (option->rect.width() - decorationSize) / 2;
- const int y = (option->rect.height() - decorationSize - reflectionHeight - textRect.height());
- decorationRect.moveTo(x, y);
-
- reflectionRect.moveTo(decorationRect.bottomLeft());
-
- textRect.moveTo(reflectionRect.bottomLeft());
- }
-
- if (!d->pixmap.isNull()) {
- QRect pixmapRect;
- pixmapRect.setSize(d->pixmap.size());
- pixmapRect.moveCenter(decorationRect.center());
- painter->drawPixmap(pixmapRect.topLeft(), d->pixmap);
- reflectionRect.moveTo(pixmapRect.left(), pixmapRect.bottom());
- reflectionRect.setWidth(pixmapRect.width());
- drawReflection(painter, reflectionRect, d->pixmap);
-
- if (d->option.decorationPosition == QStyleOptionViewItem::Left) {
- textRect.moveTo(decorationRect.right(), (decorationRect.top()+reflectionRect.bottom())/2);
- } else if (d->option.decorationPosition == QStyleOptionViewItem::Top) {
- textRect.moveTo(reflectionRect.bottomLeft());
- }
- } else {
- QIcon icon = d->icon;
- if (!icon.isNull()) {
- icon.paint(painter, decorationRect);
- drawReflection(painter, reflectionRect, icon);
- } // else no icon is set
- }
-
- painter->setFont(d->option.font);
- painter->setPen(Plasma::Theme::defaultTheme()->color(Plasma::Theme::TextColor));
- QString text = d->text;
- if (d->option.fontMetrics.width(text) > textRect.width()) {
- text = d->option.fontMetrics.elidedText(text, Qt::ElideMiddle, textRect.width());
- }
-
- if (d->blurred) {
- if (d->blurredText.isNull()) {
- QColor textColor = Plasma::Theme::defaultTheme()->color(Plasma::Theme::TextColor);
- QColor shadowColor = Plasma::Theme::defaultTheme()->color(Plasma::Theme::BackgroundColor);
- if (textColor.black() > 210) {
- textColor = shadowColor;
- shadowColor = Plasma::Theme::defaultTheme()->color(Plasma::Theme::TextColor);
- }
-
- d->blurredText = Plasma::PaintUtils::shadowText(text, d->option.font, textColor, shadowColor);
- }
-
- QPointF txtPoint;
- if (d->option.displayAlignment & Qt::AlignLeft) {
- txtPoint.setX(textRect.x());
- }
- if (d->option.displayAlignment & Qt::AlignHCenter) {
- txtPoint.setX((textRect.width() - d->blurredText.width()) / 2);
- }
- if (d->option.displayAlignment & Qt::AlignVCenter) {
- txtPoint.setY((textRect.height() - d->blurredText.height()) / 2);
- }
- if (d->option.displayAlignment & Qt::AlignBottom) {
- txtPoint.setY(option->rect.height() - d->blurredText.height());
- }
-
- painter->drawPixmap(txtPoint, d->blurredText);
- } else {
- painter->drawText(textRect, d->option.displayAlignment, text);
- }
-}
-
-void ViewItem::drawReflection(QPainter *painter, const QRect &reflectionRect, const QIcon &icon)
-{
- drawReflection(painter, reflectionRect, icon.pixmap(d->option.decorationSize));
-}
-
-void ViewItem::drawReflection(QPainter *painter, const QRect &reflectionRect, const QPixmap &pm)
-{
- if (!d->reflection.isNull()) {
- painter->drawPixmap(reflectionRect, d->reflection);
- return;
- }
-
- const int decorationWidth = d->option.decorationSize.width();
- const int decorationHeight = decorationWidth;
-
- d->reflection = QPixmap(reflectionRect.width(), reflectionRect.height());
- kDebug() << "reflection size" << d->reflection.size();
- d->reflection.fill(Qt::transparent);
-
- QLinearGradient grad(reflectionRect.width() / 2, 0, reflectionRect.width() / 2, reflectionRect.height());
- grad.setColorAt(0, Qt::black);
- grad.setColorAt(1, Qt::transparent);
-
- QPainter p(&d->reflection);
- p.fillRect(0, 0, reflectionRect.width(), reflectionRect.height(), grad);
- p.scale(1, -1);
- p.setCompositionMode(QPainter::CompositionMode_SourceIn);
-
- p.setOpacity(0.7);
- p.drawPixmap(QRect(0, -reflectionRect.height(), reflectionRect.width(), reflectionRect.height()),
- pm,
- QRect(0, pm.height() - reflectionRect.height(), reflectionRect.width(), reflectionRect.height()));
- p.end();
-
- // here we add the blur to the reflection
- QImage img = d->reflection.toImage();
- expblur<5,5>(img, 5);
- d->reflection = QPixmap::fromImage(img);
-
- painter->drawPixmap(reflectionRect, d->reflection);
-}
-
-QSize ViewItem::itemSizeHint() const
-{
- if (!d->index.isValid()) {
- return QSize(0, 0);
- }
-
- if (d->option.decorationPosition == QStyleOptionViewItem::Left) {
- int decorationHeight = d->option.decorationSize.height() * (1 + 2*s_itemSpacing);
- int height = qMax(decorationHeight, d->option.fontMetrics.height());
- int width = d->option.decorationSize.width() + d->option.fontMetrics.width(d->text);
-
- return QSize(width, height);
- }
-
- if (d->option.decorationPosition == QStyleOptionViewItem::Top) {
- int width = d->option.decorationSize.width();
- int height = d->option.decorationSize.width();
- int reflectionHeight = height * 0.33;
- height += reflectionHeight + textRectSize().height();
-
- height += s_itemSpacing*height;
- width += s_itemSpacing*width;
- return QSize(width, height); //Spacing between items
- }
-
- return QSize(0, 0);
-
-}
-
-QSize ViewItem::textRectSize() const
-{
- if (d->option.decorationPosition == QStyleOptionViewItem::Top) {
- const int width = contentsRect().width();
- const int height = d->option.decorationSize.width() * 1.7;
- QRect textRect(0, 0, width, width - height);
- QRect bounding = d->option.fontMetrics.boundingRect(textRect, d->option.decorationAlignment, d->text);
- bounding.setWidth(width);
-
- return bounding.size();
- }
-
- return QSize();
-}
-
-void ViewItem::setDrawBlurredText(bool set)
-{
- if (set == d->blurred) {
- return;
- }
-
- d->blurred = set;
- update();
-}
-
-bool ViewItem::drawBlurredText()
-{
- return d->blurred;
-}
-
-void ViewItem::keyPressEvent(QKeyEvent *event)
-{
- event->ignore();
-}
-
-void ViewItem::setIcon(const QIcon &icon)
-{
- d->icon = icon;
-}
-
-QIcon ViewItem::icon() const
-{
- return d->icon;
-}
-
-void ViewItem::setText(const QString &text)
-{
- d->text = text;
-}
-
-QString ViewItem::text() const
-{
- return d->text;
-}
-
-void ViewItem::setDecorationSize(int size)
-{
- d->decorationSize = size;
-}
-
-int ViewItem::decorationSize() const
-{
- return d->decorationSize;
-}
-
-void ViewItem::setPixmap(const QPixmap &pixmap)
-{
- d->pixmap = pixmap;
- d->reflection = QPixmap();
-}
-
-QPixmap ViewItem::pixmap() const
-{
- return d->pixmap;
-}
diff --git a/libs/mediacenter/widgets/viewitem.h b/libs/mediacenter/widgets/viewitem.h
deleted file mode 100644
index e27797e..0000000
--- a/libs/mediacenter/widgets/viewitem.h
+++ /dev/null
@@ -1,131 +0,0 @@
-/***************************************************************************
- * Copyright 2009 by Alessandro Diaferia <alediaferia@gmail.com> *
- * *
- * This program 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; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program 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 this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . *
- ***************************************************************************/
-
-#ifndef VIEWITEM_H
-#define VIEWITEM_H
-
-#include <QGraphicsWidget>
-#include <QStyleOptionViewItemV4>
-#include <QModelIndex>
-
-#include "mediacenter/mediacenter_export.h"
-
-namespace Plasma {
- class FrameSvg;
-}
-
-class QPixmap;
-
-namespace MediaCenter {
-
-class MEDIACENTER_EXPORT ViewItem : public QGraphicsWidget
-{
- Q_OBJECT
-
- Q_PROPERTY(QIcon icon READ icon WRITE setIcon);
- Q_PROPERTY(QPixmap pixmap READ pixmap WRITE setPixmap);
- Q_PROPERTY(QString text READ text WRITE setText);
- Q_PROPERTY(int decorationSize READ decorationSize WRITE setDecorationSize);
- Q_PROPERTY(QModelIndex modelIndex READ modelIndex WRITE setModelIndex);
- Q_PROPERTY(QSize itemSizeHint READ itemSizeHint);
-public:
- /**
- * Each ViewItem must be created passing the option object
- * describing its appearance constraints.
- */
- ViewItem(QGraphicsItem *parent = 0);
- ViewItem(const QStyleOptionViewItemV4 &option, QGraphicsItem *parent = 0);
- ~ViewItem();
-
- virtual void setStyleOption(const QStyleOptionViewItemV4 &);
- QStyleOptionViewItemV4 styleOption() const;
-
- virtual void setModelIndex(const QModelIndex &index);
- QModelIndex modelIndex() const;
-
- virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
-
- QSize itemSizeHint() const;
-
- virtual void setDrawBlurredText(bool set);
- bool drawBlurredText();
-
- /**
- * @return the icon set with the setIcon function or a
- * null icon if none was set.
- */
- QIcon icon() const;
-
- QPixmap pixmap() const;
-
- /**
- * Overrides the text passed through the option parameter
- * in the paint method with the @param text
- * @note This is particularly useful when accessing
- * the icon through the property system.
- */
- void setText(const QString &text);
-
- /**
- * @return the text set with the setText function
- */
- QString text() const;
-
- /**
- * Sets the decoration size for the item. If setStyleOption is called
- * after this method the decorationSize specified in the given @param option
- * will override this setting and vice versa.
- */
- void setDecorationSize(int size);
-
- /**
- * @return the currently used decoration size.
- */
- int decorationSize() const;
-
-public slots:
- void setPixmap(const QPixmap &pixmap);
-
- /**
- * This method allows setting a custom icon to be shown
- * in place of the one passed by the index as
- * parameter of the paint function.
- * @note This is particularly useful when accessing
- * the icon through the property system.
- */
- void setIcon(const QIcon &icon);
-
-protected:
- virtual void keyPressEvent(QKeyEvent *event);
-
-private:
- class ViewItemPrivate;
- ViewItemPrivate *d;
-
-private:
- void drawReflection(QPainter *painter, const QRect &reflectionRect, const QIcon &icon);
- void drawReflection(QPainter *painter, const QRect &reflectionRect, const QPixmap &pm);
-
- QSize textRectSize() const;
-
-};
-
-} // namespace MediaCenter
-
-#endif // VIEWITEM_H
diff --git a/libs/mediacenter/browser.cpp b/old/libs/mediacenter/browser.cpp
similarity index 100%
rename from libs/mediacenter/browser.cpp
rename to old/libs/mediacenter/browser.cpp
diff --git a/libs/mediacenter/browser.h b/old/libs/mediacenter/browser.h
similarity index 100%
rename from libs/mediacenter/browser.h
rename to old/libs/mediacenter/browser.h
diff --git a/libs/mediacenter/browsergesture.cpp b/old/libs/mediacenter/browsergesture.cpp
similarity index 100%
rename from libs/mediacenter/browsergesture.cpp
rename to old/libs/mediacenter/browsergesture.cpp
diff --git a/libs/mediacenter/browsergesture.h b/old/libs/mediacenter/browsergesture.h
similarity index 100%
rename from libs/mediacenter/browsergesture.h
rename to old/libs/mediacenter/browsergesture.h
diff --git a/libs/mediacenter/gesturerecognizer.cpp b/old/libs/mediacenter/gesturerecognizer.cpp
similarity index 100%
rename from libs/mediacenter/gesturerecognizer.cpp
rename to old/libs/mediacenter/gesturerecognizer.cpp
diff --git a/libs/mediacenter/gesturerecognizer.h b/old/libs/mediacenter/gesturerecognizer.h
similarity index 100%
rename from libs/mediacenter/gesturerecognizer.h
rename to old/libs/mediacenter/gesturerecognizer.h
diff --git a/libs/mediacenter/homeapplet.cpp b/old/libs/mediacenter/homeapplet.cpp
similarity index 100%
rename from libs/mediacenter/homeapplet.cpp
rename to old/libs/mediacenter/homeapplet.cpp
diff --git a/libs/mediacenter/homeapplet.h b/old/libs/mediacenter/homeapplet.h
similarity index 100%
rename from libs/mediacenter/homeapplet.h
rename to old/libs/mediacenter/homeapplet.h
diff --git a/libs/mediacenter/playbackcontrol.cpp b/old/libs/mediacenter/playbackcontrol.cpp
similarity index 100%
rename from libs/mediacenter/playbackcontrol.cpp
rename to old/libs/mediacenter/playbackcontrol.cpp
diff --git a/libs/mediacenter/playbackcontrol.h b/old/libs/mediacenter/playbackcontrol.h
similarity index 100%
rename from libs/mediacenter/playbackcontrol.h
rename to old/libs/mediacenter/playbackcontrol.h
diff --git a/libs/mediacenter/playbackgesture.cpp b/old/libs/mediacenter/playbackgesture.cpp
similarity index 100%
rename from libs/mediacenter/playbackgesture.cpp
rename to old/libs/mediacenter/playbackgesture.cpp
diff --git a/libs/mediacenter/playbackgesture.h b/old/libs/mediacenter/playbackgesture.h
similarity index 100%
rename from libs/mediacenter/playbackgesture.h
rename to old/libs/mediacenter/playbackgesture.h
diff --git a/libs/mediacenter/playlist.cpp b/old/libs/mediacenter/playlist.cpp
similarity index 100%
rename from libs/mediacenter/playlist.cpp
rename to old/libs/mediacenter/playlist.cpp
diff --git a/libs/mediacenter/playlist.h b/old/libs/mediacenter/playlist.h
similarity index 100%
rename from libs/mediacenter/playlist.h
rename to old/libs/mediacenter/playlist.h
diff --git a/shells/plasmediacenter/CMakeLists.txt b/old/shells/plasmediacenter/CMakeLists.txt
similarity index 100%
rename from shells/plasmediacenter/CMakeLists.txt
rename to old/shells/plasmediacenter/CMakeLists.txt
diff --git a/shells/plasmediacenter/Messages.sh b/old/shells/plasmediacenter/Messages.sh
similarity index 100%
rename from shells/plasmediacenter/Messages.sh
rename to old/shells/plasmediacenter/Messages.sh
diff --git a/shells/plasmediacenter/backgrounddialog.ui b/old/shells/plasmediacenter/backgrounddialog.ui
similarity index 100%
rename from shells/plasmediacenter/backgrounddialog.ui
rename to old/shells/plasmediacenter/backgrounddialog.ui
diff --git a/shells/plasmediacenter/main.cpp b/old/shells/plasmediacenter/main.cpp
similarity index 100%
rename from shells/plasmediacenter/main.cpp
rename to old/shells/plasmediacenter/main.cpp
diff --git a/shells/plasmediacenter/mainwindow.cpp b/old/shells/plasmediacenter/mainwindow.cpp
similarity index 100%
rename from shells/plasmediacenter/mainwindow.cpp
rename to old/shells/plasmediacenter/mainwindow.cpp
diff --git a/shells/plasmediacenter/mainwindow.h b/old/shells/plasmediacenter/mainwindow.h
similarity index 100%
rename from shells/plasmediacenter/mainwindow.h
rename to old/shells/plasmediacenter/mainwindow.h
diff --git a/shells/plasmediacenter/theme.ui b/old/shells/plasmediacenter/theme.ui
similarity index 100%
rename from shells/plasmediacenter/theme.ui
rename to old/shells/plasmediacenter/theme.ui
diff --git a/shells/CMakeLists.txt b/shells/CMakeLists.txt
index 9f2a35b..5e61451 100644
--- a/shells/CMakeLists.txt
+++ b/shells/CMakeLists.txt
@@ -1,2 +1 @@
add_subdirectory(newshell)
-add_subdirectory(plasmediacenter)