From e88e2faa63a4984ae1038466afe19009ac4a475b Mon Sep 17 00:00:00 2001 From: Allen Winter Date: Sat, 11 Oct 2008 16:19:04 +0000 Subject: [PATCH] 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 --- abstractrunner.h | 35 +++---- animationdriver.h | 20 ++-- animator.h | 30 +++--- applet.cpp | 6 +- applet.h | 75 ++++++++------ appletbrowser.cpp | 22 ++--- appletbrowser.h | 8 +- configxml.h | 2 +- containment.cpp | 24 ++--- containment.h | 35 ++++--- corona.h | 19 ++-- datacontainer.cpp | 15 +-- datacontainer.h | 5 +- dataengine.h | 54 +++++----- dataenginemanager.h | 10 +- delegate.h | 36 ++++--- dialog.cpp | 7 +- dialog.h | 32 +++--- extender.h | 5 +- extenderitem.h | 4 +- glapplet.cpp | 36 ++++--- package.h | 9 +- packagemetadata.cpp | 9 +- packagemetadata.h | 10 +- packagestructure.cpp | 31 +++--- packagestructure.h | 20 ++-- paintutils.h | 10 +- panelsvg.cpp | 47 +++++---- panelsvg.h | 40 ++++---- plasma.h | 228 ++++++++++++++++++++++++------------------- plasma_export.h | 4 +- popupapplet.h | 8 +- querymatch.h | 45 ++++----- runnercontext.h | 28 +++--- runnermanager.cpp | 18 ++-- runnermanager.h | 11 +-- service.h | 8 +- servicejob.cpp | 2 +- svg.cpp | 12 +-- svg.h | 13 ++- theme.h | 33 +++---- tooltipmanager.h | 4 +- uiloader.cpp | 34 +++---- version.h | 3 +- view.cpp | 9 +- view.h | 7 +- wallpaper.h | 12 +-- 47 files changed, 600 insertions(+), 535 deletions(-) diff --git a/abstractrunner.h b/abstractrunner.h index 373383e8d..e262c98e1 100644 --- a/abstractrunner.h +++ b/abstractrunner.h @@ -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 List; @@ -141,13 +143,13 @@ class PLASMA_EXPORT AbstractRunner : public QObject /** * Returns the OR'ed value of all the Information types (as defined in RunnerContext::Type) - * this runner is not interested in. + * this runner is not interested in. * @return OR'ed value of black listed types */ RunnerContext::Types ignoredTypes() const; /** - * Sets the types this runner will ignore + * Sets the types this runner will ignore * @param types OR'ed listed of ignored types */ void setIgnoredTypes(RunnerContext::Types types); @@ -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();) \ 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();) \ K_EXPORT_PLUGIN(ConfigFactory("kcm_krunner_" #name)) \ diff --git a/animationdriver.h b/animationdriver.h index f32ebd962..fb75ca069 100644 --- a/animationdriver.h +++ b/animationdriver.h @@ -1,6 +1,6 @@ /* * Copyright 2007 Aaron Seigo - * 2007 Alexis Ménard + * Copyright 2007 Alexis Ménard * * 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 diff --git a/animator.h b/animator.h index f9df890f7..69f40125e 100644 --- a/animator.h +++ b/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 diff --git a/applet.cpp b/applet.cpp index dfa84dbc7..181bf4176 100644 --- a/applet.cpp +++ b/applet.cpp @@ -134,7 +134,7 @@ Applet::~Applet() //which isn't very nice. foreach (ExtenderItem *item, d->extender->attachedItems()) { if (!item->isDetached() || item->autoExpireDelay()) { - //destroy temporary extender items, or items that aren't detached, so their + //destroy temporary extender items, or items that aren't detached, so their //configuration won't linger after a plasma restart. item->destroy(); } @@ -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; } diff --git a/applet.h b/applet.h index 4e9137410..bb1298791 100644 --- a/applet.h +++ b/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; diff --git a/appletbrowser.cpp b/appletbrowser.cpp index 386f1a291..c98b6d2c5 100644 --- a/appletbrowser.cpp +++ b/appletbrowser.cpp @@ -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(); } diff --git a/appletbrowser.h b/appletbrowser.h index ef4afaa8e..887c21a66 100644 --- a/appletbrowser.h +++ b/appletbrowser.h @@ -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; diff --git a/configxml.h b/configxml.h index 76e1fb903..ca53fbb31 100644 --- a/configxml.h +++ b/configxml.h @@ -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 diff --git a/containment.cpp b/containment.cpp index 0b4696cd0..3f92107e9 100644 --- a/containment.cpp +++ b/containment.cpp @@ -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(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 h = handles; handles.clear(); - foreach (AppletHandle* handle, h) { + foreach (AppletHandle *handle, h) { handle->disconnect(q); handle->deleteLater(); } diff --git a/containment.h b/containment.h index 756350545..5898a9531 100644 --- a/containment.h +++ b/containment.h @@ -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 diff --git a/corona.h b/corona.h index ce95ade0e..83c991f29 100644 --- a/corona.h +++ b/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 - diff --git a/datacontainer.cpp b/datacontainer.cpp index 144d70d6c..9057be633 100644 --- a/datacontainer.cpp +++ b/datacontainer.cpp @@ -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::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(); } diff --git a/datacontainer.h b/datacontainer.h index e23196ae8..87efad8a5 100644 --- a/datacontainer.h +++ b/datacontainer.h @@ -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 diff --git a/dataengine.h b/dataengine.h index 354286db0..207aa6221 100644 --- a/dataengine.h +++ b/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 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 diff --git a/dataenginemanager.h b/dataenginemanager.h index 28543c34b..3519cc510 100644 --- a/dataenginemanager.h +++ b/dataenginemanager.h @@ -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; }; diff --git a/delegate.h b/delegate.h index 567a60189..39743d626 100644 --- a/delegate.h +++ b/delegate.h @@ -1,4 +1,4 @@ -/* +/* Copyright 2007 Robert Knight Copyright 2008 Marco Martin @@ -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,14 +109,14 @@ 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; }; } -#endif // PLASMA_DELEGATE_H +#endif // PLASMA_DELEGATE_H diff --git a/dialog.cpp b/dialog.cpp index 37adecab7..b60d9eb8f 100644 --- a/dialog.cpp +++ b/dialog.cpp @@ -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)) { @@ -163,12 +163,12 @@ void Dialog::paintEvent(QPaintEvent *e) //we set the resize handlers d->resizeAreas.clear(); if (d->resizeCorners & Dialog::NorthEast) { - d->resizeAreas[Dialog::NorthEast] = QRect(rect().right() - resizeAreaMargin, 0, + d->resizeAreas[Dialog::NorthEast] = QRect(rect().right() - resizeAreaMargin, 0, resizeAreaMargin, resizeAreaMargin); } 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" diff --git a/dialog.h b/dialog.h index c753cfb31..2882249f8 100644 --- a/dialog.h +++ b/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,26 +104,25 @@ 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; /** - * React to theme changes + * React to theme changes */ Q_PRIVATE_SLOT(d, void themeUpdated()) }; diff --git a/extender.h b/extender.h index 50d3b116a..b4e7719db 100644 --- a/extender.h +++ b/extender.h @@ -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; diff --git a/extenderitem.h b/extenderitem.h index d55ebe376..b8f17f4ab 100644 --- a/extenderitem.h +++ b/extenderitem.h @@ -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); diff --git a/glapplet.cpp b/glapplet.cpp index b0d102027..735a4bb20 100644 --- a/glapplet.cpp +++ b/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; diff --git a/package.h b/package.h index d426012ce..4f6d0fe76 100644 --- a/package.h +++ b/package.h @@ -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 * diff --git a/packagemetadata.cpp b/packagemetadata.cpp index af12155d5..0544048b4 100644 --- a/packagemetadata.cpp +++ b/packagemetadata.cpp @@ -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 - diff --git a/packagemetadata.h b/packagemetadata.h index 03ebb2083..bc33c5397 100644 --- a/packagemetadata.h +++ b/packagemetadata.h @@ -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; diff --git a/packagestructure.cpp b/packagestructure.cpp index 409e268c1..1428656e4 100644 --- a/packagestructure.cpp +++ b/packagestructure.cpp @@ -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(0, args, &error)); + PackageStructure::Ptr structure( + offer->createInstance(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 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::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::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::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::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::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::const_iterator it = d->contents.find(key); if (it == d->contents.constEnd()) { diff --git a/packagestructure.h b/packagestructure.h index a7d6296e8..c5f066e55 100644 --- a/packagestructure.h +++ b/packagestructure.h @@ -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 diff --git a/paintutils.h b/paintutils.h index bda6cbe64..1927290d9 100644 --- a/paintutils.h +++ b/paintutils.h @@ -47,16 +47,16 @@ PLASMA_EXPORT void shadowBlur(QImage &image, int radius, const QColor &color); * Returns a pixmap containing text with blurred shadow. * Text and shadow colors default to Plasma::Theme colors. */ -PLASMA_EXPORT QPixmap shadowText(QString text, - QColor textColor = Plasma::Theme::defaultTheme()->color(Plasma::Theme::TextColor), - QColor shadowColor = Plasma::Theme::defaultTheme()->color(Plasma::Theme::BackgroundColor), - QPoint offset = QPoint(1,1), +PLASMA_EXPORT QPixmap shadowText(QString text, + QColor textColor = Plasma::Theme::defaultTheme()->color(Plasma::Theme::TextColor), + QColor shadowColor = Plasma::Theme::defaultTheme()->color(Plasma::Theme::BackgroundColor), + QPoint offset = QPoint(1,1), int radius = 2); /** * 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 diff --git a/panelsvg.cpp b/panelsvg.cpp index 435c5eaee..731cca086 100644 --- a/panelsvg.cpp +++ b/panelsvg.cpp @@ -107,7 +107,7 @@ public: QHash 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(); } @@ -331,13 +332,14 @@ QRectF PanelSvg::contentsRect() const QBitmap PanelSvg::mask() const { PanelData *panel = d->panels[d->prefix]; - + if (!panel->cachedMask) { if (!panel->cachedBackground) { 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); @@ -600,7 +607,7 @@ void PanelSvgPrivate::updateSizes() q->Svg::resize(); if (panel->enabledBorders & PanelSvg::TopBorder) { panel->topHeight = q->elementSize(prefix + "top").height(); - + if (q->hasElement(prefix + "hint-top-margin")) { panel->topMargin = q->elementSize(prefix + "hint-top-margin").height(); } else { @@ -612,7 +619,7 @@ void PanelSvgPrivate::updateSizes() if (panel->enabledBorders & PanelSvg::LeftBorder) { panel->leftWidth = q->elementSize(prefix + "left").width(); - + if (q->hasElement(prefix + "hint-left-margin")) { panel->leftMargin = q->elementSize(prefix + "hint-left-margin").height(); } else { @@ -624,7 +631,7 @@ void PanelSvgPrivate::updateSizes() if (panel->enabledBorders & PanelSvg::RightBorder) { panel->rightWidth = q->elementSize(prefix + "right").width(); - + if (q->hasElement(prefix + "hint-right-margin")) { panel->rightMargin = q->elementSize(prefix + "hint-right-margin").height(); } else { @@ -636,7 +643,7 @@ void PanelSvgPrivate::updateSizes() if (panel->enabledBorders & PanelSvg::BottomBorder) { panel->bottomHeight = q->elementSize(prefix + "bottom").height(); - + if (q->hasElement(prefix + "hint-bottom-margin")) { panel->bottomMargin = q->elementSize(prefix + "hint-bottom-margin").height(); } else { diff --git a/panelsvg.h b/panelsvg.h index e15a9427b..346f96f23 100644 --- a/panelsvg.h +++ b/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 @@ -184,7 +184,7 @@ class PLASMA_EXPORT PanelSvg : public Svg bool hasElementPrefix(const QString & prefix) const; /** - * This is an overloaded method provided for convenience equivalent to + * This is an overloaded method provided for convenience equivalent to * hasElementPrefix("north"), hasElementPrefix("south") * hasElementPrefix("west") and hasElementPrefix("east") * @return true if the svg has the necessary elements with the given prefix @@ -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 + * 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()) diff --git a/plasma.h b/plasma.h index 0dd53c948..4d8dfa553 100644 --- a/plasma.h +++ b/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 diff --git a/plasma_export.h b/plasma_export.h index 347488a7e..04dfd5517 100644 --- a/plasma_export.h +++ b/plasma_export.h @@ -25,10 +25,10 @@ #ifndef PLASMA_EXPORT # if defined(MAKE_PLASMA_LIB) - /* We are building this library */ + /* We are building this library */ # define PLASMA_EXPORT KDE_EXPORT # else - /* We are using this library */ + /* We are using this library */ # define PLASMA_EXPORT KDE_IMPORT # endif #endif diff --git a/popupapplet.h b/popupapplet.h index 8b9123230..c7c8b939b 100644 --- a/popupapplet.h +++ b/popupapplet.h @@ -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: /** diff --git a/querymatch.h b/querymatch.h index 949e53b95..c738580a0 100644 --- a/querymatch.h +++ b/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: diff --git a/runnercontext.h b/runnercontext.h index a275a9538..3d0937e10 100644 --- a/runnercontext.h +++ b/runnercontext.h @@ -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 &matches); + bool addMatches(const QString &term, const QList &matches); /** * Appends a match to the existing list of matches. diff --git a/runnermanager.cpp b/runnermanager.cpp index 15efc172e..0302a491c 100644 --- a/runnermanager.cpp +++ b/runnermanager.cpp @@ -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; } @@ -205,10 +205,10 @@ public: { config = conf; - //The number of threads used scales with the number of processors. + //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; } @@ -483,7 +483,7 @@ QString RunnerManager::query() const void RunnerManager::reset() { - // If ThreadWeaver is idle, it is safe to clear previous jobs + // If ThreadWeaver is idle, it is safe to clear previous jobs if (Weaver::instance()->isIdle()) { qDeleteAll(d->searchJobs); d->searchJobs.clear(); diff --git a/runnermanager.h b/runnermanager.h index df075d62c..40d99cb9f 100644 --- a/runnermanager.h +++ b/runnermanager.h @@ -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,16 +57,16 @@ 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 + * Retrieves all available matches found so far for the previously launched query * @return List of matches */ QList matches() const; @@ -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 diff --git a/service.h b/service.h index cd96a40fe..fa3b7c7ac 100644 --- a/service.h +++ b/service.h @@ -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 ¶meters) = 0; /** diff --git a/servicejob.cpp b/servicejob.cpp index 55b75eae4..f85a1be66 100644 --- a/servicejob.cpp +++ b/servicejob.cpp @@ -41,7 +41,7 @@ public: q->start(); } - ServiceJob* q; + ServiceJob *q; QString destination; QString operation; QMap parameters; diff --git a/svg.cpp b/svg.cpp index fc1a3c728..0594c3d6b 100644 --- a/svg.cpp +++ b/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); diff --git a/svg.h b/svg.h index 700cb7e45..3ad6f42ef 100644 --- a/svg.h +++ b/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()) diff --git a/theme.h b/theme.h index 2eb045157..6c4d9b6a3 100644 --- a/theme.h +++ b/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,16 +105,16 @@ 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. - * + * * @arg size the target height and width of the wallpaper; if an invalid size * 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()) }; diff --git a/tooltipmanager.h b/tooltipmanager.h index a0b2f35c3..5941a6fe2 100644 --- a/tooltipmanager.h +++ b/tooltipmanager.h @@ -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*)) diff --git a/uiloader.cpp b/uiloader.cpp index 1d2e0972f..ee40667c2 100644 --- a/uiloader.cpp +++ b/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; diff --git a/version.h b/version.h index 752c348ff..adb676a75 100644 --- a/version.h +++ b/version.h @@ -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 diff --git a/view.cpp b/view.cpp index 4e55c8e61..6fa19368c 100644 --- a/view.cpp +++ b/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(); diff --git a/view.h b/view.h index f2acf1412..b9afa9f84 100644 --- a/view.h +++ b/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 - diff --git a/wallpaper.h b/wallpaper.h index d2493d3ba..07b781efa 100644 --- a/wallpaper.h +++ b/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