From dfb58b44c1af37fcd4b0a58eacc536feb3da27ba Mon Sep 17 00:00:00 2001 From: Matt Williams Date: Mon, 21 May 2007 14:28:03 +0000 Subject: [PATCH] EBN Fixes * Include own header file first * Make d-pointer const * Use references-to-const svn path=/trunk/KDE/kdebase/workspace/plasma/lib/; revision=667001 --- abstractrunner.cpp | 8 ++++---- abstractrunner.h | 2 +- applet.cpp | 10 +++++----- applet.h | 4 ++-- dataengine.cpp | 3 ++- dataengine.h | 8 ++++---- datasource.cpp | 4 ++-- datavisualization.cpp | 1 - datavisualization.h | 2 +- interface.cpp | 4 ++-- svg.cpp | 4 ++-- svg.h | 9 +++++++-- theme.cpp | 4 ++-- theme.h | 2 +- widgets/checkbox.cpp | 3 ++- widgets/lineedit.cpp | 4 ++-- widgets/lineedit.h | 2 +- widgets/pushbutton.cpp | 6 +++--- widgets/pushbutton.h | 2 +- widgets/radiobutton.cpp | 8 ++++---- 20 files changed, 48 insertions(+), 42 deletions(-) diff --git a/abstractrunner.cpp b/abstractrunner.cpp index 928d16858..62f970029 100644 --- a/abstractrunner.cpp +++ b/abstractrunner.cpp @@ -16,12 +16,12 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +#include "abstractrunner.h" + #include #include #include -#include "abstractrunner.h" - namespace Plasma { @@ -41,9 +41,9 @@ class AbstractRunner::Private }; AbstractRunner::AbstractRunner( QObject* parent ) - : QObject( parent ) + : QObject( parent ), + d( new Private( this ) ) { - d = new Private( this ); } AbstractRunner::~AbstractRunner() diff --git a/abstractrunner.h b/abstractrunner.h index cbf9b9ee0..c861e59ab 100644 --- a/abstractrunner.h +++ b/abstractrunner.h @@ -136,7 +136,7 @@ class PLASMA_EXPORT AbstractRunner : public QObject private: class Private; - Private* d; + Private* const d; private Q_SLOTS: void runExactMatch(); diff --git a/applet.cpp b/applet.cpp index cfcbba406..a353f5b56 100644 --- a/applet.cpp +++ b/applet.cpp @@ -16,6 +16,8 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +#include "applet.h" + #include #include #include @@ -26,7 +28,6 @@ #include #include -#include "applet.h" #include "interface.h" namespace Plasma @@ -59,13 +60,12 @@ class Applet::Private }; Applet::Applet( QGraphicsItem *parent, - QString serviceID, + const QString& serviceID, int appletId ) : QWidget( 0 ), - QGraphicsItemGroup( parent ) + QGraphicsItemGroup( parent ), + d( new Private( KService::serviceByStorageId( serviceID ), appletId ) ) { - KService::Ptr service = KService::serviceByStorageId( serviceID ); - d = new Private( service, appletId ); } Applet::~Applet() diff --git a/applet.h b/applet.h index b4496c29a..064a7fd46 100644 --- a/applet.h +++ b/applet.h @@ -37,7 +37,7 @@ class PLASMA_EXPORT Applet : public QWidget, public QGraphicsItemGroup typedef QList List; Applet( QGraphicsItem* parent, - QString serviceId, + const QString& serviceId, int appletId ); ~Applet(); @@ -105,7 +105,7 @@ class PLASMA_EXPORT Applet : public QWidget, public QGraphicsItemGroup private: class Private; - Private* d; + Private* const d; }; #define K_EXPORT_PLASMA_APPLET(libname, classname) \ diff --git a/dataengine.cpp b/dataengine.cpp index a2cb282bb..5d82ac18c 100644 --- a/dataengine.cpp +++ b/dataengine.cpp @@ -16,12 +16,13 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +#include "dataengine.h" + #include #include #include -#include "dataengine.h" #include "datasource.h" #include "datavisualization.h" diff --git a/dataengine.h b/dataengine.h index 0226f7f9f..bfc7aeb8e 100644 --- a/dataengine.h +++ b/dataengine.h @@ -19,10 +19,10 @@ #ifndef PLASMA_DATAENGINE_H #define PLASMA_DATAENGINE_H -#include -#include -#include -#include +#include +#include +#include +#include #include diff --git a/datasource.cpp b/datasource.cpp index 358dff646..89837342d 100644 --- a/datasource.cpp +++ b/datasource.cpp @@ -16,12 +16,12 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +#include "datasource.h" + #include #include -#include "datasource.h" - namespace Plasma { diff --git a/datavisualization.cpp b/datavisualization.cpp index fb6c955c3..e03fc159e 100644 --- a/datavisualization.cpp +++ b/datavisualization.cpp @@ -16,7 +16,6 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ - #include "datavisualization.h" namespace Plasma diff --git a/datavisualization.h b/datavisualization.h index f355c1761..74fd803c7 100644 --- a/datavisualization.h +++ b/datavisualization.h @@ -39,7 +39,7 @@ class PLASMA_EXPORT DataVisualization : public QObject private: class Private; - Private* d; + Private* const d; }; } // Plasma namespace diff --git a/interface.cpp b/interface.cpp index 612585689..0770b2316 100644 --- a/interface.cpp +++ b/interface.cpp @@ -16,10 +16,10 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include - #include "interface.h" +#include + Plasma::Interface* Plasma::Interface::m_interface; namespace Plasma diff --git a/svg.cpp b/svg.cpp index 2b4186871..0ae22cc61 100644 --- a/svg.cpp +++ b/svg.cpp @@ -16,14 +16,14 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +#include "svg.h" + #include #include #include #include #include - -#include "svg.h" #include "theme.h" namespace Plasma diff --git a/svg.h b/svg.h index 83a783fee..0c7573112 100644 --- a/svg.h +++ b/svg.h @@ -25,8 +25,12 @@ class QPainter; class QPoint; +class QPointF; class QRect; +class QRectF; class QSize; +class QSizeF; +class QMatrix; namespace Plasma { @@ -45,10 +49,11 @@ class PLASMA_EXPORT Svg : public QObject * * The size is initialized to be the SVG's native size. * - * @related Plasma::Theme * @arg imagePath the image to show, used to load the image from * Plasma::Theme * @arg parent options QObject to parent this to + * + * @related Plasma::Theme */ explicit Svg( const QString& imagePath, QObject* parent = 0 ); ~Svg(); @@ -136,7 +141,7 @@ class PLASMA_EXPORT Svg : public QObject private: class Private; - Private* d; + Private* const d; }; } // Plasma namespace diff --git a/theme.cpp b/theme.cpp index aa18bfa76..6a86d3b28 100644 --- a/theme.cpp +++ b/theme.cpp @@ -16,12 +16,12 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +#include "theme.h" + #include #include #include -#include "theme.h" - namespace Plasma { diff --git a/theme.h b/theme.h index 25c6f1683..527ab1979 100644 --- a/theme.h +++ b/theme.h @@ -47,7 +47,7 @@ class PLASMA_EXPORT Theme : public QObject private: class Private; - Private* d; + Private* const d; }; } // Plasma namespace diff --git a/widgets/checkbox.cpp b/widgets/checkbox.cpp index 6bd4b7edd..4f76741ef 100644 --- a/widgets/checkbox.cpp +++ b/widgets/checkbox.cpp @@ -16,13 +16,14 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +#include "checkbox.h" + #include #include #include #include #include -#include "checkbox.h" #include "checkbox.moc" namespace Plasma diff --git a/widgets/lineedit.cpp b/widgets/lineedit.cpp index a0887c2cf..c32251d6d 100644 --- a/widgets/lineedit.cpp +++ b/widgets/lineedit.cpp @@ -16,10 +16,10 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include - #include "lineedit.h" +#include + namespace Plasma { diff --git a/widgets/lineedit.h b/widgets/lineedit.h index a8f90f931..5bdafcf83 100644 --- a/widgets/lineedit.h +++ b/widgets/lineedit.h @@ -35,7 +35,7 @@ class KDE_EXPORT LineEdit : public QGraphicsTextItem, public DataVisualization { public: - LineEdit(QGraphicsItem *parent = 0, QGraphicsScene *scene = 0); + explicit LineEdit(QGraphicsItem *parent = 0, QGraphicsScene *scene = 0); ~LineEdit(); void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0); diff --git a/widgets/pushbutton.cpp b/widgets/pushbutton.cpp index 2fb3ab290..c3a183d89 100644 --- a/widgets/pushbutton.cpp +++ b/widgets/pushbutton.cpp @@ -16,6 +16,8 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +#include "pushbutton.h" + #include #include #include @@ -23,8 +25,6 @@ #include #include #include - -#include "pushbutton.h" #include "pushbutton.moc" namespace Plasma @@ -177,7 +177,7 @@ QSize PushButton::size() const return QSize(d->width, d->height); } -void PushButton::setSize(QSize s) +void PushButton::setSize(const QSize& s) { prepareGeometryChange(); if (!d->maxWidth >= s.width()) diff --git a/widgets/pushbutton.h b/widgets/pushbutton.h index 8d8ef2fd2..9d83d51f0 100644 --- a/widgets/pushbutton.h +++ b/widgets/pushbutton.h @@ -64,7 +64,7 @@ class KDE_EXPORT PushButton : public DataVisualization, void setText(const QString &name); QSize size() const; - void setSize(QSize size); + void setSize(const QSize& size); int height() const; void setHeight(int height); diff --git a/widgets/radiobutton.cpp b/widgets/radiobutton.cpp index 32ecdaf18..a5c0510b1 100644 --- a/widgets/radiobutton.cpp +++ b/widgets/radiobutton.cpp @@ -1,4 +1,4 @@ -/** +/* * Copyright (C) 2007 by Rafael Fernández López * * This program is free software; you can redistribute it and/or modify @@ -16,6 +16,9 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +// Header Includes +#include "radiobutton.h" + // Qt includes #include #include @@ -23,9 +26,6 @@ #include #include -// Radio button includes -#include "radiobutton.h" - namespace Plasma {