* disable copying of Applet due to dptr-but-no-copy-ctor

* provide an accessor to the Package object.
* some const corrections

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=690105
This commit is contained in:
Aaron J. Seigo 2007-07-20 03:34:20 +00:00
parent 44fe05f668
commit 8c8504964e
2 changed files with 18 additions and 2 deletions

View File

@ -186,7 +186,7 @@ KConfigGroup Applet::globalConfig() const
return KConfigGroup(d->globalConfig, "General"); return KConfigGroup(d->globalConfig, "General");
} }
DataEngine* Applet::dataEngine(const QString& name) DataEngine* Applet::dataEngine(const QString& name) const
{ {
int index = d->loadedEngines.indexOf(name); int index = d->loadedEngines.indexOf(name);
if (index != -1) { if (index != -1) {
@ -201,6 +201,11 @@ DataEngine* Applet::dataEngine(const QString& name)
return engine; return engine;
} }
const Package* Applet::package() const
{
return d->package;
}
void Applet::constraintsUpdated() void Applet::constraintsUpdated()
{ {
kDebug() << "Applet::constraintsUpdate(): constraints are FormFactor: " << formFactor() << ", Location: " << location() << endl; kDebug() << "Applet::constraintsUpdate(): constraints are FormFactor: " << formFactor() << ", Location: " << location() << endl;

View File

@ -33,6 +33,7 @@ namespace Plasma
{ {
class DataEngine; class DataEngine;
class Package;
/** /**
* @short The base Applet (Plasmoid) class * @short The base Applet (Plasmoid) class
@ -116,7 +117,15 @@ class PLASMA_EXPORT Applet : public QObject, public Widget
* or an invalid data engine if the requested engine * or an invalid data engine if the requested engine
* could not be loaded * could not be loaded
*/ */
DataEngine* dataEngine(const QString& name); DataEngine* dataEngine(const QString& name) const;
/**
* Accessor for the associated Package object if any.
* Generally, only Plasmoids come in a Package.
*
* @return the Package object, or 0 if none
**/
const Package* package() const;
/** /**
* Called when any of the geometry constraints have been updated. * Called when any of the geometry constraints have been updated.
@ -390,6 +399,8 @@ class PLASMA_EXPORT Applet : public QObject, public Widget
bool eventFilter( QObject *o, QEvent *e ); bool eventFilter( QObject *o, QEvent *e );
private: private:
Q_DISABLE_COPY(Applet)
// Reimplemented from QGraphicsItem // Reimplemented from QGraphicsItem
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0); void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);