started on docu fixes from ebn until i realized that the line numbers are all messed up in the apidox tests and so moved on

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=690174
This commit is contained in:
Aaron J. Seigo 2007-07-20 08:12:20 +00:00
parent af043ca588
commit 51a0162fae
2 changed files with 24 additions and 16 deletions

View File

@ -95,6 +95,17 @@ public:
delete package;
}
void init(Applet* applet)
{
if (!appletDescription) {
applet->setFailedToLaunch(true);
}
applet->setImmutable(applet->globalConfig().isImmutable() ||
applet->config().isImmutable());
}
static uint nextId()
{
++s_maxAppletId;
@ -127,7 +138,7 @@ Applet::Applet(QGraphicsItem *parent,
Widget(parent),
d(new Private(KService::serviceByStorageId(serviceID), appletId))
{
init();
d->init(this);
}
Applet::Applet(QObject* parent, const QStringList& args)
@ -136,7 +147,7 @@ Applet::Applet(QObject* parent, const QStringList& args)
d(new Private(KService::serviceByStorageId(args.count() > 0 ? args[0] : QString()),
args.count() > 1 ? args[1].toInt() : 0))
{
init();
d->init(this);
// the brain damage seen in the initialization list is due to the
// inflexibility of KService::createInstance
}
@ -147,16 +158,6 @@ Applet::~Applet()
delete d;
}
void Applet::init()
{
if (!d->appletDescription) {
setFailedToLaunch(true);
}
setImmutable(globalConfig().isImmutable() ||
config().isImmutable());
}
KConfigGroup Applet::config() const
{
if (!d->appletConfig) {

View File

@ -324,9 +324,16 @@ class PLASMA_EXPORT Applet : public QObject, public Widget
**/
void setFailedToLaunch(bool failed, const QString& reason = QString());
// Reimplemented from QGraphicsItem
enum { Type = Plasma::AppletType };
/**
* Reimplemented from QGraphicsItem
**/
int type() const { return Type; }
/**
* Reimplemented from QGraphicsItem
**/
QRectF boundingRect () const;
Q_SIGNALS:
@ -401,11 +408,11 @@ class PLASMA_EXPORT Applet : public QObject, public Widget
private:
Q_DISABLE_COPY(Applet)
// Reimplemented from QGraphicsItem
/**
* Reimplemented from QGraphicsItem
**/
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
void init();
class Private;
Private* const d;
};