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:
parent
af043ca588
commit
51a0162fae
25
applet.cpp
25
applet.cpp
@ -95,6 +95,17 @@ public:
|
|||||||
delete package;
|
delete package;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void init(Applet* applet)
|
||||||
|
{
|
||||||
|
if (!appletDescription) {
|
||||||
|
applet->setFailedToLaunch(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
applet->setImmutable(applet->globalConfig().isImmutable() ||
|
||||||
|
applet->config().isImmutable());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
static uint nextId()
|
static uint nextId()
|
||||||
{
|
{
|
||||||
++s_maxAppletId;
|
++s_maxAppletId;
|
||||||
@ -127,7 +138,7 @@ Applet::Applet(QGraphicsItem *parent,
|
|||||||
Widget(parent),
|
Widget(parent),
|
||||||
d(new Private(KService::serviceByStorageId(serviceID), appletId))
|
d(new Private(KService::serviceByStorageId(serviceID), appletId))
|
||||||
{
|
{
|
||||||
init();
|
d->init(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
Applet::Applet(QObject* parent, const QStringList& args)
|
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()),
|
d(new Private(KService::serviceByStorageId(args.count() > 0 ? args[0] : QString()),
|
||||||
args.count() > 1 ? args[1].toInt() : 0))
|
args.count() > 1 ? args[1].toInt() : 0))
|
||||||
{
|
{
|
||||||
init();
|
d->init(this);
|
||||||
// the brain damage seen in the initialization list is due to the
|
// the brain damage seen in the initialization list is due to the
|
||||||
// inflexibility of KService::createInstance
|
// inflexibility of KService::createInstance
|
||||||
}
|
}
|
||||||
@ -147,16 +158,6 @@ Applet::~Applet()
|
|||||||
delete d;
|
delete d;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Applet::init()
|
|
||||||
{
|
|
||||||
if (!d->appletDescription) {
|
|
||||||
setFailedToLaunch(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
setImmutable(globalConfig().isImmutable() ||
|
|
||||||
config().isImmutable());
|
|
||||||
}
|
|
||||||
|
|
||||||
KConfigGroup Applet::config() const
|
KConfigGroup Applet::config() const
|
||||||
{
|
{
|
||||||
if (!d->appletConfig) {
|
if (!d->appletConfig) {
|
||||||
|
15
applet.h
15
applet.h
@ -324,9 +324,16 @@ class PLASMA_EXPORT Applet : public QObject, public Widget
|
|||||||
**/
|
**/
|
||||||
void setFailedToLaunch(bool failed, const QString& reason = QString());
|
void setFailedToLaunch(bool failed, const QString& reason = QString());
|
||||||
|
|
||||||
// Reimplemented from QGraphicsItem
|
|
||||||
enum { Type = Plasma::AppletType };
|
enum { Type = Plasma::AppletType };
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reimplemented from QGraphicsItem
|
||||||
|
**/
|
||||||
int type() const { return Type; }
|
int type() const { return Type; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reimplemented from QGraphicsItem
|
||||||
|
**/
|
||||||
QRectF boundingRect () const;
|
QRectF boundingRect () const;
|
||||||
|
|
||||||
Q_SIGNALS:
|
Q_SIGNALS:
|
||||||
@ -401,11 +408,11 @@ class PLASMA_EXPORT Applet : public QObject, public Widget
|
|||||||
private:
|
private:
|
||||||
Q_DISABLE_COPY(Applet)
|
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);
|
||||||
|
|
||||||
void init();
|
|
||||||
|
|
||||||
class Private;
|
class Private;
|
||||||
Private* const d;
|
Private* const d;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user