first batch of small coding style fixes.
these were found while testing the Krazy style checker, which I'm adapting for the kdelibs style. svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=870051
This commit is contained in:
parent
d96cc1d739
commit
e88e2faa63
@ -58,17 +58,19 @@ class PLASMA_EXPORT AbstractRunner : public QObject
|
||||
|
||||
public:
|
||||
/** Specifies a nominal speed for the runner */
|
||||
enum Speed { SlowSpeed,
|
||||
NormalSpeed
|
||||
};
|
||||
enum Speed {
|
||||
SlowSpeed,
|
||||
NormalSpeed
|
||||
};
|
||||
|
||||
/** Specifies a priority for the runner */
|
||||
enum Priority { LowestPriority = 0,
|
||||
LowPriority,
|
||||
NormalPriority,
|
||||
HighPriority,
|
||||
HighestPriority
|
||||
};
|
||||
enum Priority {
|
||||
LowestPriority = 0,
|
||||
LowPriority,
|
||||
NormalPriority,
|
||||
HighPriority,
|
||||
HighestPriority
|
||||
};
|
||||
|
||||
/** An ordered list of runners */
|
||||
typedef QList<AbstractRunner*> List;
|
||||
@ -175,7 +177,7 @@ class PLASMA_EXPORT AbstractRunner : public QObject
|
||||
*
|
||||
* @return the Package object, or 0 if none
|
||||
**/
|
||||
const Package* package() const;
|
||||
const Package *package() const;
|
||||
|
||||
/**
|
||||
* Signal runner to reload its configuration.
|
||||
@ -191,8 +193,8 @@ class PLASMA_EXPORT AbstractRunner : public QObject
|
||||
* this constructor can not be called directly. Rather a subclass must
|
||||
* be created
|
||||
*/
|
||||
explicit AbstractRunner(QObject* parent = 0, const QString& serviceId = QString());
|
||||
AbstractRunner(QObject* parent, const QVariantList& args);
|
||||
explicit AbstractRunner(QObject *parent = 0, const QString &serviceId = QString());
|
||||
AbstractRunner(QObject *parent, const QVariantList &args);
|
||||
|
||||
/**
|
||||
* Provides access to the runner's configuration object.
|
||||
@ -232,13 +234,13 @@ class PLASMA_EXPORT AbstractRunner : public QObject
|
||||
KService::List serviceQuery(const QString &serviceType,
|
||||
const QString &constraint = QString()) const;
|
||||
|
||||
QMutex* bigLock() const;
|
||||
QMutex *bigLock() const;
|
||||
|
||||
protected Q_SLOTS:
|
||||
void init();
|
||||
|
||||
private:
|
||||
AbstractRunnerPrivate* const d;
|
||||
AbstractRunnerPrivate *const d;
|
||||
};
|
||||
|
||||
} // Plasma namespace
|
||||
@ -248,7 +250,6 @@ K_PLUGIN_FACTORY(factory, registerPlugin<classname>();) \
|
||||
K_EXPORT_PLUGIN(factory("plasma_runner_" #libname)) \
|
||||
K_EXPORT_PLUGIN_VERSION(PLASMA_VERSION)
|
||||
|
||||
|
||||
#define K_EXPORT_RUNNER_CONFIG( name, classname ) \
|
||||
K_PLUGIN_FACTORY(ConfigFactory, registerPlugin<classname>();) \
|
||||
K_EXPORT_PLUGIN(ConfigFactory("kcm_krunner_" #name)) \
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Copyright 2007 Aaron Seigo <aseigo@kde.org>
|
||||
* 2007 Alexis Ménard <darktears31@gmail.com>
|
||||
* Copyright 2007 Alexis Ménard <darktears31@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Library General Public License as
|
||||
@ -57,20 +57,22 @@ public:
|
||||
virtual Animator::CurveShape elementAnimationCurve(Plasma::Animator::Animation) const;
|
||||
|
||||
// Element animations
|
||||
virtual QPixmap elementAppear(qreal progress, const QPixmap& pixmap);
|
||||
virtual QPixmap elementDisappear(qreal progress, const QPixmap& pixmap);
|
||||
virtual QPixmap elementAppear(qreal progress, const QPixmap &pixmap);
|
||||
virtual QPixmap elementDisappear(qreal progress, const QPixmap &pixmap);
|
||||
|
||||
// Item animations
|
||||
virtual void itemAppear(qreal progress, QGraphicsItem* item);
|
||||
virtual void itemDisappear(qreal progress, QGraphicsItem* item);
|
||||
virtual void itemActivated(qreal progress, QGraphicsItem* item);
|
||||
virtual void itemAppear(qreal progress, QGraphicsItem *item);
|
||||
virtual void itemDisappear(qreal progress, QGraphicsItem *item);
|
||||
virtual void itemActivated(qreal progress, QGraphicsItem *item);
|
||||
|
||||
// Item movements
|
||||
virtual void itemSlideIn(qreal progress, QGraphicsItem* item, const QPoint &start, const QPoint &destination);
|
||||
virtual void itemSlideOut(qreal progress, QGraphicsItem* item, const QPoint &start, const QPoint &destination);
|
||||
virtual void itemSlideIn(qreal progress, QGraphicsItem *item,
|
||||
const QPoint &start, const QPoint &destination);
|
||||
virtual void itemSlideOut(qreal progress, QGraphicsItem *item,
|
||||
const QPoint &start, const QPoint &destination);
|
||||
|
||||
private:
|
||||
AnimationDriverPrivate * const d;
|
||||
AnimationDriverPrivate *const d;
|
||||
};
|
||||
|
||||
} // Plasma namespace
|
||||
|
30
animator.h
30
animator.h
@ -42,29 +42,27 @@ class AnimatorPrivate;
|
||||
class PLASMA_EXPORT Animator : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_ENUMS( Animation )
|
||||
Q_ENUMS( CurveShape )
|
||||
Q_ENUMS( Movement )
|
||||
Q_ENUMS(Animation)
|
||||
Q_ENUMS(CurveShape)
|
||||
Q_ENUMS(Movement)
|
||||
|
||||
public:
|
||||
|
||||
enum Animation
|
||||
{
|
||||
AppearAnimation = 0 /*<< Animate the appearance of an element */,
|
||||
DisappearAnimation /*<< Animate the disappearance of an element */,
|
||||
ActivateAnimation /*<< When something is activated or launched, such as an app icon being clicked */
|
||||
enum Animation {
|
||||
AppearAnimation = 0, /*<< Animate the appearance of an element */
|
||||
DisappearAnimation, /*<< Animate the disappearance of an element */
|
||||
ActivateAnimation /*<< When something is activated or launched,
|
||||
such as an app icon being clicked */
|
||||
};
|
||||
|
||||
enum CurveShape
|
||||
{
|
||||
enum CurveShape {
|
||||
EaseInCurve = 0,
|
||||
EaseOutCurve,
|
||||
EaseInOutCurve,
|
||||
LinearCurve
|
||||
};
|
||||
|
||||
enum Movement
|
||||
{
|
||||
enum Movement {
|
||||
SlideInMovement = 0,
|
||||
SlideOutMovement,
|
||||
FastSlideInMovement,
|
||||
@ -74,7 +72,7 @@ public:
|
||||
/**
|
||||
* Singleton accessor
|
||||
**/
|
||||
static Animator* self();
|
||||
static Animator *self();
|
||||
|
||||
/**
|
||||
* Starts a standard animation on a QGraphicsItem.
|
||||
@ -83,7 +81,7 @@ public:
|
||||
* @arg anim the type of animation to perform
|
||||
* @return the id of the animation
|
||||
**/
|
||||
Q_INVOKABLE int animateItem(QGraphicsItem* item, Animation anim);
|
||||
Q_INVOKABLE int animateItem(QGraphicsItem *item, Animation anim);
|
||||
|
||||
/**
|
||||
* Stops an item animation before the animation is complete.
|
||||
@ -101,7 +99,7 @@ public:
|
||||
* @arg anim the type of animation to perform
|
||||
* @return the id of the animation
|
||||
**/
|
||||
Q_INVOKABLE int moveItem(QGraphicsItem* item, Movement movement, const QPoint &destination);
|
||||
Q_INVOKABLE int moveItem(QGraphicsItem *item, Movement movement, const QPoint &destination);
|
||||
|
||||
/**
|
||||
* Stops an item movement before the animation is complete.
|
||||
@ -130,7 +128,7 @@ public:
|
||||
* @return an id that can be used to identify this animation.
|
||||
*/
|
||||
Q_INVOKABLE int customAnimation(int frames, int duration, Animator::CurveShape curve,
|
||||
QObject* receiver, const char* method);
|
||||
QObject *receiver, const char *method);
|
||||
|
||||
/**
|
||||
* Stops a custom animation. Note that it is not necessary to call
|
||||
|
@ -991,7 +991,7 @@ void Applet::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QW
|
||||
}
|
||||
|
||||
void Applet::paintInterface(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
||||
const QRect & contentsRect)
|
||||
const QRect &contentsRect)
|
||||
{
|
||||
if (d->script) {
|
||||
d->script->paintInterface(painter, option, contentsRect);
|
||||
@ -1073,7 +1073,7 @@ void Applet::removeAssociatedWidget(QWidget *widget)
|
||||
|
||||
Location Applet::location() const
|
||||
{
|
||||
Containment* c = containment();
|
||||
Containment *c = containment();
|
||||
return c ? c->d->location : Plasma::Desktop;
|
||||
}
|
||||
|
||||
|
75
applet.h
75
applet.h
@ -89,12 +89,18 @@ class PLASMA_EXPORT Applet : public QGraphicsWidget
|
||||
/**
|
||||
* Description on how draw a background for the applet
|
||||
*/
|
||||
enum BackgroundHint { NoBackground = 0 /** Not drawing a background under the applet, the applet has its own implementation */,
|
||||
StandardBackground = 1 /** The standard background from the theme is drawn */,
|
||||
TranslucentBackground = 2 /** An alternate version of the background is drawn, usually more translucent */,
|
||||
ShadowedBackground = 4 /** The applet has a drop shadow */,
|
||||
DefaultBackground = StandardBackground | ShadowedBackground /** Default settings: both standard background and shadow */
|
||||
};
|
||||
enum BackgroundHint {
|
||||
NoBackground = 0, /** Not drawing a background under the
|
||||
applet, the applet has its own implementation */
|
||||
StandardBackground = 1, /** The standard background from the theme is drawn */
|
||||
TranslucentBackground = 2,/** An alternate version of the background is drawn,
|
||||
usually more translucent */
|
||||
ShadowedBackground = 4, /** The applet has a drop shadow */
|
||||
DefaultBackground = StandardBackground | ShadowedBackground
|
||||
/** Default settings:
|
||||
both standard background
|
||||
and shadow */
|
||||
};
|
||||
Q_DECLARE_FLAGS(BackgroundHints, BackgroundHint)
|
||||
|
||||
~Applet();
|
||||
@ -164,7 +170,7 @@ class PLASMA_EXPORT Applet : public QGraphicsWidget
|
||||
*
|
||||
* @return config skeleton object, or 0 if none
|
||||
**/
|
||||
ConfigXml* configScheme() const;
|
||||
ConfigXml *configScheme() const;
|
||||
|
||||
/**
|
||||
* Loads the given DataEngine
|
||||
@ -183,7 +189,7 @@ class PLASMA_EXPORT Applet : public QGraphicsWidget
|
||||
* or an invalid data engine if the requested engine
|
||||
* could not be loaded
|
||||
*/
|
||||
Q_INVOKABLE DataEngine* dataEngine(const QString& name) const;
|
||||
Q_INVOKABLE DataEngine *dataEngine(const QString &name) const;
|
||||
|
||||
/**
|
||||
* Accessor for the associated Package object if any.
|
||||
@ -191,7 +197,7 @@ class PLASMA_EXPORT Applet : public QGraphicsWidget
|
||||
*
|
||||
* @return the Package object, or 0 if none
|
||||
**/
|
||||
const Package* package() const;
|
||||
const Package *package() const;
|
||||
|
||||
/**
|
||||
* Returns the view this widget is visible on
|
||||
@ -296,7 +302,8 @@ class PLASMA_EXPORT Applet : public QGraphicsWidget
|
||||
* @return list of categories
|
||||
* @param visibleOnly true if it should only return applets that are marked as visible
|
||||
*/
|
||||
static QStringList listCategories(const QString &parentApp = QString(), bool visibleOnly = true);
|
||||
static QStringList listCategories(const QString &parentApp = QString(),
|
||||
bool visibleOnly = true);
|
||||
|
||||
/**
|
||||
* Attempts to load an applet
|
||||
@ -311,8 +318,8 @@ class PLASMA_EXPORT Applet : public QGraphicsWidget
|
||||
* @param args to send the applet extra arguments
|
||||
* @return a pointer to the loaded applet, or 0 on load failure
|
||||
**/
|
||||
static Applet* load(const QString &name, uint appletId = 0,
|
||||
const QVariantList& args = QVariantList());
|
||||
static Applet *load(const QString &name, uint appletId = 0,
|
||||
const QVariantList &args = QVariantList());
|
||||
|
||||
/**
|
||||
* Attempts to load an applet
|
||||
@ -327,22 +334,22 @@ class PLASMA_EXPORT Applet : public QGraphicsWidget
|
||||
* @param args to send the applet extra arguments
|
||||
* @return a pointer to the loaded applet, or 0 on load failure
|
||||
**/
|
||||
static Applet* load(const KPluginInfo& info, uint appletId = 0,
|
||||
const QVariantList& args = QVariantList());
|
||||
static Applet *load(const KPluginInfo &info, uint appletId = 0,
|
||||
const QVariantList &args = QVariantList());
|
||||
|
||||
/**
|
||||
* Get the category of the given applet
|
||||
*
|
||||
* @param applet a KPluginInfo object for the applet
|
||||
*/
|
||||
static QString category(const KPluginInfo& applet);
|
||||
static QString category(const KPluginInfo &applet);
|
||||
|
||||
/**
|
||||
* Get the category of the given applet
|
||||
*
|
||||
* @param appletName the name of the applet
|
||||
*/
|
||||
static QString category(const QString& appletName);
|
||||
static QString category(const QString &appletName);
|
||||
|
||||
/**
|
||||
* This method is called when the interface should be painted.
|
||||
@ -354,7 +361,7 @@ class PLASMA_EXPORT Applet : public QGraphicsWidget
|
||||
**/
|
||||
virtual void paintInterface(QPainter *painter,
|
||||
const QStyleOptionGraphicsItem *option,
|
||||
const QRect& contentsRect);
|
||||
const QRect &contentsRect);
|
||||
|
||||
/**
|
||||
* Returns the user-visible name for the applet, as specified in the
|
||||
@ -398,7 +405,8 @@ class PLASMA_EXPORT Applet : public QGraphicsWidget
|
||||
*/
|
||||
ImmutabilityType immutability() const;
|
||||
|
||||
void paintWindowFrame(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
|
||||
void paintWindowFrame(QPainter *painter,
|
||||
const QStyleOptionGraphicsItem *option, QWidget *widget);
|
||||
|
||||
/**
|
||||
* If for some reason, the applet fails to get up on its feet (the
|
||||
@ -432,7 +440,7 @@ class PLASMA_EXPORT Applet : public QGraphicsWidget
|
||||
/**
|
||||
* Returns the QAction with the given name from our collection
|
||||
*/
|
||||
QAction* action(QString name) const;
|
||||
QAction *action(QString name) const;
|
||||
|
||||
/**
|
||||
* Adds the action to our collection under the given name
|
||||
@ -472,12 +480,14 @@ class PLASMA_EXPORT Applet : public QGraphicsWidget
|
||||
* Reimplemented from QGraphicsItem
|
||||
**/
|
||||
int type() const;
|
||||
enum { Type = Plasma::AppletType };
|
||||
enum {
|
||||
Type = Plasma::AppletType
|
||||
};
|
||||
|
||||
/**
|
||||
* @return the Containment, if any, this applet belongs to
|
||||
**/
|
||||
Containment* containment() const;
|
||||
Containment *containment() const;
|
||||
|
||||
/**
|
||||
* Sets the global shorcut to associate with this widget.
|
||||
@ -509,8 +519,8 @@ class PLASMA_EXPORT Applet : public QGraphicsWidget
|
||||
* @param appletId a unique id used to differentiate between multiple
|
||||
* instances of the same Applet type
|
||||
*/
|
||||
explicit Applet(QGraphicsItem* parent = 0,
|
||||
const QString& serviceId = QString(),
|
||||
explicit Applet(QGraphicsItem *parent = 0,
|
||||
const QString &serviceId = QString(),
|
||||
uint appletId = 0);
|
||||
|
||||
Q_SIGNALS:
|
||||
@ -551,7 +561,8 @@ class PLASMA_EXPORT Applet : public QGraphicsWidget
|
||||
|
||||
public Q_SLOTS:
|
||||
/**
|
||||
* Sets the immutability type for this applet (not immutable, user immutable or system immutable)
|
||||
* Sets the immutability type for this applet (not immutable,
|
||||
* user immutable or system immutable)
|
||||
* @arg immutable the new immutability type of this applet
|
||||
*/
|
||||
void setImmutability(const ImmutabilityType immutable);
|
||||
@ -639,7 +650,7 @@ class PLASMA_EXPORT Applet : public QGraphicsWidget
|
||||
* @param args a list of strings containing two entries: the service id
|
||||
* and the applet id
|
||||
*/
|
||||
Applet(QObject* parent, const QVariantList& args);
|
||||
Applet(QObject *parent, const QVariantList &args);
|
||||
|
||||
/**
|
||||
* Call this method when the applet fails to launch properly. An
|
||||
@ -653,7 +664,7 @@ class PLASMA_EXPORT Applet : public QGraphicsWidget
|
||||
* @param reason an optional reason to show the user why the applet
|
||||
* failed to launch
|
||||
**/
|
||||
void setFailedToLaunch(bool failed, const QString& reason = QString());
|
||||
void setFailedToLaunch(bool failed, const QString &reason = QString());
|
||||
|
||||
/**
|
||||
* When called, the Applet should write any information needed as part
|
||||
@ -689,7 +700,7 @@ class PLASMA_EXPORT Applet : public QGraphicsWidget
|
||||
* @param needsConfiguring true if the applet needs to be configured,
|
||||
* or false if it doesn't
|
||||
*/
|
||||
void setConfigurationRequired(bool needsConfiguring, const QString& reason = QString());
|
||||
void setConfigurationRequired(bool needsConfiguring, const QString &reason = QString());
|
||||
|
||||
/**
|
||||
* Reimplement this method so provide a configuration interface,
|
||||
@ -715,7 +726,6 @@ class PLASMA_EXPORT Applet : public QGraphicsWidget
|
||||
*/
|
||||
virtual void constraintsEvent(Plasma::Constraints constraints);
|
||||
|
||||
|
||||
/**
|
||||
* Register the widgets that manage mouse clicks but you still want
|
||||
* to be able to drag the applet around when holding the mouse pointer
|
||||
@ -743,12 +753,12 @@ class PLASMA_EXPORT Applet : public QGraphicsWidget
|
||||
/**
|
||||
* @internal event filter; used for focus watching
|
||||
**/
|
||||
bool eventFilter( QObject *o, QEvent *e );
|
||||
bool eventFilter(QObject *o, QEvent *e);
|
||||
|
||||
/**
|
||||
* @internal scene event filter; used to manage applet dragging
|
||||
*/
|
||||
bool sceneEventFilter ( QGraphicsItem * watched, QEvent * event );
|
||||
bool sceneEventFilter (QGraphicsItem *watched, QEvent *event);
|
||||
|
||||
/**
|
||||
* @internal manage the mouse movement to drag the applet around
|
||||
@ -804,7 +814,8 @@ class PLASMA_EXPORT Applet : public QGraphicsWidget
|
||||
Q_PRIVATE_SLOT(d, void setFocus())
|
||||
Q_PRIVATE_SLOT(d, void checkImmutability())
|
||||
Q_PRIVATE_SLOT(d, void themeChanged())
|
||||
Q_PRIVATE_SLOT(d, void appletAnimationComplete(QGraphicsItem *item, Plasma::Animator::Animation anim))
|
||||
Q_PRIVATE_SLOT(d, void appletAnimationComplete(QGraphicsItem *item,
|
||||
Plasma::Animator::Animation anim))
|
||||
Q_PRIVATE_SLOT(d, void selectItemToDestroy())
|
||||
Q_PRIVATE_SLOT(d, void updateRect(const QRectF& rect))
|
||||
|
||||
@ -813,7 +824,7 @@ class PLASMA_EXPORT Applet : public QGraphicsWidget
|
||||
**/
|
||||
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
|
||||
|
||||
AppletPrivate* const d;
|
||||
AppletPrivate *const d;
|
||||
|
||||
//Corona needs to access setFailedToLaunch and init
|
||||
friend class Corona;
|
||||
|
@ -46,7 +46,7 @@ namespace Plasma
|
||||
class AppletBrowserWidgetPrivate
|
||||
{
|
||||
public:
|
||||
AppletBrowserWidgetPrivate(AppletBrowserWidget* w)
|
||||
AppletBrowserWidgetPrivate(AppletBrowserWidget *w)
|
||||
: q(w),
|
||||
containment(0),
|
||||
appletList(0),
|
||||
@ -65,12 +65,12 @@ public:
|
||||
/**
|
||||
* Tracks a new running applet
|
||||
*/
|
||||
void appletAdded(Plasma::Applet* applet);
|
||||
void appletAdded(Plasma::Applet *applet);
|
||||
|
||||
/**
|
||||
* A running applet is no more
|
||||
*/
|
||||
void appletRemoved(Plasma::Applet* applet);
|
||||
void appletRemoved(Plasma::Applet *applet);
|
||||
|
||||
AppletBrowserWidget *q;
|
||||
QString application;
|
||||
@ -128,7 +128,7 @@ void AppletBrowserWidgetPrivate::initFilters()
|
||||
|
||||
filterModel.addSeparator(i18n("Categories:"));
|
||||
|
||||
foreach (const QString& category, Plasma::Applet::listCategories(application)) {
|
||||
foreach (const QString &category, Plasma::Applet::listCategories(application)) {
|
||||
filterModel.addFilter(category,
|
||||
KCategorizedItemsViewModels::Filter("category", category));
|
||||
}
|
||||
@ -201,7 +201,7 @@ void AppletBrowserWidgetPrivate::initRunningApplets()
|
||||
itemModel.setRunningApplets(runningApplets);
|
||||
}
|
||||
|
||||
void AppletBrowserWidget::setApplication(const QString& app)
|
||||
void AppletBrowserWidget::setApplication(const QString &app)
|
||||
{
|
||||
d->application = app;
|
||||
d->initFilters();
|
||||
@ -260,7 +260,7 @@ void AppletBrowserWidget::addApplet()
|
||||
}
|
||||
}
|
||||
|
||||
void AppletBrowserWidgetPrivate::appletAdded(Plasma::Applet* applet)
|
||||
void AppletBrowserWidgetPrivate::appletAdded(Plasma::Applet *applet)
|
||||
{
|
||||
QString name = applet->name();
|
||||
//kDebug() << name;
|
||||
@ -270,10 +270,10 @@ void AppletBrowserWidgetPrivate::appletAdded(Plasma::Applet* applet)
|
||||
itemModel.setRunningApplets(name, runningApplets[name]);
|
||||
}
|
||||
|
||||
void AppletBrowserWidgetPrivate::appletRemoved(Plasma::Applet* applet)
|
||||
void AppletBrowserWidgetPrivate::appletRemoved(Plasma::Applet *applet)
|
||||
{
|
||||
//kDebug() << (QObject*)applet;
|
||||
Plasma::Applet* a = (Plasma::Applet*)applet; //don't care if it's valid, just need the address
|
||||
Plasma::Applet *a = (Plasma::Applet *)applet; //don't care if it's valid, just need the address
|
||||
|
||||
QString name = appletNames.take(a);
|
||||
|
||||
@ -394,9 +394,9 @@ AppletBrowser::~AppletBrowser()
|
||||
saveDialogSize(cg);
|
||||
}
|
||||
|
||||
void AppletBrowser::setApplication(const QString& app)
|
||||
void AppletBrowser::setApplication(const QString &app)
|
||||
{
|
||||
d->widget->setApplication( app );
|
||||
d->widget->setApplication(app);
|
||||
}
|
||||
|
||||
QString AppletBrowser::application()
|
||||
@ -409,7 +409,7 @@ void AppletBrowser::setContainment(Plasma::Containment *containment)
|
||||
d->widget->setContainment(containment);
|
||||
}
|
||||
|
||||
Containment* AppletBrowser::containment() const
|
||||
Containment *AppletBrowser::containment() const
|
||||
{
|
||||
return d->widget->containment();
|
||||
}
|
||||
|
@ -40,7 +40,7 @@ public:
|
||||
explicit AppletBrowserWidget(QWidget *parent = 0, Qt::WindowFlags f = 0);
|
||||
virtual ~AppletBrowserWidget();
|
||||
|
||||
void setApplication(const QString& application = QString());
|
||||
void setApplication(const QString &application = QString());
|
||||
QString application();
|
||||
|
||||
/**
|
||||
@ -53,7 +53,7 @@ public:
|
||||
/**
|
||||
* @return the current default containment to add applets to
|
||||
*/
|
||||
Containment* containment() const;
|
||||
Containment *containment() const;
|
||||
|
||||
public Q_SLOTS:
|
||||
/**
|
||||
@ -91,7 +91,7 @@ public:
|
||||
explicit AppletBrowser(QWidget *parent = 0, Qt::WindowFlags f = 0);
|
||||
virtual ~AppletBrowser();
|
||||
|
||||
void setApplication(const QString& application = QString());
|
||||
void setApplication(const QString &application = QString());
|
||||
QString application();
|
||||
|
||||
/**
|
||||
@ -104,7 +104,7 @@ public:
|
||||
/**
|
||||
* @return the current default containment to add applets to
|
||||
*/
|
||||
Containment* containment() const;
|
||||
Containment *containment() const;
|
||||
|
||||
private:
|
||||
AppletBrowserPrivate * const d;
|
||||
|
@ -113,7 +113,7 @@ public:
|
||||
* @arg key the configuration key to find
|
||||
* @return the associated KConfigSkeletonItem, or 0 if none
|
||||
*/
|
||||
KConfigSkeletonItem* findItem(const QString &group, const QString &key);
|
||||
KConfigSkeletonItem *findItem(const QString &group, const QString &key);
|
||||
|
||||
/**
|
||||
* Check to see if a group exists
|
||||
|
@ -86,8 +86,8 @@ Containment::StyleOption::StyleOption(const QStyleOptionGraphicsItem &other)
|
||||
type = Type;
|
||||
}
|
||||
|
||||
Containment::Containment(QGraphicsItem* parent,
|
||||
const QString& serviceId,
|
||||
Containment::Containment(QGraphicsItem *parent,
|
||||
const QString &serviceId,
|
||||
uint containmentId)
|
||||
: Applet(parent, serviceId, containmentId),
|
||||
d(new ContainmentPrivate(this))
|
||||
@ -99,7 +99,7 @@ Containment::Containment(QGraphicsItem* parent,
|
||||
setContainmentType(CustomContainment);
|
||||
}
|
||||
|
||||
Containment::Containment(QObject* parent, const QVariantList& args)
|
||||
Containment::Containment(QObject *parent, const QVariantList &args)
|
||||
: Applet(parent, args),
|
||||
d(new ContainmentPrivate(this))
|
||||
{
|
||||
@ -367,7 +367,7 @@ void Containment::setContainmentType(Containment::Type type)
|
||||
}
|
||||
}
|
||||
|
||||
Corona* Containment::corona() const
|
||||
Corona *Containment::corona() const
|
||||
{
|
||||
return dynamic_cast<Corona*>(scene());
|
||||
}
|
||||
@ -376,7 +376,7 @@ void Containment::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
|
||||
{
|
||||
event->ignore();
|
||||
if (d->wallpaper) {
|
||||
QGraphicsItem* item = scene()->itemAt(event->scenePos());
|
||||
QGraphicsItem *item = scene()->itemAt(event->scenePos());
|
||||
if (item == this) {
|
||||
d->wallpaper->mouseMoveEvent(event);
|
||||
}
|
||||
@ -392,7 +392,7 @@ void Containment::mousePressEvent(QGraphicsSceneMouseEvent *event)
|
||||
{
|
||||
event->ignore();
|
||||
if (d->wallpaper) {
|
||||
QGraphicsItem* item = scene()->itemAt(event->scenePos());
|
||||
QGraphicsItem *item = scene()->itemAt(event->scenePos());
|
||||
if (item == this) {
|
||||
d->wallpaper->mousePressEvent(event);
|
||||
}
|
||||
@ -410,7 +410,7 @@ void Containment::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
|
||||
{
|
||||
event->ignore();
|
||||
if (d->wallpaper) {
|
||||
QGraphicsItem* item = scene()->itemAt(event->scenePos());
|
||||
QGraphicsItem *item = scene()->itemAt(event->scenePos());
|
||||
if (item == this) {
|
||||
d->wallpaper->mouseReleaseEvent(event);
|
||||
}
|
||||
@ -427,7 +427,7 @@ void Containment::showContextMenu(const QPointF &containmentPos, const QPoint &s
|
||||
d->showContextMenu(mapToScene(containmentPos), screenPos, false);
|
||||
}
|
||||
|
||||
void Containment::contextMenuEvent(QGraphicsSceneContextMenuEvent* event)
|
||||
void Containment::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
|
||||
{
|
||||
//kDebug() << "let's see if we manage to get a context menu here, huh";
|
||||
if (!isContainment() || !scene() || !KAuthorized::authorizeKAction("desktop_contextmenu")) {
|
||||
@ -471,7 +471,7 @@ bool ContainmentPrivate::showContextMenu(const QPointF &point, const QPoint &scr
|
||||
if (includeApplet) {
|
||||
actions = applet->contextualActions();
|
||||
if (!actions.isEmpty()) {
|
||||
foreach(QAction* action, actions) {
|
||||
foreach (QAction *action, actions) {
|
||||
if (action) {
|
||||
desktopMenu.addAction(action);
|
||||
}
|
||||
@ -1176,7 +1176,7 @@ void Containment::removeAssociatedWidget(QWidget *widget)
|
||||
d->focusedApplet->removeAssociatedWidget(widget);
|
||||
}
|
||||
|
||||
foreach (const Applet* applet, d->applets) {
|
||||
foreach (const Applet *applet, d->applets) {
|
||||
if (applet->d->activationAction) {
|
||||
widget->removeAction(applet->d->activationAction);
|
||||
}
|
||||
@ -1380,7 +1380,7 @@ void Containment::destroy(bool confirm)
|
||||
//FIXME maybe that %1 should be the containment type not the name
|
||||
if (!confirm ||
|
||||
KMessageBox::warningContinueCancel(view(), i18n("Do you really want to remove this %1?", name()),
|
||||
i18n("Remove %1", name()), KStandardGuiItem::remove()) == KMessageBox::Continue ) {
|
||||
i18n("Remove %1", name()), KStandardGuiItem::remove()) == KMessageBox::Continue) {
|
||||
//clearApplets();
|
||||
Applet::destroy();
|
||||
}
|
||||
@ -1420,7 +1420,7 @@ void ContainmentPrivate::toggleDesktopImmutability()
|
||||
QMap<Applet*, AppletHandle*> h = handles;
|
||||
handles.clear();
|
||||
|
||||
foreach (AppletHandle* handle, h) {
|
||||
foreach (AppletHandle *handle, h) {
|
||||
handle->disconnect(q);
|
||||
handle->deleteLater();
|
||||
}
|
||||
|
@ -78,8 +78,12 @@ class PLASMA_EXPORT Containment : public Applet
|
||||
explicit StyleOption(const StyleOption &other);
|
||||
explicit StyleOption(const QStyleOptionGraphicsItem &other);
|
||||
|
||||
enum StyleOptionType { Type = SO_CustomBase + 1 };
|
||||
enum StyleOptionVersion { Version = QStyleOptionGraphicsItem::Version + 1 };
|
||||
enum StyleOptionType {
|
||||
Type = SO_CustomBase + 1
|
||||
};
|
||||
enum StyleOptionVersion {
|
||||
Version = QStyleOptionGraphicsItem::Version + 1
|
||||
};
|
||||
|
||||
/**
|
||||
* The View, if any, that this containment is currently
|
||||
@ -89,13 +93,14 @@ class PLASMA_EXPORT Containment : public Applet
|
||||
Plasma::View *view;
|
||||
};
|
||||
|
||||
enum Type { NoContainmentType = -1 /**< @internal */,
|
||||
DesktopContainment = 0 /**< A desktop containment */,
|
||||
PanelContainment /**< A desktop panel */,
|
||||
CustomContainment = 127 /**< A containment that is neither a desktop nor a panel,
|
||||
but something application specific */,
|
||||
CustomPanelContainment = 128 /**< A customized desktop panel */
|
||||
};
|
||||
enum Type {
|
||||
NoContainmentType = -1, /**< @internal */
|
||||
DesktopContainment = 0, /**< A desktop containment */
|
||||
PanelContainment, /**< A desktop panel */
|
||||
CustomContainment = 127, /**< A containment that is neither a desktop nor a panel
|
||||
but something application specific */
|
||||
CustomPanelContainment = 128 /**< A customized desktop panel */
|
||||
};
|
||||
|
||||
/**
|
||||
* @param parent the QGraphicsItem this applet is parented to
|
||||
@ -135,7 +140,7 @@ class PLASMA_EXPORT Containment : public Applet
|
||||
/**
|
||||
* Returns the Corona (if any) that this Containment is hosted by
|
||||
*/
|
||||
Corona* corona() const;
|
||||
Corona *corona() const;
|
||||
|
||||
/**
|
||||
* Returns a list of all known containments.
|
||||
@ -174,7 +179,7 @@ class PLASMA_EXPORT Containment : public Applet
|
||||
*
|
||||
* @return a pointer to the applet on success, or 0 on failure
|
||||
*/
|
||||
Applet* addApplet(const QString &name, const QVariantList &args = QVariantList(),
|
||||
Applet *addApplet(const QString &name, const QVariantList &args = QVariantList(),
|
||||
const QRectF &geometry = QRectF(-1, -1, -1, -1));
|
||||
|
||||
/**
|
||||
@ -295,7 +300,7 @@ class PLASMA_EXPORT Containment : public Applet
|
||||
/**
|
||||
* Return wallpaper plugin.
|
||||
*/
|
||||
Plasma::Wallpaper* wallpaper() const;
|
||||
Plasma::Wallpaper *wallpaper() const;
|
||||
|
||||
/**
|
||||
* Sets the current activity by name
|
||||
@ -488,7 +493,8 @@ class PLASMA_EXPORT Containment : public Applet
|
||||
|
||||
private:
|
||||
Q_PRIVATE_SLOT(d, void appletDestroyed(QObject*))
|
||||
Q_PRIVATE_SLOT(d, void containmentAppletAnimationComplete(QGraphicsItem *item, Plasma::Animator::Animation anim))
|
||||
Q_PRIVATE_SLOT(d, void containmentAppletAnimationComplete(QGraphicsItem *item,
|
||||
Plasma::Animator::Animation anim))
|
||||
Q_PRIVATE_SLOT(d, void triggerShowAddWidgets())
|
||||
Q_PRIVATE_SLOT(d, void handleDisappeared(AppletHandle *handle))
|
||||
Q_PRIVATE_SLOT(d, void positionToolBox())
|
||||
@ -500,10 +506,9 @@ class PLASMA_EXPORT Containment : public Applet
|
||||
friend class AppletPrivate;
|
||||
friend class CoronaPrivate;
|
||||
friend class ContainmentPrivate;
|
||||
ContainmentPrivate* const d;
|
||||
ContainmentPrivate *const d;
|
||||
};
|
||||
|
||||
} // Plasma namespace
|
||||
|
||||
|
||||
#endif // multiple inclusion guard
|
||||
|
19
corona.h
19
corona.h
@ -88,14 +88,14 @@ public:
|
||||
*
|
||||
* @return a pointer to the containment on success, or 0 on failure
|
||||
*/
|
||||
Containment* addContainment(const QString& name, const QVariantList& args = QVariantList());
|
||||
Containment *addContainment(const QString &name, const QVariantList &args = QVariantList());
|
||||
|
||||
/**
|
||||
* Returns the Containment, if any, for a given physical screen
|
||||
*
|
||||
* @param screen number of the physical screen to locate
|
||||
*/
|
||||
Containment* containmentForScreen(int screen) const;
|
||||
Containment *containmentForScreen(int screen) const;
|
||||
|
||||
/**
|
||||
* Adds a widget in the topleft quadrant in the scene. Widgets in the topleft quadrant are
|
||||
@ -143,7 +143,8 @@ public Q_SLOTS:
|
||||
ImmutabilityType immutability() const;
|
||||
|
||||
/**
|
||||
* Sets the immutability type for this Corona (not immutable, user immutable or system immutable)
|
||||
* Sets the immutability type for this Corona (not immutable,
|
||||
* user immutable or system immutable)
|
||||
* @arg immutable the new immutability type of this applet
|
||||
*/
|
||||
void setImmutability(const ImmutabilityType immutable);
|
||||
@ -204,15 +205,16 @@ protected:
|
||||
*
|
||||
* @return a pointer to the containment on success, or 0 on failure
|
||||
**/
|
||||
Containment *addContainmentDelayed(const QString& name, const QVariantList& args = QVariantList());
|
||||
Containment *addContainmentDelayed(const QString &name,
|
||||
const QVariantList &args = QVariantList());
|
||||
|
||||
//Reimplemented from QGraphicsScene
|
||||
void dragEnterEvent(QGraphicsSceneDragDropEvent* event);
|
||||
void dragLeaveEvent(QGraphicsSceneDragDropEvent* event);
|
||||
void dragMoveEvent(QGraphicsSceneDragDropEvent* event);
|
||||
void dragEnterEvent(QGraphicsSceneDragDropEvent *event);
|
||||
void dragLeaveEvent(QGraphicsSceneDragDropEvent *event);
|
||||
void dragMoveEvent(QGraphicsSceneDragDropEvent *event);
|
||||
|
||||
private:
|
||||
CoronaPrivate * const d;
|
||||
CoronaPrivate *const d;
|
||||
|
||||
Q_PRIVATE_SLOT(d, void containmentDestroyed(QObject*))
|
||||
Q_PRIVATE_SLOT(d, void syncConfig())
|
||||
@ -224,4 +226,3 @@ private:
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -29,7 +29,7 @@
|
||||
namespace Plasma
|
||||
{
|
||||
|
||||
DataContainer::DataContainer(QObject* parent)
|
||||
DataContainer::DataContainer(QObject *parent)
|
||||
: QObject(parent),
|
||||
d(new DataContainerPrivate)
|
||||
{
|
||||
@ -45,7 +45,7 @@ const DataEngine::Data DataContainer::data() const
|
||||
return d->data;
|
||||
}
|
||||
|
||||
void DataContainer::setData(const QString& key, const QVariant& value)
|
||||
void DataContainer::setData(const QString &key, const QVariant &value)
|
||||
{
|
||||
if (value.isNull() || !value.isValid()) {
|
||||
d->data.remove(key);
|
||||
@ -74,7 +74,8 @@ bool DataContainer::visualizationIsConnected(QObject *visualization) const
|
||||
return d->relayObjects.contains(visualization);
|
||||
}
|
||||
|
||||
void DataContainer::connectVisualization(QObject* visualization, uint pollingInterval, Plasma::IntervalAlignment alignment)
|
||||
void DataContainer::connectVisualization(QObject *visualization, uint pollingInterval,
|
||||
Plasma::IntervalAlignment alignment)
|
||||
{
|
||||
//kDebug() << "connecting visualization" << visualization << "at interval of"
|
||||
// << pollingInterval << "to" << objectName();
|
||||
@ -117,7 +118,6 @@ void DataContainer::connectVisualization(QObject* visualization, uint pollingInt
|
||||
this, SLOT(disconnectVisualization(QObject*)));//, Qt::QueuedConnection);
|
||||
}
|
||||
|
||||
|
||||
if (pollingInterval < 1) {
|
||||
//kDebug() << " connecting directly";
|
||||
d->relayObjects[visualization] = 0;
|
||||
@ -129,13 +129,14 @@ void DataContainer::connectVisualization(QObject* visualization, uint pollingInt
|
||||
// if it is the first visualization, then the source will already have been populated
|
||||
// engine's sourceRequested method
|
||||
bool immediateUpdate = connected || d->relayObjects.count() > 1;
|
||||
SignalRelay *relay = d->signalRelay(this, visualization, pollingInterval, alignment, immediateUpdate);
|
||||
SignalRelay *relay = d->signalRelay(this, visualization, pollingInterval,
|
||||
alignment, immediateUpdate);
|
||||
connect(relay, SIGNAL(dataUpdated(QString,Plasma::DataEngine::Data)),
|
||||
visualization, SLOT(dataUpdated(QString,Plasma::DataEngine::Data)));
|
||||
}
|
||||
}
|
||||
|
||||
void DataContainer::disconnectVisualization(QObject* visualization)
|
||||
void DataContainer::disconnectVisualization(QObject *visualization)
|
||||
{
|
||||
QMap<QObject *, SignalRelay *>::iterator objIt = d->relayObjects.find(visualization);
|
||||
|
||||
@ -164,7 +165,7 @@ void DataContainer::checkForUpdate()
|
||||
if (d->dirty) {
|
||||
emit dataUpdated(objectName(), d->data);
|
||||
|
||||
foreach (SignalRelay* relay, d->relays) {
|
||||
foreach (SignalRelay *relay, d->relays) {
|
||||
relay->checkQueueing();
|
||||
}
|
||||
|
||||
|
@ -118,7 +118,8 @@ class PLASMA_EXPORT DataContainer : public QObject
|
||||
* @param visualization the object to connect to this DataContainer
|
||||
* @param pollingInterval the time in milliseconds between updates
|
||||
**/
|
||||
void connectVisualization(QObject *visualization, uint pollingInterval, Plasma::IntervalAlignment alignment);
|
||||
void connectVisualization(QObject *visualization, uint pollingInterval,
|
||||
Plasma::IntervalAlignment alignment);
|
||||
|
||||
public Q_SLOTS:
|
||||
/**
|
||||
@ -207,7 +208,7 @@ class PLASMA_EXPORT DataContainer : public QObject
|
||||
|
||||
private:
|
||||
friend class SignalRelay;
|
||||
DataContainerPrivate* const d;
|
||||
DataContainerPrivate *const d;
|
||||
};
|
||||
|
||||
} // Plasma namespace
|
||||
|
54
dataengine.h
54
dataengine.h
@ -57,9 +57,9 @@ class DataEnginePrivate;
|
||||
class PLASMA_EXPORT DataEngine : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY( QStringList sources READ sources )
|
||||
Q_PROPERTY( bool valid READ isValid )
|
||||
Q_PROPERTY( QString icon READ icon WRITE setIcon )
|
||||
Q_PROPERTY(QStringList sources READ sources)
|
||||
Q_PROPERTY(bool valid READ isValid)
|
||||
Q_PROPERTY(QString icon READ icon WRITE setIcon)
|
||||
|
||||
public:
|
||||
typedef QHash<QString, DataEngine*> Dict;
|
||||
@ -73,8 +73,8 @@ class PLASMA_EXPORT DataEngine : public QObject
|
||||
* @param parent The parent object.
|
||||
* @param service pointer to the service that describes the engine
|
||||
**/
|
||||
explicit DataEngine(QObject* parent = 0, KService::Ptr service = KService::Ptr(0));
|
||||
DataEngine(QObject* parent, const QVariantList& args);
|
||||
explicit DataEngine(QObject *parent = 0, KService::Ptr service = KService::Ptr(0));
|
||||
DataEngine(QObject *parent, const QVariantList &args);
|
||||
~DataEngine();
|
||||
|
||||
/**
|
||||
@ -99,7 +99,7 @@ class PLASMA_EXPORT DataEngine : public QObject
|
||||
* is parented to the DataEngine, but may be deleted by the
|
||||
* caller when finished with it
|
||||
*/
|
||||
virtual Service* serviceForSource(const QString &source);
|
||||
virtual Service *serviceForSource(const QString &source);
|
||||
|
||||
/**
|
||||
* Returns the engine name for the DataEngine
|
||||
@ -127,9 +127,10 @@ class PLASMA_EXPORT DataEngine : public QObject
|
||||
* If the data has not changed, no update will be sent.
|
||||
* @param intervalAlignment the number of ms to align the interval to
|
||||
**/
|
||||
Q_INVOKABLE void connectSource(const QString& source, QObject* visualization,
|
||||
uint pollingInterval = 0,
|
||||
Plasma::IntervalAlignment intervalAlignment = NoAlignment) const;
|
||||
Q_INVOKABLE void connectSource(
|
||||
const QString &source, QObject *visualization,
|
||||
uint pollingInterval = 0,
|
||||
Plasma::IntervalAlignment intervalAlignment = NoAlignment) const;
|
||||
|
||||
/**
|
||||
* Connects all currently existing sources to an object for data updates.
|
||||
@ -158,8 +159,9 @@ class PLASMA_EXPORT DataEngine : public QObject
|
||||
* If the data has not changed, no update will be sent.
|
||||
* @param intervalAlignment the number of ms to align the interval to
|
||||
**/
|
||||
Q_INVOKABLE void connectAllSources(QObject* visualization, uint pollingInterval = 0,
|
||||
Plasma::IntervalAlignment intervalAlignment = NoAlignment) const;
|
||||
Q_INVOKABLE void connectAllSources(
|
||||
QObject *visualization, uint pollingInterval = 0,
|
||||
Plasma::IntervalAlignment intervalAlignment = NoAlignment) const;
|
||||
|
||||
/**
|
||||
* Disconnects a source to an object that was receiving data updates.
|
||||
@ -167,7 +169,7 @@ class PLASMA_EXPORT DataEngine : public QObject
|
||||
* @param source the name of the data source
|
||||
* @param visualization the object to connect the data source to
|
||||
**/
|
||||
Q_INVOKABLE void disconnectSource(const QString& source, QObject* visualization) const;
|
||||
Q_INVOKABLE void disconnectSource(const QString &source, QObject *visualization) const;
|
||||
|
||||
/**
|
||||
* Retrevies a pointer to the DataContainer for a given source. This method
|
||||
@ -179,7 +181,7 @@ class PLASMA_EXPORT DataEngine : public QObject
|
||||
* @param source the name of the source.
|
||||
* @return pointer to a DataContainer, or zero on failure
|
||||
**/
|
||||
Q_INVOKABLE DataContainer* containerForSource(const QString &source);
|
||||
Q_INVOKABLE DataContainer *containerForSource(const QString &source);
|
||||
|
||||
/**
|
||||
* Gets the Data associated with a data source.
|
||||
@ -191,7 +193,7 @@ class PLASMA_EXPORT DataEngine : public QObject
|
||||
* @return the Data associated with the source; if the source doesn't
|
||||
* exist an empty data set is returned
|
||||
**/
|
||||
Q_INVOKABLE DataEngine::Data query(const QString& source) const;
|
||||
Q_INVOKABLE DataEngine::Data query(const QString &source) const;
|
||||
|
||||
/**
|
||||
* Returns true if this engine is valid, otherwise returns false
|
||||
@ -223,7 +225,7 @@ class PLASMA_EXPORT DataEngine : public QObject
|
||||
*
|
||||
* @return the Package object, or 0 if none
|
||||
**/
|
||||
const Package* package() const;
|
||||
const Package *package() const;
|
||||
|
||||
Q_SIGNALS:
|
||||
/**
|
||||
@ -236,7 +238,7 @@ class PLASMA_EXPORT DataEngine : public QObject
|
||||
*
|
||||
* @param source the name of the new data source
|
||||
**/
|
||||
void sourceAdded(const QString& source);
|
||||
void sourceAdded(const QString &source);
|
||||
|
||||
/**
|
||||
* Emitted when a data source is removed.
|
||||
@ -248,7 +250,7 @@ class PLASMA_EXPORT DataEngine : public QObject
|
||||
*
|
||||
* @param source the name of the data source that was removed
|
||||
**/
|
||||
void sourceRemoved(const QString& source);
|
||||
void sourceRemoved(const QString &source);
|
||||
|
||||
protected:
|
||||
/**
|
||||
@ -283,7 +285,7 @@ class PLASMA_EXPORT DataEngine : public QObject
|
||||
* @return true if the data was changed, or false if there was no
|
||||
* change or if the change will occur later
|
||||
**/
|
||||
virtual bool updateSourceEvent(const QString& source);
|
||||
virtual bool updateSourceEvent(const QString &source);
|
||||
|
||||
/**
|
||||
* Sets a value for a data source. If the source
|
||||
@ -302,7 +304,7 @@ class PLASMA_EXPORT DataEngine : public QObject
|
||||
* @param key the key to use for the data
|
||||
* @param value the data to associated with the source
|
||||
**/
|
||||
void setData(const QString& source, const QString& key, const QVariant& value);
|
||||
void setData(const QString &source, const QString &key, const QVariant &value);
|
||||
|
||||
/**
|
||||
* Adds a set of data to a data source. If the source
|
||||
@ -318,7 +320,7 @@ class PLASMA_EXPORT DataEngine : public QObject
|
||||
*
|
||||
* @param source the name of the data source
|
||||
**/
|
||||
void removeAllData(const QString& source);
|
||||
void removeAllData(const QString &source);
|
||||
|
||||
/**
|
||||
* Removes a data entry from a source
|
||||
@ -326,7 +328,7 @@ class PLASMA_EXPORT DataEngine : public QObject
|
||||
* @param source the name of the data source
|
||||
* @param key the data entry to remove
|
||||
**/
|
||||
void removeData(const QString& source, const QString& key);
|
||||
void removeData(const QString &source, const QString &key);
|
||||
|
||||
/**
|
||||
* Adds an already constructed data source. The DataEngine takes
|
||||
@ -335,7 +337,7 @@ class PLASMA_EXPORT DataEngine : public QObject
|
||||
*
|
||||
* @param source the DataContainer to add to the DataEngine
|
||||
**/
|
||||
void addSource(DataContainer* source);
|
||||
void addSource(DataContainer *source);
|
||||
|
||||
/**
|
||||
* Sets an upper limit on the number of data sources to keep in this engine.
|
||||
@ -415,7 +417,7 @@ class PLASMA_EXPORT DataEngine : public QObject
|
||||
/**
|
||||
* Sets the icon for this data engine
|
||||
**/
|
||||
void setIcon(const QString& icon);
|
||||
void setIcon(const QString &icon);
|
||||
|
||||
protected Q_SLOTS:
|
||||
/**
|
||||
@ -429,7 +431,7 @@ class PLASMA_EXPORT DataEngine : public QObject
|
||||
* Removes a data source.
|
||||
* @param source the name of the data source to remove
|
||||
**/
|
||||
void removeSource(const QString& source);
|
||||
void removeSource(const QString &source);
|
||||
|
||||
private:
|
||||
friend class DataEnginePrivate;
|
||||
@ -437,9 +439,9 @@ class PLASMA_EXPORT DataEngine : public QObject
|
||||
friend class DataEngineManager;
|
||||
friend class NullEngine;
|
||||
|
||||
Q_PRIVATE_SLOT(d, void internalUpdateSource(DataContainer* source))
|
||||
Q_PRIVATE_SLOT(d, void internalUpdateSource(DataContainer *source))
|
||||
|
||||
DataEnginePrivate* const d;
|
||||
DataEnginePrivate *const d;
|
||||
};
|
||||
|
||||
} // Plasma namespace
|
||||
|
@ -43,7 +43,7 @@ class PLASMA_EXPORT DataEngineManager: public QObject
|
||||
/**
|
||||
* Singleton pattern accessor.
|
||||
*/
|
||||
static DataEngineManager* self();
|
||||
static DataEngineManager *self();
|
||||
|
||||
/**
|
||||
* Returns a data engine object if one is loaded and available.
|
||||
@ -52,7 +52,7 @@ class PLASMA_EXPORT DataEngineManager: public QObject
|
||||
*
|
||||
* @param name the name of the engine
|
||||
*/
|
||||
Plasma::DataEngine* engine(const QString& name) const;
|
||||
Plasma::DataEngine *engine(const QString &name) const;
|
||||
|
||||
/**
|
||||
* Loads a data engine and increases the reference count on it.
|
||||
@ -63,13 +63,13 @@ class PLASMA_EXPORT DataEngineManager: public QObject
|
||||
* @param name the name of the engine
|
||||
* @return the data engine that was loaded, or the NullEngine on failure.
|
||||
*/
|
||||
Plasma::DataEngine* loadEngine(const QString& name);
|
||||
Plasma::DataEngine *loadEngine(const QString &name);
|
||||
|
||||
/**
|
||||
* Decreases the reference count on the engine. If the count reaches
|
||||
* zero, then the engine is deleted to save resources.
|
||||
*/
|
||||
void unloadEngine(const QString& name);
|
||||
void unloadEngine(const QString &name);
|
||||
|
||||
/**
|
||||
* Returns a listing of all known engines by name
|
||||
@ -84,7 +84,7 @@ class PLASMA_EXPORT DataEngineManager: public QObject
|
||||
DataEngineManager();
|
||||
~DataEngineManager();
|
||||
|
||||
DataEngineManagerPrivate* const d;
|
||||
DataEngineManagerPrivate *const d;
|
||||
|
||||
friend class DataEngineManagerSingleton;
|
||||
};
|
||||
|
32
delegate.h
32
delegate.h
@ -39,9 +39,11 @@ class DelegatePrivate;
|
||||
*
|
||||
* The delegate makes use of its own data roles that are:
|
||||
* SubTitleRole: the text of the subtitle
|
||||
* SubTitleMandatoryRole: if the subtitle is to always be displayed (as default the subtitle is displayed only on mouse over)
|
||||
* SubTitleMandatoryRole: if the subtitle is to always be displayed
|
||||
* (as default the subtitle is displayed only on mouse over)
|
||||
* ColumnTypeRole: if the column is a main column (with title and subtitle)
|
||||
* or a secondary action column (only a little icon that appears on mouse over is displayed)
|
||||
* or a secondary action column (only a little icon that appears on mouse
|
||||
* over is displayed)
|
||||
*/
|
||||
class PLASMA_EXPORT Delegate : public QAbstractItemDelegate
|
||||
{
|
||||
@ -49,14 +51,14 @@ class PLASMA_EXPORT Delegate : public QAbstractItemDelegate
|
||||
public:
|
||||
|
||||
enum SpecificRoles {
|
||||
SubTitleRole = Qt::UserRole + 1,
|
||||
SubTitleMandatoryRole = Qt::UserRole + 2,
|
||||
ColumnTypeRole = Qt::UserRole + 3
|
||||
SubTitleRole = Qt::UserRole + 1,
|
||||
SubTitleMandatoryRole = Qt::UserRole + 2,
|
||||
ColumnTypeRole = Qt::UserRole + 3
|
||||
};
|
||||
|
||||
enum ColumnType {
|
||||
MainColumn = 1,
|
||||
SecondaryActionColumn = 2
|
||||
MainColumn = 1,
|
||||
SecondaryActionColumn = 2
|
||||
};
|
||||
|
||||
Delegate(QObject *parent = 0);
|
||||
@ -74,18 +76,20 @@ public:
|
||||
int roleMapping(SpecificRoles role) const;
|
||||
|
||||
//Reimplemented
|
||||
virtual void paint(QPainter *painter,const QStyleOptionViewItem& option,const QModelIndex& index) const;
|
||||
virtual void paint(QPainter *painter, const QStyleOptionViewItem &option,
|
||||
const QModelIndex &index) const;
|
||||
|
||||
protected:
|
||||
/**
|
||||
* Returns the empty area after the title.
|
||||
* The height is the height of the subtitle.
|
||||
* It can be used by subclasses that wants to paint additional data after calling the paint function of the superclass.
|
||||
* It can be used by subclasses that wants to paint additional data after
|
||||
* calling the paint function of the superclass.
|
||||
*
|
||||
* @param option options for the title text
|
||||
* @param index model index that we want to compute the free area
|
||||
*/
|
||||
QRect rectAfterTitle(const QStyleOptionViewItem& option, const QModelIndex& index) const;
|
||||
QRect rectAfterTitle(const QStyleOptionViewItem &option, const QModelIndex &index) const;
|
||||
|
||||
/**
|
||||
* Returns the empty area after the subtitle.
|
||||
@ -95,7 +99,7 @@ protected:
|
||||
* @param option options for the subtitle text
|
||||
* @param index model index that we want to compute the free area
|
||||
*/
|
||||
QRect rectAfterSubTitle(const QStyleOptionViewItem& option, const QModelIndex& index) const;
|
||||
QRect rectAfterSubTitle(const QStyleOptionViewItem &option, const QModelIndex &index) const;
|
||||
|
||||
/**
|
||||
* Returns the empty area after both the title and the subtitle.
|
||||
@ -105,12 +109,12 @@ protected:
|
||||
* @param option options for the title and subtitle text
|
||||
* @param index model index that we want to compute the free area
|
||||
*/
|
||||
QRect emptyRect(const QStyleOptionViewItem& option, const QModelIndex& index) const;
|
||||
QRect emptyRect(const QStyleOptionViewItem &option, const QModelIndex &index) const;
|
||||
|
||||
virtual QSize sizeHint(const QStyleOptionViewItem& option , const QModelIndex& index) const;
|
||||
virtual QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const;
|
||||
|
||||
private:
|
||||
DelegatePrivate * const d;
|
||||
DelegatePrivate *const d;
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -128,7 +128,7 @@ void DialogPrivate::adjustView()
|
||||
}
|
||||
}
|
||||
|
||||
Dialog::Dialog( QWidget * parent, Qt::WindowFlags f )
|
||||
Dialog::Dialog(QWidget *parent, Qt::WindowFlags f)
|
||||
: QWidget(parent, f),
|
||||
d(new DialogPrivate(this))
|
||||
{
|
||||
@ -168,7 +168,7 @@ void Dialog::paintEvent(QPaintEvent *e)
|
||||
}
|
||||
|
||||
if (d->resizeCorners & Dialog::NorthWest) {
|
||||
d->resizeAreas[Dialog::NorthWest] = QRect(0,0, resizeAreaMargin, resizeAreaMargin);
|
||||
d->resizeAreas[Dialog::NorthWest] = QRect(0, 0, resizeAreaMargin, resizeAreaMargin);
|
||||
}
|
||||
|
||||
if (d->resizeCorners & Dialog::SouthEast) {
|
||||
@ -383,6 +383,5 @@ bool Dialog::inControlArea(const QPoint &point)
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
#include "dialog.moc"
|
||||
|
30
dialog.h
30
dialog.h
@ -55,13 +55,14 @@ class PLASMA_EXPORT Dialog : public QWidget
|
||||
/**
|
||||
* Use these flags to choose the active resize corners.
|
||||
*/
|
||||
enum ResizeCorner { NoCorner = 0,
|
||||
NorthEast = 1,
|
||||
SouthEast = 2,
|
||||
NorthWest = 4,
|
||||
SouthWest = 8,
|
||||
All = NorthEast | SouthEast | NorthWest | SouthWest
|
||||
};
|
||||
enum ResizeCorner {
|
||||
NoCorner = 0,
|
||||
NorthEast = 1,
|
||||
SouthEast = 2,
|
||||
NorthWest = 4,
|
||||
SouthWest = 8,
|
||||
All = NorthEast | SouthEast | NorthWest | SouthWest
|
||||
};
|
||||
Q_DECLARE_FLAGS(ResizeCorners, ResizeCorner)
|
||||
|
||||
/**
|
||||
@ -103,22 +104,21 @@ class PLASMA_EXPORT Dialog : public QWidget
|
||||
void paintEvent(QPaintEvent *e);
|
||||
void resizeEvent(QResizeEvent *e);
|
||||
bool eventFilter(QObject *watched, QEvent *event);
|
||||
void hideEvent (QHideEvent * event);
|
||||
void showEvent (QShowEvent * event);
|
||||
void mouseMoveEvent (QMouseEvent * event);
|
||||
void mousePressEvent (QMouseEvent * event);
|
||||
void mouseReleaseEvent (QMouseEvent * event);
|
||||
void hideEvent (QHideEvent *event);
|
||||
void showEvent (QShowEvent *event);
|
||||
void mouseMoveEvent (QMouseEvent *event);
|
||||
void mousePressEvent (QMouseEvent *event);
|
||||
void mouseReleaseEvent (QMouseEvent *event);
|
||||
|
||||
/**
|
||||
* Convenience method to know whether the point is in a control area (e.g. resize area)
|
||||
* or not.
|
||||
* @return true if the point is in the control area.
|
||||
*/
|
||||
bool inControlArea(const QPoint &point);
|
||||
|
||||
bool inControlArea(const QPoint &point);
|
||||
|
||||
private:
|
||||
DialogPrivate * const d;
|
||||
DialogPrivate *const d;
|
||||
|
||||
friend class DialogPrivate;
|
||||
/**
|
||||
|
@ -51,8 +51,7 @@ class Applet;
|
||||
class PLASMA_EXPORT Extender : public QGraphicsWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(QString emptyExtenderMessage READ emptyExtenderMessage
|
||||
WRITE setEmptyExtenderMessage)
|
||||
Q_PROPERTY(QString emptyExtenderMessage READ emptyExtenderMessage WRITE setEmptyExtenderMessage)
|
||||
|
||||
public:
|
||||
/**
|
||||
@ -179,7 +178,7 @@ class PLASMA_EXPORT Extender : public QGraphicsWidget
|
||||
void geometryChanged();
|
||||
|
||||
private:
|
||||
ExtenderPrivate* const d;
|
||||
ExtenderPrivate *const d;
|
||||
|
||||
friend class ExtenderPrivate;
|
||||
friend class ExtenderItem;
|
||||
|
@ -108,8 +108,8 @@ class PLASMA_EXPORT ExtenderItem : public QGraphicsWidget
|
||||
QString name() const;
|
||||
|
||||
/**
|
||||
* @param icon the icon name to display in the extender item's drag handle. Defaults to
|
||||
* the source applet's icon.
|
||||
* @param icon the icon name to display in the extender item's
|
||||
* drag handle. Defaults to the source applet's icon.
|
||||
*/
|
||||
void setIcon(const QString &icon);
|
||||
|
||||
|
36
glapplet.cpp
36
glapplet.cpp
@ -96,8 +96,9 @@ GLApplet::~GLApplet()
|
||||
GLuint GLApplet::bindTexture(const QImage &image, GLenum target)
|
||||
{
|
||||
Q_ASSERT(d->pbuf);
|
||||
if (!d->dummy->isValid())
|
||||
if (!d->dummy->isValid()) {
|
||||
return 0;
|
||||
}
|
||||
return d->dummy->bindTexture(image, target);
|
||||
}
|
||||
|
||||
@ -120,15 +121,18 @@ static inline QPainterPath headerPath(const QRectF &r, int roundness,
|
||||
QPainterPath path;
|
||||
int xRnd = roundness;
|
||||
int yRnd = roundness;
|
||||
if (r.width() > r.height())
|
||||
if (r.width() > r.height()) {
|
||||
xRnd = int(roundness * r.height()/r.width());
|
||||
else
|
||||
} else {
|
||||
yRnd = int(roundness * r.width()/r.height());
|
||||
}
|
||||
|
||||
if(xRnd >= 100) // fix ranges
|
||||
if(xRnd >= 100) { // fix ranges
|
||||
xRnd = 99;
|
||||
if(yRnd >= 100)
|
||||
}
|
||||
if(yRnd >= 100) {
|
||||
yRnd = 99;
|
||||
}
|
||||
if(xRnd <= 0 || yRnd <= 0) { // add normal rectangle
|
||||
path.addRect(r);
|
||||
return path;
|
||||
@ -143,23 +147,25 @@ static inline QPainterPath headerPath(const QRectF &r, int roundness,
|
||||
qreal y = rect.y();
|
||||
qreal w = rect.width();
|
||||
qreal h = rect.height();
|
||||
qreal rxx = w*xRnd/200;
|
||||
qreal ryy = h*yRnd/200;
|
||||
qreal rxx = w * xRnd / 200;
|
||||
qreal ryy = h * yRnd / 200;
|
||||
// were there overflows?
|
||||
if (rxx < 0)
|
||||
rxx = w/200*xRnd;
|
||||
if (ryy < 0)
|
||||
ryy = h/200*yRnd;
|
||||
if (rxx < 0) {
|
||||
rxx = w / 200 * xRnd;
|
||||
}
|
||||
if (ryy < 0) {
|
||||
ryy = h / 200 * yRnd;
|
||||
}
|
||||
qreal rxx2 = 2*rxx;
|
||||
qreal ryy2 = 2*ryy;
|
||||
|
||||
path.arcMoveTo(x, y, rxx2, ryy2, 90);
|
||||
path.arcTo(x, y, rxx2, ryy2, 90, 90);
|
||||
path.arcTo(x, y, rxx2, ryy2, 90, 90);
|
||||
QPointF pt = path.currentPosition();
|
||||
path.lineTo(x, pt.y()+headerHeight);
|
||||
path.lineTo(x+w, pt.y()+headerHeight);
|
||||
path.lineTo(x+w, pt.y());
|
||||
path.arcTo(x+w-rxx2, y, rxx2, ryy2, 0, 90);
|
||||
path.lineTo(x + w, pt.y() + headerHeight);
|
||||
path.lineTo(x + w, pt.y());
|
||||
path.arcTo(x + w - rxx2, y, rxx2, ryy2, 0, 90);
|
||||
path.closeSubpath();
|
||||
|
||||
return path;
|
||||
|
@ -48,7 +48,7 @@ class PLASMA_EXPORT Package
|
||||
* @arg package the name of the package
|
||||
* @arg structure the package structure describing this package
|
||||
**/
|
||||
Package(const QString& packageRoot, const QString& package,
|
||||
Package(const QString &packageRoot, const QString &package,
|
||||
PackageStructure::Ptr structure);
|
||||
|
||||
/**
|
||||
@ -77,7 +77,7 @@ class PLASMA_EXPORT Package
|
||||
* @arg filename the name of the file
|
||||
* @return path to the file on disk. QString() if not found.
|
||||
**/
|
||||
QString filePath(const char* fileType, const QString& filename) const;
|
||||
QString filePath(const char *fileType, const QString &filename) const;
|
||||
|
||||
/**
|
||||
* Get the path to a given file.
|
||||
@ -87,7 +87,7 @@ class PLASMA_EXPORT Package
|
||||
* in the package structure and not a directory.
|
||||
* @return path to the file on disk. QString() if not found
|
||||
**/
|
||||
QString filePath(const char* fileType) const;
|
||||
QString filePath(const char *fileType) const;
|
||||
|
||||
/**
|
||||
* Get the list of files of a given type.
|
||||
@ -96,7 +96,7 @@ class PLASMA_EXPORT Package
|
||||
* package structure.
|
||||
* @return list of files by name, suitable for passing to filePath
|
||||
**/
|
||||
QStringList entryList(const char* fileType) const;
|
||||
QStringList entryList(const char *fileType) const;
|
||||
|
||||
/**
|
||||
* @return the package metadata object.
|
||||
@ -146,7 +146,6 @@ class PLASMA_EXPORT Package
|
||||
const QString &packageRoot,
|
||||
const QString &servicePrefix);
|
||||
|
||||
|
||||
/**
|
||||
* Registers a package described by the given desktop file
|
||||
*
|
||||
|
@ -56,7 +56,7 @@ PackageMetadata::PackageMetadata()
|
||||
{
|
||||
}
|
||||
|
||||
PackageMetadata::PackageMetadata(const QString& path)
|
||||
PackageMetadata::PackageMetadata(const QString &path)
|
||||
: d(new PackageMetadataPrivate)
|
||||
{
|
||||
read(path);
|
||||
@ -98,7 +98,7 @@ void PackageMetadata::write(const QString &filename) const
|
||||
config.writeEntry("X-KDE-Plasmagik-RequiredVersion", d->requiredVersion);
|
||||
}
|
||||
|
||||
void PackageMetadata::read(const QString& filename)
|
||||
void PackageMetadata::read(const QString &filename)
|
||||
{
|
||||
KConfig cfg(filename);
|
||||
KConfigGroup config(&cfg, "Desktop Entry");
|
||||
@ -183,7 +183,7 @@ QString PackageMetadata::implementationApi() const
|
||||
return d->api;
|
||||
}
|
||||
|
||||
void PackageMetadata::setImplementationApi(const QString& api)
|
||||
void PackageMetadata::setImplementationApi(const QString &api)
|
||||
{
|
||||
d->api = api;
|
||||
}
|
||||
@ -253,11 +253,10 @@ void PackageMetadata::setRequiredVersion(const QString &requiredVersion)
|
||||
d->requiredVersion = requiredVersion;
|
||||
}
|
||||
|
||||
void PackageMetadata::setType(const QString& type)
|
||||
void PackageMetadata::setType(const QString &type)
|
||||
{
|
||||
d->type = type;
|
||||
}
|
||||
|
||||
} // namespace Plasma
|
||||
|
||||
|
||||
|
@ -47,7 +47,7 @@ public:
|
||||
*
|
||||
* @param path path to a metadata.desktop file
|
||||
**/
|
||||
PackageMetadata(const QString& path);
|
||||
PackageMetadata(const QString &path);
|
||||
~PackageMetadata();
|
||||
|
||||
bool isValid() const;
|
||||
@ -60,7 +60,7 @@ public:
|
||||
*
|
||||
* @arg filename path to the file to write to
|
||||
**/
|
||||
void write(const QString& filename) const;
|
||||
void write(const QString &filename) const;
|
||||
|
||||
/**
|
||||
* Reads in metadata from a file, which should be a .desktop
|
||||
@ -157,7 +157,7 @@ public:
|
||||
* Set the type of the package. If not defined this
|
||||
* defaults to "Service" in the desktop file.
|
||||
*/
|
||||
void setType(const QString& type);
|
||||
void setType(const QString &type);
|
||||
|
||||
/**
|
||||
* Set the plugin name of the package.
|
||||
@ -168,12 +168,12 @@ public:
|
||||
* QString service = KStandardDirs::locateLocal("services", serviceName + ".desktop");
|
||||
* @endcode
|
||||
*/
|
||||
void setPluginName(const QString& name);
|
||||
void setPluginName(const QString &name);
|
||||
|
||||
/**
|
||||
* Set the implementation API this package uses.
|
||||
*/
|
||||
void setImplementationApi(const QString& api);
|
||||
void setImplementationApi(const QString &api);
|
||||
|
||||
private:
|
||||
PackageMetadataPrivate * const d;
|
||||
|
@ -43,7 +43,7 @@ class ContentStructure
|
||||
{
|
||||
}
|
||||
|
||||
ContentStructure(const ContentStructure& other)
|
||||
ContentStructure(const ContentStructure &other)
|
||||
{
|
||||
path = other.path;
|
||||
name = other.name;
|
||||
@ -59,7 +59,6 @@ class ContentStructure
|
||||
bool required;
|
||||
};
|
||||
|
||||
|
||||
class PackageStructurePrivate
|
||||
{
|
||||
public:
|
||||
@ -104,18 +103,21 @@ PackageStructure::Ptr PackageStructure::load(const QString &packageFormat)
|
||||
|
||||
// first we check for plugins in sycoca
|
||||
QString constraint = QString("[X-KDE-PluginInfo-Name] == '%1'").arg(packageFormat);
|
||||
KService::List offers = KServiceTypeTrader::self()->query("Plasma/PackageStructure", constraint);
|
||||
KService::List offers =
|
||||
KServiceTypeTrader::self()->query("Plasma/PackageStructure", constraint);
|
||||
|
||||
QVariantList args;
|
||||
QString error;
|
||||
foreach (const KService::Ptr &offer, offers) {
|
||||
PackageStructure::Ptr structure(offer->createInstance<Plasma::PackageStructure>(0, args, &error));
|
||||
PackageStructure::Ptr structure(
|
||||
offer->createInstance<Plasma::PackageStructure>(0, args, &error));
|
||||
|
||||
if (structure) {
|
||||
return structure;
|
||||
}
|
||||
|
||||
kDebug() << "Couldn't load PackageStructure for" << packageFormat << "! reason given: " << error;
|
||||
kDebug() << "Couldn't load PackageStructure for" << packageFormat
|
||||
<< "! reason given: " << error;
|
||||
}
|
||||
|
||||
// if that didn't give us any love, then we try to load from a config file
|
||||
@ -152,7 +154,7 @@ PackageStructure::Ptr PackageStructure::load(const QString &packageFormat)
|
||||
return structure;
|
||||
}
|
||||
|
||||
PackageStructure& PackageStructure::operator=(const PackageStructure& rhs)
|
||||
PackageStructure &PackageStructure::operator=(const PackageStructure &rhs)
|
||||
{
|
||||
if (this == &rhs) {
|
||||
return *this;
|
||||
@ -220,7 +222,8 @@ QList<const char*> PackageStructure::requiredFiles() const
|
||||
return files;
|
||||
}
|
||||
|
||||
void PackageStructure::addDirectoryDefinition(const char* key, const QString& path, const QString& name)
|
||||
void PackageStructure::addDirectoryDefinition(const char *key,
|
||||
const QString &path, const QString &name)
|
||||
{
|
||||
ContentStructure s;
|
||||
s.name = name;
|
||||
@ -230,7 +233,7 @@ void PackageStructure::addDirectoryDefinition(const char* key, const QString& pa
|
||||
d->contents[key] = s;
|
||||
}
|
||||
|
||||
void PackageStructure::addFileDefinition(const char* key, const QString& path, const QString& name)
|
||||
void PackageStructure::addFileDefinition(const char *key, const QString &path, const QString &name)
|
||||
{
|
||||
ContentStructure s;
|
||||
s.name = name;
|
||||
@ -240,7 +243,7 @@ void PackageStructure::addFileDefinition(const char* key, const QString& path, c
|
||||
d->contents[key] = s;
|
||||
}
|
||||
|
||||
QString PackageStructure::path(const char* key) const
|
||||
QString PackageStructure::path(const char *key) const
|
||||
{
|
||||
//kDebug() << "looking for" << key;
|
||||
QMap<QByteArray, ContentStructure>::const_iterator it = d->contents.find(key);
|
||||
@ -252,7 +255,7 @@ QString PackageStructure::path(const char* key) const
|
||||
return it.value().path;
|
||||
}
|
||||
|
||||
QString PackageStructure::name(const char* key) const
|
||||
QString PackageStructure::name(const char *key) const
|
||||
{
|
||||
QMap<QByteArray, ContentStructure>::const_iterator it = d->contents.find(key);
|
||||
if (it == d->contents.constEnd()) {
|
||||
@ -262,7 +265,7 @@ QString PackageStructure::name(const char* key) const
|
||||
return it.value().name;
|
||||
}
|
||||
|
||||
void PackageStructure::setRequired(const char* key, bool required)
|
||||
void PackageStructure::setRequired(const char *key, bool required)
|
||||
{
|
||||
QMap<QByteArray, ContentStructure>::iterator it = d->contents.find(key);
|
||||
if (it == d->contents.end()) {
|
||||
@ -272,7 +275,7 @@ void PackageStructure::setRequired(const char* key, bool required)
|
||||
it.value().required = required;
|
||||
}
|
||||
|
||||
bool PackageStructure::isRequired(const char* key) const
|
||||
bool PackageStructure::isRequired(const char *key) const
|
||||
{
|
||||
QMap<QByteArray, ContentStructure>::const_iterator it = d->contents.find(key);
|
||||
if (it == d->contents.constEnd()) {
|
||||
@ -287,7 +290,7 @@ void PackageStructure::setDefaultMimetypes(QStringList mimetypes)
|
||||
d->mimetypes = mimetypes;
|
||||
}
|
||||
|
||||
void PackageStructure::setMimetypes(const char* key, QStringList mimetypes)
|
||||
void PackageStructure::setMimetypes(const char *key, QStringList mimetypes)
|
||||
{
|
||||
QMap<QByteArray, ContentStructure>::iterator it = d->contents.find(key);
|
||||
if (it == d->contents.end()) {
|
||||
@ -297,7 +300,7 @@ void PackageStructure::setMimetypes(const char* key, QStringList mimetypes)
|
||||
it.value().mimetypes = mimetypes;
|
||||
}
|
||||
|
||||
QStringList PackageStructure::mimetypes(const char* key) const
|
||||
QStringList PackageStructure::mimetypes(const char *key) const
|
||||
{
|
||||
QMap<QByteArray, ContentStructure>::const_iterator it = d->contents.find(key);
|
||||
if (it == d->contents.constEnd()) {
|
||||
|
@ -90,7 +90,7 @@ public:
|
||||
/**
|
||||
* Assignment operator
|
||||
**/
|
||||
PackageStructure& operator=(const PackageStructure& rhs);
|
||||
PackageStructure &operator=(const PackageStructure &rhs);
|
||||
|
||||
/**
|
||||
* Loads a package format by name.
|
||||
@ -135,7 +135,7 @@ public:
|
||||
* @param path the path within the package for this directory
|
||||
* @param name the user visible (translated) name for the directory
|
||||
**/
|
||||
void addDirectoryDefinition(const char* key, const QString& path, const QString& name);
|
||||
void addDirectoryDefinition(const char *key, const QString &path, const QString &name);
|
||||
|
||||
/**
|
||||
* Adds a file to the structure of the package. It is added as
|
||||
@ -145,17 +145,17 @@ public:
|
||||
* @param path the path within the package for this file
|
||||
* @param name the user visible (translated) name for the file
|
||||
**/
|
||||
void addFileDefinition(const char* key, const QString& path, const QString& name);
|
||||
void addFileDefinition(const char *key, const QString &path, const QString &name);
|
||||
|
||||
/**
|
||||
* @return path relative to the package root for the given entry
|
||||
**/
|
||||
QString path(const char* key) const;
|
||||
QString path(const char *key) const;
|
||||
|
||||
/**
|
||||
* @return user visible name for the given entry
|
||||
**/
|
||||
QString name(const char* key) const;
|
||||
QString name(const char *key) const;
|
||||
|
||||
/**
|
||||
* Sets whether or not a given part of the structure is required or not.
|
||||
@ -165,12 +165,12 @@ public:
|
||||
* @param path the path of the entry within the package
|
||||
* @param required true if this entry is required, false if not
|
||||
*/
|
||||
void setRequired(const char* key, bool required);
|
||||
void setRequired(const char *key, bool required);
|
||||
|
||||
/**
|
||||
* @return true if the item at path exists and is required
|
||||
**/
|
||||
bool isRequired(const char* key) const;
|
||||
bool isRequired(const char *key) const;
|
||||
|
||||
/**
|
||||
* Defines the default mimetypes for any definitions that do not have
|
||||
@ -189,12 +189,12 @@ public:
|
||||
* @param path the path of the entry within the package
|
||||
* @param mimetypes a list of mimetypes
|
||||
**/
|
||||
void setMimetypes(const char* key, QStringList mimetypes);
|
||||
void setMimetypes(const char *key, QStringList mimetypes);
|
||||
|
||||
/**
|
||||
* @return the mimetypes associated with the path, if any
|
||||
**/
|
||||
QStringList mimetypes(const char* key) const;
|
||||
QStringList mimetypes(const char *key) const;
|
||||
|
||||
/**
|
||||
* Sets the path to the package. Useful for package formats
|
||||
@ -235,7 +235,7 @@ public:
|
||||
* @arg packageRoot path to the directory where the package should be installed to
|
||||
* @return true on successful removal of the package, false otherwise
|
||||
*/
|
||||
virtual bool uninstallPackage(const QString& packageName, const QString& packageRoot);
|
||||
virtual bool uninstallPackage(const QString &packageName, const QString &packageRoot);
|
||||
|
||||
/**
|
||||
* @return the prefix inserted between the base path and content entries
|
||||
|
@ -56,7 +56,7 @@ PLASMA_EXPORT QPixmap shadowText(QString text,
|
||||
/**
|
||||
* Returns a nicely rounded rectanglular path for painting.
|
||||
*/
|
||||
PLASMA_EXPORT QPainterPath roundedRectangle(const QRectF& rect, qreal radius);
|
||||
PLASMA_EXPORT QPainterPath roundedRectangle(const QRectF &rect, qreal radius);
|
||||
|
||||
/**
|
||||
* Blends a pixmap into another
|
||||
|
37
panelsvg.cpp
37
panelsvg.cpp
@ -107,7 +107,7 @@ public:
|
||||
QHash<QString, PanelData*> panels;
|
||||
};
|
||||
|
||||
PanelSvg::PanelSvg(QObject* parent)
|
||||
PanelSvg::PanelSvg(QObject *parent)
|
||||
: Svg(parent),
|
||||
d(new PanelSvgPrivate(this))
|
||||
{
|
||||
@ -120,7 +120,7 @@ PanelSvg::~PanelSvg()
|
||||
delete d;
|
||||
}
|
||||
|
||||
void PanelSvg::setImagePath(const QString& path)
|
||||
void PanelSvg::setImagePath(const QString &path)
|
||||
{
|
||||
if (path == imagePath()) {
|
||||
return;
|
||||
@ -247,7 +247,7 @@ QString PanelSvg::prefix()
|
||||
return d->prefix.left(d->prefix.size() - 1);
|
||||
}
|
||||
|
||||
void PanelSvg::resizePanel(const QSizeF& size)
|
||||
void PanelSvg::resizePanel(const QSizeF &size)
|
||||
{
|
||||
if (size.isEmpty()) {
|
||||
kWarning() << "Invalid size" << size;
|
||||
@ -322,7 +322,8 @@ QRectF PanelSvg::contentsRect() const
|
||||
QRectF rect(QPointF(0, 0), size);
|
||||
PanelData *panel = d->panels[d->prefix];
|
||||
|
||||
return rect.adjusted(panel->leftMargin, panel->topMargin, -panel->rightMargin, -panel->bottomMargin);
|
||||
return rect.adjusted(panel->leftMargin, panel->topMargin,
|
||||
-panel->rightMargin, -panel->bottomMargin);
|
||||
} else {
|
||||
return QRectF();
|
||||
}
|
||||
@ -337,7 +338,8 @@ QBitmap PanelSvg::mask() const
|
||||
d->generateBackground(panel);
|
||||
Q_ASSERT(panel->cachedBackground);
|
||||
}
|
||||
panel->cachedMask = new QBitmap(panel->cachedBackground->alphaChannel().createMaskFromColor(Qt::black));
|
||||
panel->cachedMask =
|
||||
new QBitmap(panel->cachedBackground->alphaChannel().createMaskFromColor(Qt::black));
|
||||
}
|
||||
return *(panel->cachedMask);
|
||||
}
|
||||
@ -382,7 +384,7 @@ QPixmap PanelSvg::panelPixmap()
|
||||
return *panel->cachedBackground;
|
||||
}
|
||||
|
||||
void PanelSvg::paintPanel(QPainter* painter, const QRectF& target, const QRectF& source)
|
||||
void PanelSvg::paintPanel(QPainter *painter, const QRectF &target, const QRectF &source)
|
||||
{
|
||||
PanelData *panel = d->panels[d->prefix];
|
||||
if (!panel->cachedBackground) {
|
||||
@ -393,7 +395,7 @@ void PanelSvg::paintPanel(QPainter* painter, const QRectF& target, const QRectF&
|
||||
painter->drawPixmap(target, *(panel->cachedBackground), source.isValid() ? source : target);
|
||||
}
|
||||
|
||||
void PanelSvg::paintPanel(QPainter* painter, const QPointF& pos)
|
||||
void PanelSvg::paintPanel(QPainter *painter, const QPointF &pos)
|
||||
{
|
||||
PanelData *panel = d->panels[d->prefix];
|
||||
if (!panel->cachedBackground) {
|
||||
@ -436,10 +438,9 @@ void PanelSvgPrivate::generateBackground(PanelData *panel)
|
||||
p.setCompositionMode(QPainter::CompositionMode_Source);
|
||||
p.setRenderHint(QPainter::SmoothPixmapTransform);
|
||||
|
||||
|
||||
//if we must stretch the center or the borders we compute how much we will have to stretch
|
||||
//the svg to get the desired element sizes
|
||||
QSizeF scaledContentSize(0,0);
|
||||
QSizeF scaledContentSize(0, 0);
|
||||
if (q->elementSize(prefix + "center").width() > 0 &&
|
||||
q->elementSize(prefix + "center").height() > 0 &&
|
||||
(!panel->tileCenter || panel->stretchBorders)) {
|
||||
@ -511,32 +512,38 @@ void PanelSvgPrivate::generateBackground(PanelData *panel)
|
||||
if (panel->enabledBorders & PanelSvg::LeftBorder || panel->enabledBorders & PanelSvg::RightBorder) {
|
||||
q->resize(q->size().width(), scaledContentSize.height());
|
||||
|
||||
if (q->hasElement(prefix + "left") && panel->enabledBorders & PanelSvg::LeftBorder) {
|
||||
if (q->hasElement(prefix + "left") &&
|
||||
panel->enabledBorders & PanelSvg::LeftBorder) {
|
||||
q->paint(&p, QRect(leftOffset, contentTop, panel->leftWidth, contentHeight), prefix + "left");
|
||||
}
|
||||
|
||||
if (q->hasElement(prefix + "right") && panel->enabledBorders & PanelSvg::RightBorder) {
|
||||
if (q->hasElement(prefix + "right") &&
|
||||
panel->enabledBorders & PanelSvg::RightBorder) {
|
||||
q->paint(&p, QRect(rightOffset, contentTop, panel->rightWidth, contentHeight), prefix + "right");
|
||||
}
|
||||
|
||||
q->resize();
|
||||
}
|
||||
|
||||
if (panel->enabledBorders & PanelSvg::TopBorder || panel->enabledBorders & PanelSvg::BottomBorder) {
|
||||
if (panel->enabledBorders & PanelSvg::TopBorder ||
|
||||
panel->enabledBorders & PanelSvg::BottomBorder) {
|
||||
q->resize(scaledContentSize.width(), q->size().height());
|
||||
|
||||
if (q->hasElement(prefix + "top") && panel->enabledBorders & PanelSvg::TopBorder) {
|
||||
if (q->hasElement(prefix + "top") &&
|
||||
panel->enabledBorders & PanelSvg::TopBorder) {
|
||||
q->paint(&p, QRect(contentLeft, topOffset, contentWidth, panel->topHeight), prefix + "top");
|
||||
}
|
||||
|
||||
if (q->hasElement(prefix + "bottom") && panel->enabledBorders & PanelSvg::BottomBorder) {
|
||||
if (q->hasElement(prefix + "bottom") &&
|
||||
panel->enabledBorders & PanelSvg::BottomBorder) {
|
||||
q->paint(&p, QRect(contentLeft, bottomOffset, contentWidth, panel->bottomHeight), prefix + "bottom");
|
||||
}
|
||||
|
||||
q->resize();
|
||||
}
|
||||
} else {
|
||||
if (q->hasElement(prefix + "left") && panel->enabledBorders & PanelSvg::LeftBorder) {
|
||||
if (q->hasElement(prefix + "left") &&
|
||||
panel->enabledBorders & PanelSvg::LeftBorder) {
|
||||
QPixmap left(panel->leftWidth, leftHeight);
|
||||
left.fill(Qt::transparent);
|
||||
|
||||
|
36
panelsvg.h
36
panelsvg.h
@ -80,14 +80,14 @@ class PLASMA_EXPORT PanelSvg : public Svg
|
||||
/**
|
||||
* These flags represents what borders should be drawn
|
||||
*/
|
||||
enum EnabledBorder { NoBorder = 0,
|
||||
TopBorder = 1,
|
||||
BottomBorder = 2,
|
||||
LeftBorder = 4,
|
||||
RightBorder = 8,
|
||||
AllBorders = TopBorder | BottomBorder |
|
||||
LeftBorder | RightBorder
|
||||
};
|
||||
enum EnabledBorder {
|
||||
NoBorder = 0,
|
||||
TopBorder = 1,
|
||||
BottomBorder = 2,
|
||||
LeftBorder = 4,
|
||||
RightBorder = 8,
|
||||
AllBorders = TopBorder | BottomBorder | LeftBorder | RightBorder
|
||||
};
|
||||
Q_DECLARE_FLAGS(EnabledBorders, EnabledBorder)
|
||||
|
||||
/**
|
||||
@ -99,14 +99,14 @@ class PLASMA_EXPORT PanelSvg : public Svg
|
||||
*
|
||||
* @related Plasma::Theme
|
||||
*/
|
||||
explicit PanelSvg(QObject* parent = 0);
|
||||
explicit PanelSvg(QObject *parent = 0);
|
||||
~PanelSvg();
|
||||
|
||||
/**
|
||||
* Loads a new Svg
|
||||
* @arg imagePath the new file
|
||||
*/
|
||||
void setImagePath(const QString& path);
|
||||
void setImagePath(const QString &path);
|
||||
|
||||
/**
|
||||
* Sets what borders should be painted
|
||||
@ -124,7 +124,7 @@ class PLASMA_EXPORT PanelSvg : public Svg
|
||||
* Resize the panel maintaining the same border size
|
||||
* @arg size the new size of the panel
|
||||
*/
|
||||
void resizePanel(const QSizeF& size);
|
||||
void resizePanel(const QSizeF &size);
|
||||
|
||||
/**
|
||||
* @returns the size of the panel
|
||||
@ -209,19 +209,19 @@ class PLASMA_EXPORT PanelSvg : public Svg
|
||||
* Sets whether saving all the rendered prefixes in a cache or not
|
||||
* @arg cache if use the cache or not
|
||||
*/
|
||||
void setCacheAllRenderedPanels(bool cache);
|
||||
void setCacheAllRenderedPanels(bool cache);
|
||||
|
||||
/**
|
||||
* @return if all the different prefixes should be kept in a cache when rendered
|
||||
*/
|
||||
bool cacheAllRenderedPanels() const;
|
||||
bool cacheAllRenderedPanels() const;
|
||||
|
||||
/**
|
||||
* Deletes the internal cache freeing memory: use this if you want to switch the rendered
|
||||
* element and you don't plan to switch back to the previous one for a long time and you
|
||||
* used setUseCache(true)
|
||||
*/
|
||||
void clearCache();
|
||||
void clearCache();
|
||||
|
||||
/**
|
||||
* Returns a pixmap of the SVG represented by this object.
|
||||
@ -238,8 +238,8 @@ class PLASMA_EXPORT PanelSvg : public Svg
|
||||
* @arg target the target rectangle on the paint device
|
||||
* @arg source the portion rectangle of the source image
|
||||
*/
|
||||
Q_INVOKABLE void paintPanel(QPainter* painter, const QRectF& target,
|
||||
const QRectF& source = QRectF());
|
||||
Q_INVOKABLE void paintPanel(QPainter *painter, const QRectF &target,
|
||||
const QRectF &source = QRectF());
|
||||
|
||||
/**
|
||||
* Paints the loaded SVG with the elements that represents the border
|
||||
@ -247,10 +247,10 @@ class PLASMA_EXPORT PanelSvg : public Svg
|
||||
* @arg painter the QPainter to use
|
||||
* @arg pos where to paint the svg
|
||||
*/
|
||||
Q_INVOKABLE void paintPanel(QPainter* painter, const QPointF& pos = QPointF(0, 0));
|
||||
Q_INVOKABLE void paintPanel(QPainter *painter, const QPointF &pos = QPointF(0, 0));
|
||||
|
||||
private:
|
||||
PanelSvgPrivate * const d;
|
||||
PanelSvgPrivate *const d;
|
||||
|
||||
Q_PRIVATE_SLOT(d, void updateSizes())
|
||||
Q_PRIVATE_SLOT(d, void updateNeeded())
|
||||
|
228
plasma.h
228
plasma.h
@ -40,16 +40,17 @@ namespace Plasma
|
||||
* objects have managed for them and which they may wish to react to,
|
||||
* for instance in Applet::constraintsUpdated
|
||||
*/
|
||||
enum Constraint { NoConstraint = 0,
|
||||
FormFactorConstraint = 1 /** The FormFactor for an object */,
|
||||
LocationConstraint = 2 /** The Location of an object */,
|
||||
ScreenConstraint = 4 /** Which screen an object is on */,
|
||||
SizeConstraint = 8 /** the size of the applet was changed */,
|
||||
ImmutableConstraint = 16 /** the immutability (locked) nature of the applet changed */,
|
||||
StartupCompletedConstraint = 32 /** application startup has completed */,
|
||||
ContextConstraint = 64 /** the desktop context has changed */,
|
||||
AllConstraints = FormFactorConstraint | LocationConstraint | ScreenConstraint |
|
||||
SizeConstraint | ImmutableConstraint | ContextConstraint
|
||||
enum Constraint {
|
||||
NoConstraint = 0,
|
||||
FormFactorConstraint = 1, /** The FormFactor for an object */
|
||||
LocationConstraint = 2, /** The Location of an object */
|
||||
ScreenConstraint = 4, /** Which screen an object is on */
|
||||
SizeConstraint = 8, /** the size of the applet was changed */
|
||||
ImmutableConstraint = 16, /** the immutability (locked) nature of the applet changed */
|
||||
StartupCompletedConstraint = 32, /** application startup has completed */
|
||||
ContextConstraint = 64, /** the desktop context has changed */
|
||||
AllConstraints = FormFactorConstraint | LocationConstraint | ScreenConstraint |
|
||||
SizeConstraint | ImmutableConstraint | ContextConstraint
|
||||
};
|
||||
Q_DECLARE_FLAGS(Constraints, Constraint)
|
||||
|
||||
@ -58,21 +59,22 @@ Q_DECLARE_FLAGS(Constraints, Constraint)
|
||||
* itself. The value is derived from the container managing the Applet
|
||||
* (e.g. in Plasma, a Corona on the desktop or on a panel).
|
||||
**/
|
||||
enum FormFactor { Planar = 0 /**< The applet lives in a plane and has two
|
||||
degrees of freedom to grow. Optimize for
|
||||
desktop, laptop or tablet usage: a high
|
||||
resolution screen 1-3 feet distant from the
|
||||
viewer. */,
|
||||
MediaCenter /**< As with Planar, the applet lives in a plane
|
||||
but the interface should be optimized for
|
||||
medium-to-high resolution screens that are
|
||||
5-15 feet distant from the viewer. Sometimes
|
||||
referred to as a "ten foot interface".*/,
|
||||
Horizontal /**< The applet is constrained vertically, but
|
||||
can expand horizontally. */,
|
||||
Vertical /**< The applet is constrained horizontally, but
|
||||
can expand vertically. */
|
||||
};
|
||||
enum FormFactor {
|
||||
Planar = 0, /**< The applet lives in a plane and has two
|
||||
degrees of freedom to grow. Optimize for
|
||||
desktop, laptop or tablet usage: a high
|
||||
resolution screen 1-3 feet distant from the
|
||||
viewer. */
|
||||
MediaCenter, /**< As with Planar, the applet lives in a plane
|
||||
but the interface should be optimized for
|
||||
medium-to-high resolution screens that are
|
||||
5-15 feet distant from the viewer. Sometimes
|
||||
referred to as a "ten foot interface".*/
|
||||
Horizontal, /**< The applet is constrained vertically, but
|
||||
can expand horizontally. */
|
||||
Vertical /**< The applet is constrained horizontally, but
|
||||
can expand vertically. */
|
||||
};
|
||||
|
||||
/**
|
||||
* The Direction enumeration describes in which direction, relative to the
|
||||
@ -80,129 +82,157 @@ enum FormFactor { Planar = 0 /**< The applet lives in a plane and has two
|
||||
* message boxes, arrows and other such visually associated widgets should
|
||||
* appear in. This is usually the oposite of the Location.
|
||||
**/
|
||||
enum Direction { Down = 0 /**< Display downards */ ,
|
||||
Up /**< Display upwards */,
|
||||
Left /**< Display to the left */,
|
||||
Right /**< Display to the right */
|
||||
};
|
||||
enum Direction {
|
||||
Down = 0, /**< Display downards */
|
||||
Up, /**< Display upwards */
|
||||
Left, /**< Display to the left */
|
||||
Right /**< Display to the right */
|
||||
};
|
||||
|
||||
/**
|
||||
* The direction of a zoom action.
|
||||
*/
|
||||
enum ZoomDirection { ZoomIn = 0 /**< Zoom in one step */,
|
||||
ZoomOut = 1 /**< Zoom out one step */
|
||||
};
|
||||
enum ZoomDirection {
|
||||
ZoomIn = 0, /**< Zoom in one step */
|
||||
ZoomOut = 1 /**< Zoom out one step */
|
||||
};
|
||||
|
||||
/**
|
||||
* The Location enumeration describes where on screen an element, such as an
|
||||
* Applet or its managing container, is positioned on the screen.
|
||||
**/
|
||||
enum Location { Floating = 0 /**< Free floating. Neither geometry or z-ordering
|
||||
is described precisely by this value. */,
|
||||
Desktop /**< On the planar desktop layer, extending across
|
||||
the full screen from edge to edge */,
|
||||
FullScreen /**< Full screen */,
|
||||
TopEdge /**< Along the top of the screen*/,
|
||||
BottomEdge /**< Along the bottom of the screen*/,
|
||||
LeftEdge /**< Along the left side of the screen */,
|
||||
RightEdge /**< Along the right side of the screen */
|
||||
};
|
||||
enum Location {
|
||||
Floating = 0, /**< Free floating. Neither geometry or z-ordering
|
||||
is described precisely by this value. */
|
||||
Desktop, /**< On the planar desktop layer, extending across
|
||||
the full screen from edge to edge */
|
||||
FullScreen, /**< Full screen */
|
||||
TopEdge, /**< Along the top of the screen*/
|
||||
BottomEdge, /**< Along the bottom of the screen*/
|
||||
LeftEdge, /**< Along the left side of the screen */
|
||||
RightEdge /**< Along the right side of the screen */
|
||||
};
|
||||
|
||||
/**
|
||||
* The position enumeration
|
||||
*
|
||||
**/
|
||||
enum Position { LeftPositioned /**< Positioned left */,
|
||||
RightPositioned /**< Positioned right */,
|
||||
TopPositioned /**< Positioned top */,
|
||||
BottomPositioned /**< Positioned bottom */,
|
||||
CenterPositioned /**< Positioned in the center */
|
||||
};
|
||||
enum Position {
|
||||
LeftPositioned, /**< Positioned left */
|
||||
RightPositioned, /**< Positioned right */
|
||||
TopPositioned, /**< Positioned top */
|
||||
BottomPositioned, /**< Positioned bottom */
|
||||
CenterPositioned /**< Positioned in the center */
|
||||
};
|
||||
|
||||
/**
|
||||
* The popup position enumeration relatively to his attached widget
|
||||
*
|
||||
**/
|
||||
|
||||
enum PopupPlacement { FloatingPopup = 0 /**< Free floating, non attached popup */,
|
||||
TopPosedLeftAlignedPopup /**< Popup positioned on the top, aligned to the left of the wigdet */,
|
||||
TopPosedRightAlignedPopup /**< Popup positioned on the top, aligned to the right of the widget */,
|
||||
LeftPosedTopAlignedPopup /**< Popup positioned on the left, aligned to the right of the wigdet */,
|
||||
LeftPosedBottomAlignedPopup /**< Popup positioned on the left, aligned to the bottom of the widget */,
|
||||
BottomPosedLeftAlignedPopup /**< Popup positioned on the bottom, aligned to the left of the wigdet */,
|
||||
BottomPosedRightAlignedPopup /**< Popup positioned on the bottom, aligned to the right of the widget */,
|
||||
RightPosedTopAlignedPopup /**< Popup positioned on the right, aligned to the top of the wigdet */,
|
||||
RightPosedBottomAlignedPopup /**< Popup positioned on the right, aligned to the bottom of the widget */
|
||||
};
|
||||
enum PopupPlacement {
|
||||
FloatingPopup = 0, /**< Free floating, non attached popup */
|
||||
TopPosedLeftAlignedPopup, /**< Popup positioned on the top, aligned
|
||||
to the left of the wigdet */
|
||||
TopPosedRightAlignedPopup, /**< Popup positioned on the top, aligned
|
||||
to the right of the widget */
|
||||
LeftPosedTopAlignedPopup, /**< Popup positioned on the left, aligned
|
||||
to the right of the wigdet */
|
||||
LeftPosedBottomAlignedPopup, /**< Popup positioned on the left, aligned
|
||||
to the bottom of the widget */
|
||||
BottomPosedLeftAlignedPopup, /**< Popup positioned on the bottom, aligned
|
||||
to the left of the wigdet */
|
||||
BottomPosedRightAlignedPopup, /**< Popup positioned on the bottom, aligned
|
||||
to the right of the widget */
|
||||
RightPosedTopAlignedPopup, /**< Popup positioned on the right, aligned
|
||||
to the top of the wigdet */
|
||||
RightPosedBottomAlignedPopup /**< Popup positioned on the right, aligned
|
||||
to the bottom of the widget */
|
||||
};
|
||||
|
||||
/**
|
||||
* Flip enumeration
|
||||
*/
|
||||
enum FlipDirection { NoFlip = 0 /**< Do not flip */,
|
||||
HorizontalFlip = 1 /**< Flip horizontally */,
|
||||
VerticalFlip = 2 /**< Flip vertically */
|
||||
};
|
||||
enum FlipDirection {
|
||||
NoFlip = 0, /**< Do not flip */
|
||||
HorizontalFlip = 1, /**< Flip horizontally */
|
||||
VerticalFlip = 2 /**< Flip vertically */
|
||||
};
|
||||
Q_DECLARE_FLAGS(Flip, FlipDirection)
|
||||
|
||||
/**
|
||||
* Zoom levels that Plasma is aware of...
|
||||
**/
|
||||
enum ZoomLevel { DesktopZoom = 0 /**< Normal desktop usage, plasmoids are painted normally and have full interaction */,
|
||||
GroupZoom /**< Plasmoids are shown as icons in visual groups; drag and drop and limited context menu interaction only */ ,
|
||||
OverviewZoom /**< Groups become icons themselves */
|
||||
};
|
||||
enum ZoomLevel {
|
||||
DesktopZoom = 0, /**< Normal desktop usage, plasmoids are painted normally
|
||||
and have full interaction */
|
||||
GroupZoom, /**< Plasmoids are shown as icons in visual groups; drag
|
||||
and drop and limited context menu interaction only */
|
||||
OverviewZoom /**< Groups become icons themselves */
|
||||
};
|
||||
|
||||
/**
|
||||
* Possible timing alignments
|
||||
**/
|
||||
enum IntervalAlignment { NoAlignment = 0,
|
||||
AlignToMinute,
|
||||
AlignToHour };
|
||||
enum IntervalAlignment {
|
||||
NoAlignment = 0,
|
||||
AlignToMinute,
|
||||
AlignToHour
|
||||
};
|
||||
|
||||
|
||||
enum ItemTypes { AppletType = QGraphicsItem::UserType + 1,
|
||||
LineEditType = QGraphicsItem::UserType + 2
|
||||
};
|
||||
enum ItemTypes {
|
||||
AppletType = QGraphicsItem::UserType + 1,
|
||||
LineEditType = QGraphicsItem::UserType + 2
|
||||
};
|
||||
|
||||
/**
|
||||
* Defines the immutability of items like applets, corona and containments
|
||||
* they can be free to modify, locked down by the user or locked down by the system (e.g. kiosk setups)
|
||||
* they can be free to modify, locked down by the user or locked down by the
|
||||
* system (e.g. kiosk setups).
|
||||
*/
|
||||
enum ImmutabilityType { Mutable = 1 /**< The item can be modified in any way **/,
|
||||
UserImmutable = 2 /**< The user has requested a lock down, and can undo the lock down at any time **/,
|
||||
SystemImmutable = 4 /**< the item is locked down by the system, the user can't unlock it **/
|
||||
|
||||
};
|
||||
enum ImmutabilityType {
|
||||
Mutable = 1, /**< The item can be modified in any way **/
|
||||
UserImmutable = 2, /**< The user has requested a lock down, and can undo
|
||||
the lock down at any time **/
|
||||
SystemImmutable = 4 /**< the item is locked down by the system, the user
|
||||
can't unlock it **/
|
||||
};
|
||||
|
||||
/**
|
||||
* Defines the aspect ratio used when scaling an applet
|
||||
*/
|
||||
enum AspectRatioMode { InvalidAspectRatioMode = -1 /**< Unsetted mode used for dev convenience when there is a need to store the
|
||||
aspectRatioMode somewhere */,
|
||||
IgnoreAspectRatio = 0 /**< The applet can be freely resized */,
|
||||
KeepAspectRatio = 1 /**< The applet keeps a fixed aspect ratio */,
|
||||
Square = 2 /**< The applet is always a square */,
|
||||
ConstrainedSquare = 3 /** The applet is no wider (in horizontal formfactors) or no higher (in vertical ones) than a square */,
|
||||
FixedSize = 4 /** The applet cannot be resized */
|
||||
};
|
||||
enum AspectRatioMode {
|
||||
InvalidAspectRatioMode = -1, /**< Unsetted mode used for dev convenience
|
||||
when there is a need to store the
|
||||
aspectRatioMode somewhere */
|
||||
IgnoreAspectRatio = 0, /**< The applet can be freely resized */
|
||||
KeepAspectRatio = 1, /**< The applet keeps a fixed aspect ratio */
|
||||
Square = 2, /**< The applet is always a square */
|
||||
ConstrainedSquare = 3, /**< The applet is no wider (in horizontal
|
||||
formfactors) or no higher (in vertical
|
||||
ones) than a square */
|
||||
FixedSize = 4 /** The applet cannot be resized */
|
||||
};
|
||||
|
||||
/**
|
||||
* The ComonentType enumeration refers to the various types of components,
|
||||
* or plugins, supported by plasma.
|
||||
*/
|
||||
enum ComponentType { AppletComponent = 1 /**< Plasma::Applet based plugins **/,
|
||||
DataEngineComponent = 2 /**< Plasma::DataEngine based plugins **/,
|
||||
RunnerComponent = 4 /**< Plasma::AbstractRunner based plugsin **/,
|
||||
AnimatorComponent = 8 /**< Plasma::Animator based plugins **/,
|
||||
ContainmentComponent = 16 /**< Plasma::Containment based plugins **/
|
||||
};
|
||||
enum ComponentType {
|
||||
AppletComponent = 1, /**< Plasma::Applet based plugins **/
|
||||
DataEngineComponent = 2, /**< Plasma::DataEngine based plugins **/
|
||||
RunnerComponent = 4, /**< Plasma::AbstractRunner based plugsin **/
|
||||
AnimatorComponent = 8, /**< Plasma::Animator based plugins **/
|
||||
ContainmentComponent = 16 /**< Plasma::Containment based plugins **/
|
||||
};
|
||||
Q_DECLARE_FLAGS(ComponentTypes, ComponentType)
|
||||
|
||||
enum MarginEdge { TopMargin = 0,
|
||||
BottomMargin,
|
||||
LeftMargin,
|
||||
RightMargin
|
||||
};
|
||||
enum MarginEdge {
|
||||
TopMargin = 0,
|
||||
BottomMargin,
|
||||
LeftMargin,
|
||||
RightMargin
|
||||
};
|
||||
|
||||
/**
|
||||
* @return the scaling factor (0..1) for a ZoomLevel
|
||||
|
@ -95,11 +95,13 @@ public:
|
||||
Plasma::PopupPlacement popupPlacement() const;
|
||||
|
||||
/**
|
||||
* This event handler can be reimplemented in a subclass to receive an event before the popup is shown or hidden.
|
||||
* @arg show true if the popup is going to be shown, false if the popup is going to be hidden.
|
||||
* This event handler can be reimplemented in a subclass to receive an
|
||||
* event before the popup is shown or hidden.
|
||||
* @arg show true if the popup is going to be shown, false if the popup
|
||||
* is going to be hidden.
|
||||
* Note that showing and hiding the popup on click is already done in PopupApplet.
|
||||
*/
|
||||
virtual void popupEvent(bool show);
|
||||
virtual void popupEvent(bool show);
|
||||
|
||||
public Q_SLOTS:
|
||||
/**
|
||||
|
45
querymatch.h
45
querymatch.h
@ -47,21 +47,22 @@ class PLASMA_EXPORT QueryMatch
|
||||
/**
|
||||
* The type of match. Value is important here as it is used for sorting
|
||||
*/
|
||||
enum Type { NoMatch = 0 /**< Null match */,
|
||||
CompletionMatch = 10 /**< Possible completion for the data of the query */,
|
||||
PossibleMatch = 30 /**< Something that may match the query */,
|
||||
InformationalMatch = 50 /**< A purely informational, non-actionable match,
|
||||
such as the answer to a question or calculation*/,
|
||||
HelperMatch = 70 /**< A match that represents an action not directly related
|
||||
to activating the given search term, such as a search
|
||||
in an external tool or a command learning trigger. Helper
|
||||
matches tend to be generic to the query and should not
|
||||
be autoactivated just because the user hits "Enter"
|
||||
while typing. They must be explicitly selected to
|
||||
be activated, but unlike InformationalMatch cause
|
||||
an action to be triggered. */,
|
||||
ExactMatch = 100 /**< An exact match to the query */};
|
||||
|
||||
enum Type {
|
||||
NoMatch = 0, /**< Null match */
|
||||
CompletionMatch = 10, /**< Possible completion for the data of the query */
|
||||
PossibleMatch = 30, /**< Something that may match the query */
|
||||
InformationalMatch = 50, /**< A purely informational, non-actionable match,
|
||||
such as the answer to a question or calculation*/
|
||||
HelperMatch = 70, /**< A match that represents an action not directly related
|
||||
to activating the given search term, such as a search
|
||||
in an external tool or a command learning trigger. Helper
|
||||
matches tend to be generic to the query and should not
|
||||
be autoactivated just because the user hits "Enter"
|
||||
while typing. They must be explicitly selected to
|
||||
be activated, but unlike InformationalMatch cause
|
||||
an action to be triggered. */
|
||||
ExactMatch = 100 /**< An exact match to the query */
|
||||
};
|
||||
|
||||
/**
|
||||
* Constructs a PossibleMatch associated with a given RunnerContext
|
||||
@ -110,7 +111,7 @@ class PLASMA_EXPORT QueryMatch
|
||||
/**
|
||||
* The runner associated with this action
|
||||
*/
|
||||
AbstractRunner* runner() const;
|
||||
AbstractRunner *runner() const;
|
||||
|
||||
/**
|
||||
* A string that can be used as an ID for this match,
|
||||
@ -128,8 +129,8 @@ class PLASMA_EXPORT QueryMatch
|
||||
QIcon icon() const;
|
||||
bool isEnabled() const;
|
||||
|
||||
bool operator<(const QueryMatch& other) const;
|
||||
QueryMatch& operator=(const QueryMatch &other);
|
||||
bool operator<(const QueryMatch &other) const;
|
||||
QueryMatch &operator=(const QueryMatch &other);
|
||||
|
||||
/**
|
||||
* Requests this match to activae using the given context
|
||||
@ -147,7 +148,7 @@ class PLASMA_EXPORT QueryMatch
|
||||
* as an id, the runner may generate its own id and set that
|
||||
* with setId(const QString&) directly after calling setData
|
||||
*/
|
||||
void setData(const QVariant& data);
|
||||
void setData(const QVariant &data);
|
||||
|
||||
/**
|
||||
* Sets the id for this match; useful if the id does not
|
||||
@ -160,9 +161,9 @@ class PLASMA_EXPORT QueryMatch
|
||||
*/
|
||||
void setId(const QString &id);
|
||||
|
||||
void setText(const QString& text);
|
||||
void setSubtext(const QString& text);
|
||||
void setIcon(const QIcon& icon);
|
||||
void setText(const QString &text);
|
||||
void setSubtext(const QString &text);
|
||||
void setIcon(const QIcon &icon);
|
||||
void setEnabled(bool enable);
|
||||
|
||||
private:
|
||||
|
@ -47,16 +47,17 @@ class PLASMA_EXPORT RunnerContext : public QObject
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
enum Type { None = 0,
|
||||
UnknownType = 1,
|
||||
Directory = 2,
|
||||
File = 4,
|
||||
NetworkLocation = 8,
|
||||
Executable = 16,
|
||||
ShellCommand = 32,
|
||||
Help = 64,
|
||||
FileSystem = Directory | File | Executable | ShellCommand
|
||||
};
|
||||
enum Type {
|
||||
None = 0,
|
||||
UnknownType = 1,
|
||||
Directory = 2,
|
||||
File = 4,
|
||||
NetworkLocation = 8,
|
||||
Executable = 16,
|
||||
ShellCommand = 32,
|
||||
Help = 64,
|
||||
FileSystem = Directory | File | Executable | ShellCommand
|
||||
};
|
||||
|
||||
Q_DECLARE_FLAGS(Types, Type)
|
||||
|
||||
@ -65,11 +66,10 @@ class PLASMA_EXPORT RunnerContext : public QObject
|
||||
/**
|
||||
* Copy constructor
|
||||
*/
|
||||
explicit RunnerContext(RunnerContext& other, QObject *parent = 0);
|
||||
explicit RunnerContext(RunnerContext &other, QObject *parent = 0);
|
||||
|
||||
~RunnerContext();
|
||||
|
||||
|
||||
/**
|
||||
* Resets the search term for this object.
|
||||
* This removes all current matches in the process.
|
||||
@ -80,7 +80,7 @@ class PLASMA_EXPORT RunnerContext : public QObject
|
||||
* Sets the query term for this object and attempts to determine
|
||||
* the type of the search.
|
||||
*/
|
||||
void setQuery(const QString& term);
|
||||
void setQuery(const QString &term);
|
||||
|
||||
/**
|
||||
* @return the current search query term.
|
||||
@ -110,7 +110,7 @@ class PLASMA_EXPORT RunnerContext : public QObject
|
||||
*
|
||||
* @return true if matches were added, false if matches were e.g. outdated
|
||||
*/
|
||||
bool addMatches(const QString& term, const QList<QueryMatch> &matches);
|
||||
bool addMatches(const QString &term, const QList<QueryMatch> &matches);
|
||||
|
||||
/**
|
||||
* Appends a match to the existing list of matches.
|
||||
|
@ -59,7 +59,7 @@ class RunnerRestrictionPolicy : public ThreadWeaver::QueuePolicy
|
||||
public:
|
||||
~RunnerRestrictionPolicy();
|
||||
|
||||
static RunnerRestrictionPolicy& instance();
|
||||
static RunnerRestrictionPolicy &instance();
|
||||
|
||||
void setCap(int cap)
|
||||
{
|
||||
@ -93,7 +93,7 @@ RunnerRestrictionPolicy::~RunnerRestrictionPolicy()
|
||||
{
|
||||
}
|
||||
|
||||
RunnerRestrictionPolicy& RunnerRestrictionPolicy::instance()
|
||||
RunnerRestrictionPolicy &RunnerRestrictionPolicy::instance()
|
||||
{
|
||||
static RunnerRestrictionPolicy policy;
|
||||
return policy;
|
||||
@ -138,7 +138,7 @@ public:
|
||||
FindMatchesJob(Plasma::AbstractRunner *runner, Plasma::RunnerContext *context, QObject *parent = 0);
|
||||
|
||||
int priority() const;
|
||||
Plasma::AbstractRunner* runner() const;
|
||||
Plasma::AbstractRunner *runner() const;
|
||||
|
||||
protected:
|
||||
void run();
|
||||
@ -169,7 +169,7 @@ int FindMatchesJob::priority() const
|
||||
return m_runner->priority();
|
||||
}
|
||||
|
||||
Plasma::AbstractRunner* FindMatchesJob::runner() const
|
||||
Plasma::AbstractRunner *FindMatchesJob::runner() const
|
||||
{
|
||||
return m_runner;
|
||||
}
|
||||
@ -208,7 +208,7 @@ public:
|
||||
//The number of threads used scales with the number of processors.
|
||||
const int numProcs = qMax(Solid::Device::listFromType(Solid::DeviceInterface::Processor).count(), 1);
|
||||
//This entry allows to define a hard upper limit independent of the number of processors.
|
||||
const int maxThreads = config.readEntry("maxThreads",16);
|
||||
const int maxThreads = config.readEntry("maxThreads", 16);
|
||||
const int numThreads = qMin(maxThreads, 2 + ((numProcs - 1) * 2));
|
||||
//kDebug() << "setting up" << numThreads << "threads for" << numProcs << "processors";
|
||||
Weaver::instance()->setMaximumNumberOfThreads(numThreads);
|
||||
@ -339,7 +339,7 @@ void RunnerManager::reloadConfiguration()
|
||||
d->loadRunners();
|
||||
}
|
||||
|
||||
AbstractRunner* RunnerManager::runner(const QString &name) const
|
||||
AbstractRunner *RunnerManager::runner(const QString &name) const
|
||||
{
|
||||
if (d->runners.isEmpty()) {
|
||||
d->loadRunners();
|
||||
@ -348,7 +348,7 @@ AbstractRunner* RunnerManager::runner(const QString &name) const
|
||||
return d->runners.value(name);
|
||||
}
|
||||
|
||||
RunnerContext* RunnerManager::searchContext() const
|
||||
RunnerContext *RunnerManager::searchContext() const
|
||||
{
|
||||
return &d->context;
|
||||
}
|
||||
|
@ -47,7 +47,6 @@ class PLASMA_EXPORT RunnerManager : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
||||
public:
|
||||
explicit RunnerManager(QObject *parent=0);
|
||||
explicit RunnerManager(KConfigGroup &config, QObject *parent=0);
|
||||
@ -58,13 +57,13 @@ class PLASMA_EXPORT RunnerManager : public QObject
|
||||
* @arg name the name of the runner
|
||||
* @return Pointer to the runner
|
||||
*/
|
||||
AbstractRunner* runner(const QString &name) const;
|
||||
AbstractRunner *runner(const QString &name) const;
|
||||
|
||||
/**
|
||||
* Retrieves the current context
|
||||
* @return pointer to the current context
|
||||
*/
|
||||
RunnerContext* searchContext() const;
|
||||
RunnerContext *searchContext() const;
|
||||
|
||||
/**
|
||||
* Retrieves all available matches found so far for the previously launched query
|
||||
@ -76,13 +75,13 @@ class PLASMA_EXPORT RunnerManager : public QObject
|
||||
* Runs a given match
|
||||
* @arg match the match to be executed
|
||||
*/
|
||||
void run(const QueryMatch &match);
|
||||
void run(const QueryMatch &match);
|
||||
|
||||
/**
|
||||
* Runs a given match
|
||||
* @arg id the id of the match to run
|
||||
*/
|
||||
void run(const QString &id);
|
||||
void run(const QString &id);
|
||||
|
||||
/**
|
||||
* @return the current query term
|
||||
|
@ -88,7 +88,7 @@ public:
|
||||
*
|
||||
* @return a Service object, guaranteed to be not null.
|
||||
*/
|
||||
static Service* load(const QString &name, QObject *parent = 0);
|
||||
static Service *load(const QString &name, QObject *parent = 0);
|
||||
|
||||
/**
|
||||
* Sets the destination for this Service to operate on
|
||||
@ -123,7 +123,7 @@ public:
|
||||
* @return a started ServiceJob; the consumer may connect to relevant
|
||||
* signals before returning to the event loop
|
||||
*/
|
||||
ServiceJob* startOperationCall(const KConfigGroup &description, QObject *parent = 0);
|
||||
ServiceJob *startOperationCall(const KConfigGroup &description, QObject *parent = 0);
|
||||
|
||||
/**
|
||||
* Query to find if an operation is enabled or not.
|
||||
@ -186,7 +186,7 @@ Q_SIGNALS:
|
||||
/**
|
||||
* Emitted when a job associated with this Service completes its task
|
||||
*/
|
||||
void finished(Plasma::ServiceJob* job);
|
||||
void finished(Plasma::ServiceJob *job);
|
||||
|
||||
/**
|
||||
* Emitted when the Service's operations change. For example, a
|
||||
@ -215,7 +215,7 @@ protected:
|
||||
* @param parameters the parameters set by the user for the operation
|
||||
* @return a ServiceJob that can be started and monitored by the consumer
|
||||
*/
|
||||
virtual ServiceJob* createJob(const QString &operation,
|
||||
virtual ServiceJob *createJob(const QString &operation,
|
||||
QMap<QString, QVariant> ¶meters) = 0;
|
||||
|
||||
/**
|
||||
|
@ -41,7 +41,7 @@ public:
|
||||
q->start();
|
||||
}
|
||||
|
||||
ServiceJob* q;
|
||||
ServiceJob *q;
|
||||
QString destination;
|
||||
QString operation;
|
||||
QMap<QString, QVariant> parameters;
|
||||
|
12
svg.cpp
12
svg.cpp
@ -356,12 +356,12 @@ QSize Svg::size() const
|
||||
return d->size.toSize();
|
||||
}
|
||||
|
||||
void Svg::resize( qreal width, qreal height )
|
||||
void Svg::resize(qreal width, qreal height)
|
||||
{
|
||||
resize( QSize( width, height ) );
|
||||
resize(QSize(width, height));
|
||||
}
|
||||
|
||||
void Svg::resize( const QSizeF& size )
|
||||
void Svg::resize(const QSizeF &size)
|
||||
{
|
||||
d->createRenderer();
|
||||
d->size = size;
|
||||
@ -373,17 +373,17 @@ void Svg::resize()
|
||||
d->size = d->renderer->defaultSize();
|
||||
}
|
||||
|
||||
QSize Svg::elementSize(const QString& elementId) const
|
||||
QSize Svg::elementSize(const QString &elementId) const
|
||||
{
|
||||
return d->elementSize(elementId);
|
||||
}
|
||||
|
||||
QRectF Svg::elementRect(const QString& elementId) const
|
||||
QRectF Svg::elementRect(const QString &elementId) const
|
||||
{
|
||||
return d->elementRect(elementId);
|
||||
}
|
||||
|
||||
bool Svg::hasElement(const QString& elementId) const
|
||||
bool Svg::hasElement(const QString &elementId) const
|
||||
{
|
||||
d->createRenderer();
|
||||
return d->renderer->elementExists(elementId);
|
||||
|
13
svg.h
13
svg.h
@ -75,10 +75,9 @@ class PLASMA_EXPORT Svg : public QObject
|
||||
*
|
||||
* @related Plasma::Theme
|
||||
*/
|
||||
explicit Svg(QObject* parent = 0);
|
||||
explicit Svg(QObject *parent = 0);
|
||||
~Svg();
|
||||
|
||||
|
||||
/**
|
||||
* Returns a pixmap of the SVG represented by this object.
|
||||
*
|
||||
@ -140,7 +139,7 @@ class PLASMA_EXPORT Svg : public QObject
|
||||
* the next call to paint.
|
||||
* @arg size the new size of the image
|
||||
**/
|
||||
Q_INVOKABLE void resize( const QSizeF& size );
|
||||
Q_INVOKABLE void resize(const QSizeF &size);
|
||||
|
||||
/**
|
||||
* Resizes the rendered image to the natural size of the SVG.
|
||||
@ -153,21 +152,21 @@ class PLASMA_EXPORT Svg : public QObject
|
||||
* @arg elementId the id of the element to check
|
||||
* @return the current size of a given element, given the current size of the Svg
|
||||
**/
|
||||
Q_INVOKABLE QSize elementSize( const QString& elementId ) const;
|
||||
Q_INVOKABLE QSize elementSize(const QString &elementId) const;
|
||||
|
||||
/**
|
||||
* The bounding rect of a given element
|
||||
* @arg elementId the id of the element to check
|
||||
* @return the current rect of a given element, given the current size of the Svg
|
||||
**/
|
||||
Q_INVOKABLE QRectF elementRect(const QString& elementId) const;
|
||||
Q_INVOKABLE QRectF elementRect(const QString &elementId) const;
|
||||
|
||||
/**
|
||||
* Check when an element exists in the loaded Svg
|
||||
* @arg elementId the id of the element to check
|
||||
* @return true if the element is defined in the Svg, otherwise false
|
||||
**/
|
||||
Q_INVOKABLE bool hasElement( const QString& elementId ) const;
|
||||
Q_INVOKABLE bool hasElement(const QString &elementId) const;
|
||||
|
||||
/**
|
||||
* Returns the element (by id) at the given point. An empty string is
|
||||
@ -209,7 +208,7 @@ class PLASMA_EXPORT Svg : public QObject
|
||||
void repaintNeeded();
|
||||
|
||||
private:
|
||||
SvgPrivate* const d;
|
||||
SvgPrivate *const d;
|
||||
|
||||
Q_PRIVATE_SLOT(d, void themeChanged())
|
||||
Q_PRIVATE_SLOT(d, void colorsChanged())
|
||||
|
31
theme.h
31
theme.h
@ -55,33 +55,32 @@ class ThemePrivate;
|
||||
class PLASMA_EXPORT Theme : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY( QString themeName READ themeName )
|
||||
Q_PROPERTY(QString themeName READ themeName)
|
||||
|
||||
public:
|
||||
enum ColorRole
|
||||
{
|
||||
TextColor = 0 /**< the text color to be used by items resting on the background */,
|
||||
HighlightColor = 1 /**< the text higlight color to be used by items resting on the background */,
|
||||
BackgroundColor = 2 /**< the default background color */,
|
||||
ButtonTextColor = 4 /** text color for buttons */,
|
||||
enum ColorRole {
|
||||
TextColor = 0, /**< the text color to be used by items resting on the background */
|
||||
HighlightColor = 1, /**< the text higlight color to be used by items resting
|
||||
on the background */
|
||||
BackgroundColor = 2, /**< the default background color */
|
||||
ButtonTextColor = 4, /** text color for buttons */
|
||||
ButtonBackgroundColor = 8 /** background color for buttons*/
|
||||
};
|
||||
|
||||
enum FontRole
|
||||
{
|
||||
DefaultFont = 0 /**< The standard text font */,
|
||||
enum FontRole {
|
||||
DefaultFont = 0, /**< The standard text font */
|
||||
DesktopFont /**< The standard text font */
|
||||
};
|
||||
|
||||
/**
|
||||
* Singleton pattern accessor
|
||||
**/
|
||||
static Theme* defaultTheme();
|
||||
static Theme *defaultTheme();
|
||||
|
||||
/**
|
||||
* Default constructor. Usually you want to use the singleton instead.
|
||||
*/
|
||||
explicit Theme( QObject* parent = 0 );
|
||||
explicit Theme(QObject *parent = 0);
|
||||
~Theme();
|
||||
|
||||
/**
|
||||
@ -106,7 +105,7 @@ class PLASMA_EXPORT Theme : public QObject
|
||||
* ".svg" part or a leading slash)
|
||||
* @return the full path to the requested file for the current theme
|
||||
*/
|
||||
Q_INVOKABLE QString imagePath(const QString& name) const;
|
||||
Q_INVOKABLE QString imagePath(const QString &name) const;
|
||||
|
||||
/**
|
||||
* Retreives the default wallpaper associated with this theme.
|
||||
@ -115,7 +114,7 @@ class PLASMA_EXPORT Theme : public QObject
|
||||
* is passed in, then a default size will be provided instead.
|
||||
* @return the full path to the wallpaper image
|
||||
*/
|
||||
Q_INVOKABLE QString wallpaperPath(const QSize &size = QSize()) const;
|
||||
Q_INVOKABLE QString wallpaperPath(const QSize &size = QSize()) const;
|
||||
|
||||
/**
|
||||
* Checks if this theme has an image named in a certain way
|
||||
@ -124,7 +123,7 @@ class PLASMA_EXPORT Theme : public QObject
|
||||
* ".svg" part or a leading slash)
|
||||
* @return true if the image exists for this theme
|
||||
*/
|
||||
Q_INVOKABLE bool currentThemeHasImage(const QString& name) const;
|
||||
Q_INVOKABLE bool currentThemeHasImage(const QString &name) const;
|
||||
|
||||
/**
|
||||
* Returns the color scheme configurationthat goes along this theme.
|
||||
@ -197,7 +196,7 @@ class PLASMA_EXPORT Theme : public QObject
|
||||
private:
|
||||
friend class ThemeSingleton;
|
||||
friend class ThemePrivate;
|
||||
ThemePrivate* const d;
|
||||
ThemePrivate *const d;
|
||||
|
||||
Q_PRIVATE_SLOT(d, void compositingChanged())
|
||||
};
|
||||
|
@ -103,7 +103,7 @@ public:
|
||||
*
|
||||
* You should normall use self() instead.
|
||||
*/
|
||||
explicit ToolTipManager(QObject* parent = 0);
|
||||
explicit ToolTipManager(QObject *parent = 0);
|
||||
|
||||
/**
|
||||
* Default destructor.
|
||||
@ -211,7 +211,7 @@ private:
|
||||
friend class ToolTipManagerSingleton;
|
||||
bool eventFilter(QObject *watched, QEvent *event);
|
||||
|
||||
ToolTipManagerPrivate* const d;
|
||||
ToolTipManagerPrivate *const d;
|
||||
Q_PRIVATE_SLOT(d, void showToolTip())
|
||||
Q_PRIVATE_SLOT(d, void resetShownState())
|
||||
Q_PRIVATE_SLOT(d, void onWidgetDestroyed(QObject*))
|
||||
|
34
uiloader.cpp
34
uiloader.cpp
@ -44,9 +44,9 @@ public:
|
||||
QStringList layouts;
|
||||
};
|
||||
|
||||
UiLoader::UiLoader( QObject *parent )
|
||||
: QObject( parent ),
|
||||
d( new UiLoaderPrivate() )
|
||||
UiLoader::UiLoader(QObject *parent)
|
||||
: QObject(parent),
|
||||
d(new UiLoaderPrivate())
|
||||
{
|
||||
d->widgets
|
||||
<< "CheckBox"
|
||||
@ -74,46 +74,46 @@ QStringList UiLoader::availableWidgets() const
|
||||
return d->widgets;
|
||||
}
|
||||
|
||||
QGraphicsWidget *UiLoader::createWidget( const QString &className, QGraphicsWidget *parent )
|
||||
QGraphicsWidget *UiLoader::createWidget(const QString &className, QGraphicsWidget *parent)
|
||||
{
|
||||
if (className == QString("CheckBox")) {
|
||||
return new CheckBox( parent );
|
||||
return new CheckBox(parent);
|
||||
}
|
||||
else if (className == QString("ComboBox")) {
|
||||
return new ComboBox( parent );
|
||||
return new ComboBox(parent);
|
||||
}
|
||||
else if (className == QString("Flash")) {
|
||||
return new Flash( parent );
|
||||
return new Flash(parent);
|
||||
}
|
||||
else if (className == QString("Frame")) {
|
||||
return new Frame( parent );
|
||||
return new Frame(parent);
|
||||
}
|
||||
else if (className == QString("GroupBox")) {
|
||||
return new GroupBox( parent );
|
||||
return new GroupBox(parent);
|
||||
}
|
||||
else if (className == QString("Icon")) {
|
||||
return new Icon( parent );
|
||||
return new Icon(parent);
|
||||
}
|
||||
else if (className == QString("Label")) {
|
||||
return new Label( parent );
|
||||
return new Label(parent);
|
||||
}
|
||||
else if (className == QString("LineEdit")) {
|
||||
return new LineEdit( parent );
|
||||
return new LineEdit(parent);
|
||||
}
|
||||
else if (className == QString("PushButton")) {
|
||||
return new PushButton( parent );
|
||||
return new PushButton(parent);
|
||||
}
|
||||
else if (className == QString("RadioButton")) {
|
||||
return new RadioButton( parent );
|
||||
return new RadioButton(parent);
|
||||
}
|
||||
else if (className == QString("Slider")) {
|
||||
return new Slider( parent );
|
||||
return new Slider(parent);
|
||||
}
|
||||
else if (className == QString("TabBar")) {
|
||||
return new TabBar( parent );
|
||||
return new TabBar(parent);
|
||||
}
|
||||
else if (className == QString("TextEdit")) {
|
||||
return new TextEdit( parent );
|
||||
return new TextEdit(parent);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@ -43,7 +43,7 @@
|
||||
* Compile time macro for the version number of libplasma
|
||||
*/
|
||||
#define PLASMA_VERSION \
|
||||
PLASMA_MAKE_VERSION(PLASMA_VERSION_MAJOR,PLASMA_VERSION_MINOR,PLASMA_VERSION_RELEASE)
|
||||
PLASMA_MAKE_VERSION(PLASMA_VERSION_MAJOR, PLASMA_VERSION_MINOR, PLASMA_VERSION_RELEASE)
|
||||
|
||||
/**
|
||||
* Compile-time macro for checking the plasma version. Not useful for
|
||||
@ -87,7 +87,6 @@ PLASMA_EXPORT const char *versionString();
|
||||
*/
|
||||
PLASMA_EXPORT bool isPluginVersionCompatible(unsigned int version);
|
||||
|
||||
|
||||
} // Plasma namespace
|
||||
|
||||
#endif // multiple inclusion guard
|
||||
|
9
view.cpp
9
view.cpp
@ -128,7 +128,6 @@ View::View(Containment *containment, int viewId, QWidget *parent)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
View::~View()
|
||||
{
|
||||
delete d;
|
||||
@ -240,15 +239,15 @@ void View::setContainment(Plasma::Containment *containment)
|
||||
connect(containment, SIGNAL(geometryChanged()), this, SLOT(updateSceneRect()));
|
||||
}
|
||||
|
||||
Containment* View::containment() const
|
||||
Containment *View::containment() const
|
||||
{
|
||||
return d->containment;
|
||||
}
|
||||
|
||||
Containment* View::swapContainment(const QString& name, const QVariantList& args)
|
||||
Containment *View::swapContainment(const QString &name, const QVariantList &args)
|
||||
{
|
||||
Containment *old = d->containment;
|
||||
Plasma::Corona* corona = old->corona();
|
||||
Plasma::Corona *corona = old->corona();
|
||||
Plasma::Containment *c = corona->addContainment(name, args);
|
||||
if (c) {
|
||||
KConfigGroup oldConfig = old->config();
|
||||
@ -265,7 +264,7 @@ Containment* View::swapContainment(const QString& name, const QVariantList& args
|
||||
|
||||
// load the configuration of the old containment into the new one
|
||||
c->restore(newConfig);
|
||||
foreach(Applet* applet, c->applets()) {
|
||||
foreach (Applet *applet, c->applets()) {
|
||||
applet->init();
|
||||
// We have to flush the applet constraints manually
|
||||
applet->flushPendingConstraintsEvents();
|
||||
|
7
view.h
7
view.h
@ -119,7 +119,7 @@ public:
|
||||
/**
|
||||
* @return the containment associated with this view, or 0 if none is
|
||||
*/
|
||||
Containment* containment() const;
|
||||
Containment *containment() const;
|
||||
|
||||
/**
|
||||
* Swap the containment for this view, which will also cause the view
|
||||
@ -128,8 +128,8 @@ public:
|
||||
* @param name the plugin name for the new containment.
|
||||
* @param args argument list to pass to the containment
|
||||
*/
|
||||
Containment* swapContainment(const QString& name,
|
||||
const QVariantList& args = QVariantList());
|
||||
Containment *swapContainment(const QString &name,
|
||||
const QVariantList &args = QVariantList());
|
||||
|
||||
/**
|
||||
* Set whether or not the view should adjust its size when the associated
|
||||
@ -199,4 +199,3 @@ private:
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
12
wallpaper.h
12
wallpaper.h
@ -79,7 +79,7 @@ class PLASMA_EXPORT Wallpaper : public QObject
|
||||
* @param args to send the wallpaper extra arguments
|
||||
* @return a pointer to the loaded wallpaper, or 0 on load failure
|
||||
**/
|
||||
static Wallpaper* load(const QString &name, const QVariantList& args = QVariantList());
|
||||
static Wallpaper *load(const QString &name, const QVariantList &args = QVariantList());
|
||||
|
||||
/**
|
||||
* Attempts to load an wallpaper
|
||||
@ -92,7 +92,7 @@ class PLASMA_EXPORT Wallpaper : public QObject
|
||||
* @param args to send the wallpaper extra arguments
|
||||
* @return a pointer to the loaded wallpaper, or 0 on load failure
|
||||
**/
|
||||
static Wallpaper* load(const KPluginInfo& info, const QVariantList& args = QVariantList());
|
||||
static Wallpaper *load(const KPluginInfo &info, const QVariantList &args = QVariantList());
|
||||
|
||||
/**
|
||||
* Returns the user-visible name for the wallpaper, as specified in the
|
||||
@ -131,7 +131,7 @@ class PLASMA_EXPORT Wallpaper : public QObject
|
||||
/**
|
||||
* Sets bounding rectangle
|
||||
*/
|
||||
void setBoundingRect(const QRectF& boundingRect);
|
||||
void setBoundingRect(const QRectF &boundingRect);
|
||||
|
||||
/**
|
||||
* This method is called when the wallpaper should be painted.
|
||||
@ -139,7 +139,7 @@ class PLASMA_EXPORT Wallpaper : public QObject
|
||||
* @param painter the QPainter to use to do the painting
|
||||
* @param exposedRect the rect to paint within
|
||||
**/
|
||||
virtual void paint(QPainter *painter, const QRectF& exposedRect) = 0;
|
||||
virtual void paint(QPainter *painter, const QRectF &exposedRect) = 0;
|
||||
|
||||
/**
|
||||
* This method should be called once the wallpaper is loaded or mode is changed.
|
||||
@ -208,7 +208,7 @@ class PLASMA_EXPORT Wallpaper : public QObject
|
||||
* @param parent a QObject parent; you probably want to pass in 0
|
||||
* @param args a list of strings containing one entry: the service id
|
||||
*/
|
||||
Wallpaper(QObject* parent, const QVariantList& args);
|
||||
Wallpaper(QObject *parent, const QVariantList &args);
|
||||
|
||||
/**
|
||||
* This method is called once the wallpaper is loaded or mode is changed.
|
||||
@ -220,7 +220,7 @@ class PLASMA_EXPORT Wallpaper : public QObject
|
||||
virtual void init(const KConfigGroup &config);
|
||||
|
||||
private:
|
||||
WallpaperPrivate* const d;
|
||||
WallpaperPrivate *const d;
|
||||
};
|
||||
|
||||
} // Plasma namespace
|
||||
|
Loading…
Reference in New Issue
Block a user