From ecee37b67cdf56e0691de6296a7cca0340d56be7 Mon Sep 17 00:00:00 2001 From: "Aaron J. Seigo" Date: Tue, 27 Feb 2007 21:53:12 +0000 Subject: [PATCH] --appletChain.. did this on the wrong system, am committing so i can test on the dev box svn path=/trunk/KDE/kdebase/workspace/plasma/lib/; revision=637812 --- CMakeLists.txt | 1 - applet.cpp | 17 +------ applet.h | 4 -- appletChain.cpp | 133 ------------------------------------------------ appletChain.h | 69 ------------------------- 5 files changed, 2 insertions(+), 222 deletions(-) delete mode 100644 appletChain.cpp delete mode 100644 appletChain.h diff --git a/CMakeLists.txt b/CMakeLists.txt index a670982ea..0da76a22e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,7 +6,6 @@ set(plasma_LIB_SRCS plasma.cpp applet.cpp - appletChain.cpp interface.cpp theme.cpp ) diff --git a/applet.cpp b/applet.cpp index 1630f7a65..f9157547d 100644 --- a/applet.cpp +++ b/applet.cpp @@ -38,8 +38,7 @@ class Applet::Private : id(uniqueID), globalConfig(0), appletConfig(0), - appletDescription(appletDescription), - chain(appletChain) + appletDescription(appletDescription) { } ~Private() @@ -55,16 +54,14 @@ class Applet::Private KSharedConfig::Ptr appletConfig; KService::Ptr appletDescription; QList watchedForFocus; - AppletChain::Ptr chain; QStringList loadedEngines; }; Applet::Applet(QWidget* parent, KService::Ptr appletDescription, - const AppletChain::Ptr chain, int id) : QWidget(parent), - d(new Private(appletDescription, id, chain)) + d(new Private(appletDescription, id)) { } @@ -114,16 +111,6 @@ bool Applet::loadDataEngine(const QString& name) return false; } -const AppletChain::Ptr Applet::chain() const -{ - return d->chain; -} - -void Applet::setChain(const AppletChain::Ptr appletChain) -{ - d->chain = appletChain; -} - void Applet::constraintsUpdated() { } diff --git a/applet.h b/applet.h index 8762f6e79..3ed83db09 100644 --- a/applet.h +++ b/applet.h @@ -39,7 +39,6 @@ class KDE_EXPORT Applet : public QWidget Applet(QWidget* parent, KService::Ptr appletDescription, - const AppletChain::Ptr chain, int id); ~Applet(); @@ -69,9 +68,6 @@ class KDE_EXPORT Applet : public QWidget */ bool loadDataEngine(const QString& name); - const AppletChain::Ptr chain() const; - void setChain(const AppletChain::Ptr); - /** * called when any of the geometry constraints have been updated * this is always called prior to painting and should be used as an diff --git a/appletChain.cpp b/appletChain.cpp deleted file mode 100644 index d717e69a8..000000000 --- a/appletChain.cpp +++ /dev/null @@ -1,133 +0,0 @@ -/* - * Copyright (C) 2005 by Aaron Seigo - * - * 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 -#include - -#include - -#include "applet.h" -#include "appletChain.h" - -#include - -#include -#include - -namespace Plasma -{ - -class AppletChain::Private -{ - public: - Private() - : popupDirection(Up), - constraint(Plasma::NoConstraint), - screen(0), - screenEdge(BottomEdge) - { - } - - - Direction popupDirection; - AppletConstraint constraint; - int screen; - ScreenEdge screenEdge; - Applet::List applets; - - // configuration items kept in the display widget: - // - start coordinates and length for docked chain - // - dimensions for floating chain - // - display order of applets -}; - -AppletChain::AppletChain(QObject* parent) - : QObject(parent), - d(new Private()) -{ -} - -AppletChain::~AppletChain() -{ -} - -Plasma::AppletConstraint AppletChain::constraint() -{ - return d->constraint; -} - -void AppletChain::setConstraint(Plasma::AppletConstraint constraint) -{ - if (d->constraint == constraint) - { - return; - } - - d->constraint = constraint; - - foreach (Applet* applet, d->applets) - { - applet->constraintsUpdated(); - } -} - -void AppletChain::setXineramaScreen(int screen) -{ - if (screen < 0 || screen > qApp->desktop()->numScreens() - 1) - { - kDebug() << "tried to set a bad screen for AppletChain" << endl; - return; - } - - d->screen = screen; -} - -void AppletChain::loadApplet(KService::Ptr) -{ - //TODO: load the buggers from a KService pointer! -} - -void AppletChain::addApplet(Plasma::Applet* applet) -{ - d->applets.append(applet); - emit appletAdded(applet); -} - -int AppletChain::xineramaScreen() -{ - return d->screen; -} - -void AppletChain::setScreenEdge(Plasma::ScreenEdge edge) -{ - d->screenEdge = edge; -} - -Plasma::ScreenEdge AppletChain::screenEdge() -{ - return d->screenEdge; -} - -Plasma::Direction AppletChain::popupDirection() const -{ - return Plasma::edgeToPopupDirection(d->screenEdge); -} - -} // Plasma namespace - -#include "appletChain.moc" diff --git a/appletChain.h b/appletChain.h deleted file mode 100644 index 7bf965b97..000000000 --- a/appletChain.h +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (C) 2005 by Aaron Seigo - * - * 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. - */ - -#ifndef PLASMA_APPLETCHAIN_H -#define PLASMA_APPLETCHAIN_H - -#include - -#include "plasma.h" - -namespace Plasma -{ - -class Applet; - -class KDE_EXPORT AppletChain : public QObject, public KShared -{ - Q_OBJECT - Q_PROPERTY(AppletConstraint constraint READ constraint WRITE setConstraint) - Q_PROPERTY(ScreenEdge screenEdge READ screenEdge WRITE setScreenEdge) - Q_PROPERTY(int XineramaScreen READ screenEdge WRITE setXineramaScreen) - - public: - typedef KSharedPtr Ptr; - - AppletChain(QObject* parent); - ~AppletChain(); - - Plasma::AppletConstraint constraint(); - void setConstraint(Plasma::AppletConstraint constraint); - Plasma::Direction popupDirection() const; - - Plasma::ScreenEdge screenEdge(); - void setScreenEdge(Plasma::ScreenEdge edge); - - int xineramaScreen(); - void setXineramaScreen(int screen); - - public Q_SLOTS: - void loadApplet(KService::Ptr); - void addApplet(Plasma::Applet*); - - Q_SIGNALS: - void appletAdded(Applet*); - void appletRemoved(Applet*); - - private: - class Private; - Private* d; -}; - -} // Plasma namespace - -#endif // multiple inclusion guard