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
This commit is contained in:
Matt Williams 2007-05-21 14:28:03 +00:00
parent a4505ca37f
commit dfb58b44c1
20 changed files with 48 additions and 42 deletions

View File

@ -16,12 +16,12 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "abstractrunner.h"
#include <QAction>
#include <KActionCollection>
#include <KServiceTypeTrader>
#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()

View File

@ -136,7 +136,7 @@ class PLASMA_EXPORT AbstractRunner : public QObject
private:
class Private;
Private* d;
Private* const d;
private Q_SLOTS:
void runExactMatch();

View File

@ -16,6 +16,8 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "applet.h"
#include <QEvent>
#include <QList>
#include <QSize>
@ -26,7 +28,6 @@
#include <KStandardDirs>
#include <KService>
#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()

View File

@ -37,7 +37,7 @@ class PLASMA_EXPORT Applet : public QWidget, public QGraphicsItemGroup
typedef QList<Applet*> 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) \

View File

@ -16,12 +16,13 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "dataengine.h"
#include <QTimer>
#include <QVariant>
#include <KDebug>
#include "dataengine.h"
#include "datasource.h"
#include "datavisualization.h"

View File

@ -19,10 +19,10 @@
#ifndef PLASMA_DATAENGINE_H
#define PLASMA_DATAENGINE_H
#include <QAtomic>
#include <QHash>
#include <QObject>
#include <QStringList>
#include <QtCore/QAtomic>
#include <QtCore/QHash>
#include <QtCore/QObject>
#include <QtCore/QStringList>
#include <plasma_export.h>

View File

@ -16,12 +16,12 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "datasource.h"
#include <QVariant>
#include <KDebug>
#include "datasource.h"
namespace Plasma
{

View File

@ -16,7 +16,6 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "datavisualization.h"
namespace Plasma

View File

@ -39,7 +39,7 @@ class PLASMA_EXPORT DataVisualization : public QObject
private:
class Private;
Private* d;
Private* const d;
};
} // Plasma namespace

View File

@ -16,10 +16,10 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include <kdebug.h>
#include "interface.h"
#include <kdebug.h>
Plasma::Interface* Plasma::Interface::m_interface;
namespace Plasma

View File

@ -16,14 +16,14 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "svg.h"
#include <QMatrix>
#include <QPainter>
#include <QPixmapCache>
#include <KDebug>
#include <KSvgRenderer>
#include "svg.h"
#include "theme.h"
namespace Plasma

9
svg.h
View File

@ -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

View File

@ -16,12 +16,12 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "theme.h"
#include <KSharedConfig>
#include <KStandardDirs>
#include <kconfiggroup.h>
#include "theme.h"
namespace Plasma
{

View File

@ -47,7 +47,7 @@ class PLASMA_EXPORT Theme : public QObject
private:
class Private;
Private* d;
Private* const d;
};
} // Plasma namespace

View File

@ -16,13 +16,14 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "checkbox.h"
#include <QStyleOption>
#include <QStyle>
#include <QWidget>
#include <QPainter>
#include <QGraphicsSceneMouseEvent>
#include "checkbox.h"
#include "checkbox.moc"
namespace Plasma

View File

@ -16,10 +16,10 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include <QStyleOptionFrameV2>
#include "lineedit.h"
#include <QStyleOptionFrameV2>
namespace Plasma
{

View File

@ -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);

View File

@ -16,6 +16,8 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "pushbutton.h"
#include <QStyleOptionFrameV2>
#include <QStyleOption>
#include <QStyle>
@ -23,8 +25,6 @@
#include <QPainter>
#include <QGraphicsSceneMouseEvent>
#include <QDebug>
#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())

View File

@ -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);

View File

@ -1,4 +1,4 @@
/**
/*
* Copyright (C) 2007 by Rafael Fernández López <ereslibre@gmail.com>
*
* 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 <QtGui/QWidget>
#include <QtGui/QApplication>
@ -23,9 +26,6 @@
#include <QtGui/QStyleOptionButton>
#include <QtGui/QGraphicsSceneMouseEvent>
// Radio button includes
#include "radiobutton.h"
namespace Plasma
{