change all ClassName::Private classes to ClassNamePrivate, and adjust friends accordingly; this makes plasma compilable with gcc < 4.2

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=826893
This commit is contained in:
Marijn Kruisselbrink 2008-07-01 18:56:43 +00:00
parent b1a56d99ee
commit 21b148b963
106 changed files with 637 additions and 585 deletions

View File

@ -38,12 +38,12 @@
namespace Plasma
{
class AbstractRunner::Private
class AbstractRunnerPrivate
{
public:
Private(AbstractRunner* r, KService::Ptr service)
: priority(NormalPriority),
speed(NormalSpeed),
AbstractRunnerPrivate(AbstractRunner* r, KService::Ptr service)
: priority(AbstractRunner::NormalPriority),
speed(AbstractRunner::NormalSpeed),
blackListed(0),
script(0),
runnerDescription(service),
@ -75,8 +75,8 @@ public:
bool hasRunOptions;
bool hasConfig;
Priority priority;
Speed speed;
AbstractRunner::Priority priority;
AbstractRunner::Speed speed;
RunnerContext::Types blackListed;
RunnerScript* script;
KPluginInfo runnerDescription;
@ -90,13 +90,13 @@ K_GLOBAL_STATIC(QMutex, s_bigLock)
AbstractRunner::AbstractRunner(QObject* parent, const QString& serviceId)
: QObject(parent),
d(new Private(this, KService::serviceByStorageId(serviceId)))
d(new AbstractRunnerPrivate(this, KService::serviceByStorageId(serviceId)))
{
}
AbstractRunner::AbstractRunner(QObject* parent, const QVariantList& args)
: QObject(parent),
d(new Private(this, KService::serviceByStorageId(args.count() > 0 ? args[0].toString() : QString())))
d(new AbstractRunnerPrivate(this, KService::serviceByStorageId(args.count() > 0 ? args[0].toString() : QString())))
{
}

View File

@ -39,6 +39,7 @@ namespace Plasma
class Package;
class RunnerScript;
class QueryMatch;
class AbstractRunnerPrivate;
/**
* An abstract base class for Plasma Runner plugins
@ -174,6 +175,7 @@ class PLASMA_EXPORT AbstractRunner : public QObject
protected:
friend class RunnerManager;
friend class RunnerManagerPrivate;
/**
* Constructs a Runner object. Since AbstractRunner has pure virtuals,
@ -227,8 +229,7 @@ class PLASMA_EXPORT AbstractRunner : public QObject
void init();
private:
class Private;
Private* const d;
AbstractRunnerPrivate* const d;
};
} // Plasma namespace

View File

@ -35,6 +35,8 @@ class QGraphicsItem;
namespace Plasma
{
class AnimationDriverPrivate;
class PLASMA_EXPORT AnimationDriver : public QObject
{
Q_OBJECT
@ -68,8 +70,7 @@ public:
virtual void itemSlideOut(qreal progress, QGraphicsItem* item, const QPoint &start, const QPoint &destination);
private:
class Private;
Private * const d;
AnimationDriverPrivate * const d;
};
} // Plasma namespace

View File

@ -90,18 +90,18 @@ struct CustomAnimationState
char* slot;
};
class Animator::Private
class AnimatorPrivate
{
public:
Private()
AnimatorPrivate()
: driver(0),
animId(0),
timerId(0)
{
}
~Private()
~AnimatorPrivate()
{
qDeleteAll(animatedItems);
qDeleteAll(animatedElements);
@ -200,7 +200,7 @@ Animator* Animator::self()
Animator::Animator(QObject * parent)
: QObject(parent),
d(new Private)
d(new AnimatorPrivate)
{
d->init(this);
}
@ -210,7 +210,7 @@ Animator::~Animator()
delete d;
}
void Animator::Private::animatedItemDestroyed(QObject* o)
void AnimatorPrivate::animatedItemDestroyed(QObject* o)
{
//kDebug() << "testing for" << (void*)o;
QMutableMapIterator<QGraphicsItem*, AnimationState*> it(animatedItems);
@ -225,7 +225,7 @@ void Animator::Private::animatedItemDestroyed(QObject* o)
}
}
void Animator::Private::movingItemDestroyed(QObject* o)
void AnimatorPrivate::movingItemDestroyed(QObject* o)
{
QMutableMapIterator<QGraphicsItem*, MovementState*> it(movingItems);
while (it.hasNext()) {
@ -237,7 +237,7 @@ void Animator::Private::movingItemDestroyed(QObject* o)
}
}
void Animator::Private::animatedElementDestroyed(QObject* o)
void AnimatorPrivate::animatedElementDestroyed(QObject* o)
{
QMutableMapIterator<int, ElementAnimationState*> it(animatedElements);
while (it.hasNext()) {
@ -249,7 +249,7 @@ void Animator::Private::animatedElementDestroyed(QObject* o)
}
}
void Animator::Private::customAnimReceiverDestroyed(QObject* o)
void AnimatorPrivate::customAnimReceiverDestroyed(QObject* o)
{
QMutableMapIterator<int, CustomAnimationState*> it(customAnims);
while (it.hasNext()) {
@ -676,7 +676,7 @@ void Animator::timerEvent(QTimerEvent *event)
}
}
void Animator::Private::init(Animator *q)
void AnimatorPrivate::init(Animator *q)
{
//FIXME: usage between different applications?
KConfig c("plasmarc");

View File

@ -32,6 +32,8 @@ class QTimeLine;
namespace Plasma
{
class AnimatorPrivate;
/**
* @short A system for applying effects to Plasma elements
*/
@ -169,8 +171,7 @@ private:
Q_PRIVATE_SLOT(d, void animatedElementDestroyed(QObject*))
Q_PRIVATE_SLOT(d, void customAnimReceiverDestroyed(QObject*))
class Private;
Private * const d;
AnimatorPrivate * const d;
};
} // namespace Plasma

View File

@ -84,7 +84,7 @@ Applet::Applet(QGraphicsItem *parent,
const QString& serviceID,
uint appletId)
: QGraphicsWidget(parent),
d(new Private(KService::serviceByStorageId(serviceID), appletId, this))
d(new AppletPrivate(KService::serviceByStorageId(serviceID), appletId, this))
{
// WARNING: do not access config() OR globalConfig() in this method!
// that requires a scene, which is not available at this point
@ -93,7 +93,7 @@ Applet::Applet(QGraphicsItem *parent,
Applet::Applet(QObject* parentObject, const QVariantList& args)
: QGraphicsWidget(0),
d(new Private(KService::serviceByStorageId(args.count() > 0 ? args[0].toString() : QString()),
d(new AppletPrivate(KService::serviceByStorageId(args.count() > 0 ? args[0].toString() : QString()),
args.count() > 1 ? args[1].toInt() : 0, this))
{
// now remove those first two items since those are managed by Applet and subclasses shouldn't
@ -128,11 +128,11 @@ Applet::~Applet()
PackageStructure::Ptr Applet::packageStructure()
{
if (!Private::packageStructure) {
Private::packageStructure = new PlasmoidPackage();
if (!AppletPrivate::packageStructure) {
AppletPrivate::packageStructure = new PlasmoidPackage();
}
return Private::packageStructure;
return AppletPrivate::packageStructure;
}
void Applet::init()
@ -189,8 +189,8 @@ void Applet::restore(KConfigGroup &group)
qreal z = group.readEntry("zvalue", 0);
if (z >= Private::s_maxZValue) {
Private::s_maxZValue = z;
if (z >= AppletPrivate::s_maxZValue) {
AppletPrivate::s_maxZValue = z;
}
if (z > 0) {
@ -220,7 +220,7 @@ void Applet::restore(KConfigGroup &group)
*/
}
void Applet::Private::setFocus()
void AppletPrivate::setFocus()
{
kDebug() << "setting focus";
q->setFocus(Qt::ShortcutFocusReason);
@ -309,7 +309,7 @@ void Applet::destroy()
Animator::self()->animateItem(this, Animator::DisappearAnimation);
}
void Applet::Private::appletAnimationComplete(QGraphicsItem *item, Plasma::Animator::Animation anim)
void AppletPrivate::appletAnimationComplete(QGraphicsItem *item, Plasma::Animator::Animation anim)
{
if (anim != Animator::DisappearAnimation || item != q) {
return; //it's not our time yet
@ -318,7 +318,7 @@ void Applet::Private::appletAnimationComplete(QGraphicsItem *item, Plasma::Anima
cleanUpAndDelete();
}
void Applet::Private::cleanUpAndDelete()
void AppletPrivate::cleanUpAndDelete()
{
//kDebug() << "???????????????? DESTROYING APPLET" << name() << " ???????????????????????????";
QGraphicsWidget *parent = dynamic_cast<QGraphicsWidget *>(q->parentItem());
@ -1323,7 +1323,7 @@ Applet* Applet::load(const QString& appletName, uint appletId, const QVariantLis
KService::Ptr offer = offers.first();
if (appletId == 0) {
appletId = ++Private::s_maxAppletId;
appletId = ++AppletPrivate::s_maxAppletId;
}
if (!offer->property("X-Plasma-API").toString().isEmpty()) {
@ -1477,12 +1477,12 @@ QRect Applet::screenRect() const
void Applet::raise()
{
setZValue(++Private::s_maxZValue);
setZValue(++AppletPrivate::s_maxZValue);
}
void Applet::lower()
{
setZValue(--Private::s_minZValue);
setZValue(--AppletPrivate::s_minZValue);
}
void Applet::setIsContainment(bool isContainment)
@ -1508,10 +1508,10 @@ bool Applet::isContainment() const
// PRIVATE CLASS IMPLEMENTATION
Applet::Private::Private(KService::Ptr service, int uniqueID, Applet *applet)
AppletPrivate::AppletPrivate(KService::Ptr service, int uniqueID, Applet *applet)
: appletId(uniqueID),
q(applet),
backgroundHints(StandardBackground),
backgroundHints(Applet::StandardBackground),
appletDescription(service),
package(0),
needsConfigOverlay(0),
@ -1539,7 +1539,7 @@ Applet::Private::Private(KService::Ptr service, int uniqueID, Applet *applet)
}
}
Applet::Private::~Private()
AppletPrivate::~AppletPrivate()
{
foreach ( const QString& engine, loadedEngines ) {
DataEngineManager::self()->unloadEngine( engine );
@ -1551,11 +1551,11 @@ Applet::Private::~Private()
delete mainConfig;
}
void Applet::Private::init()
void AppletPrivate::init()
{
// WARNING: do not access config() OR globalConfig() in this method!
// that requires a scene, which is not available at this point
q->setCacheMode(DeviceCoordinateCache);
q->setCacheMode(Applet::DeviceCoordinateCache);
q->setAcceptsHoverEvents(true);
q->setFlag(QGraphicsItem::ItemIsFocusable, true);
// FIXME: adding here because nothing seems to be doing it in QGraphicsView,
@ -1611,14 +1611,14 @@ void Applet::Private::init()
}
}
q->setBackgroundHints(DefaultBackground);
q->setBackgroundHints(Applet::DefaultBackground);
connect(Plasma::Theme::defaultTheme(), SIGNAL(themeChanged()), q, SLOT(themeChanged()));
QObject::connect(Plasma::Theme::defaultTheme(), SIGNAL(themeChanged()), q, SLOT(themeChanged()));
}
// put all setup routines for script here. at this point we can assume that
// package exists and that we have a script engin
void Applet::Private::setupScriptSupport()
void AppletPrivate::setupScriptSupport()
{
Q_ASSERT(package);
QString xmlPath = package->filePath("mainconfigxml");
@ -1634,7 +1634,7 @@ void Applet::Private::setupScriptSupport()
}
}
QString Applet::Private::globalName() const
QString AppletPrivate::globalName() const
{
if (!appletDescription.isValid()) {
return QString();
@ -1643,7 +1643,7 @@ QString Applet::Private::globalName() const
return appletDescription.service()->library();
}
QString Applet::Private::instanceName()
QString AppletPrivate::instanceName()
{
if (!appletDescription.isValid()) {
return QString();
@ -1652,7 +1652,7 @@ QString Applet::Private::instanceName()
return appletDescription.service()->library() + QString::number(appletId);
}
void Applet::Private::scheduleConstraintsUpdate(Plasma::Constraints c)
void AppletPrivate::scheduleConstraintsUpdate(Plasma::Constraints c)
{
if (!constraintsTimerId) {
constraintsTimerId = q->startTimer(0);
@ -1660,7 +1660,7 @@ void Applet::Private::scheduleConstraintsUpdate(Plasma::Constraints c)
pendingConstraints |= c;
}
KConfigGroup* Applet::Private::mainConfigGroup()
KConfigGroup* AppletPrivate::mainConfigGroup()
{
if (mainConfig) {
return mainConfig;
@ -1695,7 +1695,7 @@ KConfigGroup* Applet::Private::mainConfigGroup()
return mainConfig;
}
QString Applet::Private::visibleFailureText(const QString& reason)
QString AppletPrivate::visibleFailureText(const QString& reason)
{
QString text;
@ -1708,7 +1708,7 @@ QString Applet::Private::visibleFailureText(const QString& reason)
return text;
}
void Applet::Private::checkImmutability()
void AppletPrivate::checkImmutability()
{
const bool systemImmutable = q->globalConfig().isImmutable() || q->config().isImmutable() ||
((!isContainment && q->containment()) &&
@ -1720,7 +1720,7 @@ void Applet::Private::checkImmutability()
}
}
void Applet::Private::themeChanged()
void AppletPrivate::themeChanged()
{
if (background) {
//do again the translucent background fallback
@ -1736,17 +1736,17 @@ void Applet::Private::themeChanged()
q->update();
}
void Applet::Private::resetConfigurationObject()
void AppletPrivate::resetConfigurationObject()
{
mainConfigGroup()->deleteGroup();
delete mainConfig;
mainConfig = 0;
}
uint Applet::Private::s_maxAppletId = 0;
uint Applet::Private::s_maxZValue = 0;
uint Applet::Private::s_minZValue = 0;
PackageStructure::Ptr Applet::Private::packageStructure(0);
uint AppletPrivate::s_maxAppletId = 0;
uint AppletPrivate::s_maxZValue = 0;
uint AppletPrivate::s_minZValue = 0;
PackageStructure::Ptr AppletPrivate::packageStructure(0);
AppletOverlayWidget::AppletOverlayWidget(QGraphicsWidget *parent)
: QGraphicsWidget(parent)

View File

@ -46,6 +46,7 @@ namespace Plasma
class Containment;
class DataEngine;
class Package;
class AppletPrivate;
/**
* @short The base Applet class
@ -753,14 +754,16 @@ class PLASMA_EXPORT Applet : public QGraphicsWidget
**/
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
class Private;
Private* const d;
AppletPrivate* const d;
//Corona needs to access setFailedToLaunch and init
friend class Corona;
friend class CoronaPrivate;
friend class Containment;
friend class ContainmentPrivate;
friend class AppletScript;
friend class AppletHandle;
friend class AppletPrivate;
};
} // Plasma namespace

View File

@ -1,4 +1,4 @@
/*
/*
* Copyright 2005 by Aaron Seigo <aseigo@kde.org>
* Copyright 2007 by Riccardo Iaconelli <riccardo@kde.org>
* Copyright 2008 by Ménard Alexis <darktears31@gmail.com>
@ -40,11 +40,11 @@ protected:
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
};
class Applet::Private
class AppletPrivate
{
public:
Private(KService::Ptr service, int uniqueID, Applet *applet);
~Private();
AppletPrivate(KService::Ptr service, int uniqueID, Applet *applet);
~AppletPrivate();
void init();
@ -74,7 +74,7 @@ public:
// number of members at this point.
uint appletId;
Applet *q;
BackgroundHints backgroundHints;
Applet::BackgroundHints backgroundHints;
KPluginInfo appletDescription;
Package* package;
AppletOverlayWidget *needsConfigOverlay;

View File

@ -43,10 +43,10 @@
namespace Plasma
{
class AppletBrowserWidget::Private
class AppletBrowserWidgetPrivate
{
public:
Private(AppletBrowserWidget* w)
AppletBrowserWidgetPrivate(AppletBrowserWidget* w)
: q(w),
containment(0),
appletList(0),
@ -86,7 +86,7 @@ public:
KCategorizedItemsViewModels::DefaultFilterModel filterModel;
};
void AppletBrowserWidget::Private::initFilters()
void AppletBrowserWidgetPrivate::initFilters()
{
filterModel.clear();
@ -135,7 +135,7 @@ void AppletBrowserWidget::Private::initFilters()
AppletBrowserWidget::AppletBrowserWidget(QWidget * parent, Qt::WindowFlags f)
: QWidget(parent, f),
d(new Private(this))
d(new AppletBrowserWidgetPrivate(this))
{
d->init();
}
@ -145,12 +145,12 @@ AppletBrowserWidget::~AppletBrowserWidget()
delete d;
}
void AppletBrowserWidget::Private::init()
void AppletBrowserWidgetPrivate::init()
{
QVBoxLayout *layout = new QVBoxLayout(q);
appletList = new KCategorizedItemsView(q);
connect(appletList, SIGNAL(doubleClicked(const QModelIndex &)), q, SLOT(addApplet()));
QObject::connect(appletList, SIGNAL(doubleClicked(const QModelIndex &)), q, SLOT(addApplet()));
layout->addWidget(appletList);
// Other Emblems
@ -167,7 +167,7 @@ void AppletBrowserWidget::Private::init()
q->setLayout(layout);
}
void AppletBrowserWidget::Private::initRunningApplets()
void AppletBrowserWidgetPrivate::initRunningApplets()
{
//get applets from corona, count them, send results to model
if (!containment) {
@ -188,8 +188,8 @@ void AppletBrowserWidget::Private::initRunningApplets()
runningApplets.clear();
QList<Containment*> containments = c->containments();
foreach (Containment *containment, containments) {
connect(containment, SIGNAL(appletAdded(Plasma::Applet*,QPointF)), q, SLOT(appletAdded(Plasma::Applet*)));
connect(containment, SIGNAL(appletRemoved(Plasma::Applet*)), q, SLOT(appletRemoved(Plasma::Applet*)));
QObject::connect(containment, SIGNAL(appletAdded(Plasma::Applet*,QPointF)), q, SLOT(appletAdded(Plasma::Applet*)));
QObject::connect(containment, SIGNAL(appletRemoved(Plasma::Applet*)), q, SLOT(appletRemoved(Plasma::Applet*)));
foreach (Applet *applet, containment->applets()) {
runningApplets[applet->name()]++;
@ -245,7 +245,7 @@ void AppletBrowserWidget::addApplet()
}
}
void AppletBrowserWidget::Private::appletAdded(Plasma::Applet* applet)
void AppletBrowserWidgetPrivate::appletAdded(Plasma::Applet* applet)
{
QString name = applet->name();
//kDebug() << name;
@ -255,7 +255,7 @@ void AppletBrowserWidget::Private::appletAdded(Plasma::Applet* applet)
itemModel.setRunningApplets(name, runningApplets[name]);
}
void AppletBrowserWidget::Private::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
@ -322,7 +322,7 @@ void AppletBrowserWidget::openWidgetFile()
assistant->show();
}
class AppletBrowser::Private
class AppletBrowserPrivate
{
public:
void init(AppletBrowser*);
@ -331,12 +331,12 @@ public:
AppletBrowser::AppletBrowser(QWidget * parent, Qt::WindowFlags f)
: KDialog(parent, f),
d(new Private)
d(new AppletBrowserPrivate)
{
d->init(this);
}
void AppletBrowser::Private::init(AppletBrowser *q)
void AppletBrowserPrivate::init(AppletBrowser *q)
{
widget = new AppletBrowserWidget(q);
@ -350,12 +350,12 @@ void AppletBrowser::Private::init(AppletBrowser *q)
KMenu *widgetsMenu = new KMenu(i18n("Get New Widgets"), q);
QAction *action = new QAction(KIcon("applications-internet"),
i18n("Download From Internet"), q);
connect(action, SIGNAL(triggered(bool)), widget, SLOT(downloadWidgets()));
QObject::connect(action, SIGNAL(triggered(bool)), widget, SLOT(downloadWidgets()));
widgetsMenu->addAction(action);
action = new QAction(KIcon("applications-internet"),
i18n("Install From File..."), q);
connect(action, SIGNAL(triggered(bool)), widget, SLOT(openWidgetFile()));
QObject::connect(action, SIGNAL(triggered(bool)), widget, SLOT(openWidgetFile()));
widgetsMenu->addAction(action);
q->button(KDialog::User1)->setMenu(widgetsMenu);
@ -366,7 +366,7 @@ void AppletBrowser::Private::init(AppletBrowser *q)
q->setButtonToolTip(KDialog::User1, i18n("Install new widgets"));
q->setButtonWhatsThis(KDialog::User1, i18n("<qt>Selecting <b>Get New Widgets</b> will show a window that allows you to download new widgets directly from the Internet, while Install From File allows you to add new widgets from files you have on disk.</qt>"));
connect(q, SIGNAL(applyClicked()), widget, SLOT(addApplet()));
QObject::connect(q, SIGNAL(applyClicked()), widget, SLOT(addApplet()));
q->setInitialSize(QSize(400, 600));
KConfigGroup cg(KGlobal::config(), "PlasmaAppletBrowserDialog");

View File

@ -30,6 +30,8 @@ namespace Plasma
class Corona;
class Containment;
class Applet;
class AppletBrowserPrivate;
class AppletBrowserWidgetPrivate;
class PLASMA_EXPORT AppletBrowserWidget : public QWidget
{
@ -78,8 +80,7 @@ private:
Q_PRIVATE_SLOT(d, void appletAdded(Plasma::Applet*))
Q_PRIVATE_SLOT(d, void appletRemoved(Plasma::Applet*))
class Private;
Private * const d;
AppletBrowserWidgetPrivate * const d;
};
class PLASMA_EXPORT AppletBrowser: public KDialog
@ -105,8 +106,7 @@ public:
Containment* containment() const;
private:
class Private;
Private * const d;
AppletBrowserPrivate * const d;
};
} // namespace Plasma

View File

@ -31,10 +31,10 @@
namespace Plasma
{
class ConfigXml::Private
class ConfigXmlPrivate
{
public:
~Private()
~ConfigXmlPrivate()
{
qDeleteAll(bools);
qDeleteAll(strings);
@ -199,7 +199,7 @@ class ConfigXml::Private
class ConfigXmlHandler : public QXmlDefaultHandler
{
public:
ConfigXmlHandler(ConfigXml* config, ConfigXml::Private* d);
ConfigXmlHandler(ConfigXml* config, ConfigXmlPrivate* d);
bool startElement(const QString &namespaceURI, const QString & localName, const QString &qName, const QXmlAttributes &atts);
bool endElement(const QString &namespaceURI, const QString &localName, const QString &qName);
bool characters(const QString &ch);
@ -209,7 +209,7 @@ private:
void resetState();
ConfigXml* m_config;
ConfigXml::Private* d;
ConfigXmlPrivate* d;
int m_min;
int m_max;
QString m_name;
@ -226,7 +226,7 @@ private:
bool m_inChoice;
};
void ConfigXml::Private::parse(ConfigXml *configXml, QIODevice *xml)
void ConfigXmlPrivate::parse(ConfigXml *configXml, QIODevice *xml)
{
QXmlInputSource source(xml);
QXmlSimpleReader reader;
@ -235,7 +235,7 @@ void ConfigXml::Private::parse(ConfigXml *configXml, QIODevice *xml)
reader.parse(&source, false);
}
ConfigXmlHandler::ConfigXmlHandler(ConfigXml* config, ConfigXml::Private* d)
ConfigXmlHandler::ConfigXmlHandler(ConfigXml* config, ConfigXmlPrivate* d)
: QXmlDefaultHandler(),
m_config(config),
d(d)
@ -499,7 +499,7 @@ void ConfigXmlHandler::resetState()
ConfigXml::ConfigXml(const QString &configFile, QIODevice *xml, QObject *parent)
: KConfigSkeleton(configFile, parent),
d(new Private)
d(new ConfigXmlPrivate)
{
QXmlInputSource source(xml);
QXmlSimpleReader reader;
@ -510,7 +510,7 @@ ConfigXml::ConfigXml(const QString &configFile, QIODevice *xml, QObject *parent)
ConfigXml::ConfigXml(KSharedConfigPtr config, QIODevice *xml, QObject *parent)
: KConfigSkeleton(config, parent),
d(new Private)
d(new ConfigXmlPrivate)
{
d->parse(this, xml);
}
@ -520,7 +520,7 @@ ConfigXml::ConfigXml(KSharedConfigPtr config, QIODevice *xml, QObject *parent)
// at which point this can be addressed properly
ConfigXml::ConfigXml(const KConfigGroup *config, QIODevice *xml, QObject *parent)
: KConfigSkeleton(KSharedConfig::openConfig(config->config()->name()), parent),
d(new Private)
d(new ConfigXmlPrivate)
{
d->parse(this, xml);
}

View File

@ -68,6 +68,8 @@
namespace Plasma
{
class ConfigXmlPrivate;
class PLASMA_EXPORT ConfigXml : public KConfigSkeleton
{
public:
@ -106,9 +108,8 @@ public:
KConfigSkeletonItem* findItem(const QString &group, const QString &key);
class Private;
private:
Private * const d;
ConfigXmlPrivate * const d;
};
} // Plasma namespace

View File

@ -78,7 +78,7 @@ Containment::Containment(QGraphicsItem* parent,
const QString& serviceId,
uint containmentId)
: Applet(parent, serviceId, containmentId),
d(new Private(this))
d(new ContainmentPrivate(this))
{
// WARNING: do not access config() OR globalConfig() in this method!
// that requires a scene, which is not available at this point
@ -89,7 +89,7 @@ Containment::Containment(QGraphicsItem* parent,
Containment::Containment(QObject* parent, const QVariantList& args)
: Applet(parent, args),
d(new Private(this))
d(new ContainmentPrivate(this))
{
// WARNING: do not access config() OR globalConfig() in this method!
// that requires a scene, which is not available at this point
@ -946,12 +946,12 @@ void Containment::removeAssociatedWidget(QWidget *widget)
}
}
KActionCollection& Containment::Private::actions()
KActionCollection& ContainmentPrivate::actions()
{
return static_cast<Applet*>(q)->d->actions;
}
void Containment::Private::focusApplet(Plasma::Applet *applet)
void ContainmentPrivate::focusApplet(Plasma::Applet *applet)
{
if (focusedApplet == applet) {
return;
@ -1032,7 +1032,7 @@ void Containment::destroy()
// Private class implementation
void Containment::Private::toggleDesktopImmutability()
void ContainmentPrivate::toggleDesktopImmutability()
{
if (q->corona()) {
if (q->corona()->immutability() == Mutable) {
@ -1051,34 +1051,34 @@ void Containment::Private::toggleDesktopImmutability()
//setLockToolText();
}
void Containment::Private::zoomIn()
void ContainmentPrivate::zoomIn()
{
emit q->zoomRequested(q, Plasma::ZoomIn);
}
void Containment::Private::zoomOut()
void ContainmentPrivate::zoomOut()
{
emit q->zoomRequested(q, Plasma::ZoomOut);
}
ToolBox* Containment::Private::createToolBox()
ToolBox* ContainmentPrivate::createToolBox()
{
if (!toolBox) {
switch (type) {
case PanelContainment:
case Containment::PanelContainment:
toolBox = new PanelToolBox(q);
connect(toolBox, SIGNAL(toggled()), q, SIGNAL(toolBoxToggled()));
QObject::connect(toolBox, SIGNAL(toggled()), q, SIGNAL(toolBoxToggled()));
break;
//defaults to DesktopContainment right now
default:
toolBox = new DesktopToolBox(q);
connect(toolBox, SIGNAL(toggled()), toolBox, SLOT(toggle()));
QObject::connect(toolBox, SIGNAL(toggled()), toolBox, SLOT(toggle()));
break;
}
positionToolBox();
if (type == PanelContainment && q->immutability() != Mutable) {
if (type == Containment::PanelContainment && q->immutability() != Mutable) {
toolBox->hide();
}
}
@ -1086,14 +1086,14 @@ ToolBox* Containment::Private::createToolBox()
return toolBox;
}
void Containment::Private::positionToolBox()
void ContainmentPrivate::positionToolBox()
{
if (!toolBox) {
return;
}
//The placement assumes that the geometry width/height is no more than the screen
if (type == PanelContainment) {
if (type == Containment::PanelContainment) {
if (q->formFactor() == Vertical) {
toolBox->setOrientation(Qt::Vertical);
toolBox->setPos(q->geometry().width()/2 - toolBox->boundingRect().width()/2, q->geometry().height());
@ -1117,18 +1117,18 @@ void Containment::Private::positionToolBox()
}
}
void Containment::Private::triggerShowAddWidgets()
void ContainmentPrivate::triggerShowAddWidgets()
{
emit q->showAddWidgetsInterface(QPointF());
}
void Containment::Private::handleDisappeared(AppletHandle *handle)
void ContainmentPrivate::handleDisappeared(AppletHandle *handle)
{
handles.remove(handle->applet());
handle->deleteLater();
}
void Containment::Private::containmentConstraintsEvent(Plasma::Constraints constraints)
void ContainmentPrivate::containmentConstraintsEvent(Plasma::Constraints constraints)
{
if (!q->isContainment()) {
return;
@ -1162,7 +1162,7 @@ void Containment::Private::containmentConstraintsEvent(Plasma::Constraints const
a->updateConstraints(ImmutableConstraint);
}
if (q->isContainment() && type == PanelContainment) {
if (q->isContainment() && type == Containment::PanelContainment) {
if (unlocked) {
toolBox->show();
} else {
@ -1193,7 +1193,7 @@ void Containment::Private::containmentConstraintsEvent(Plasma::Constraints const
if (constraints & Plasma::SizeConstraint) {
switch (q->containmentType()) {
case PanelContainment:
case Containment::PanelContainment:
positionPanel();
break;
default:
@ -1203,7 +1203,7 @@ void Containment::Private::containmentConstraintsEvent(Plasma::Constraints const
}
}
Applet* Containment::Private::addApplet(const QString& name, const QVariantList& args,
Applet* ContainmentPrivate::addApplet(const QString& name, const QVariantList& args,
const QRectF& appletGeometry, uint id, bool delayInit)
{
if (!delayInit && q->immutability() != Mutable) {
@ -1230,13 +1230,13 @@ Applet* Containment::Private::addApplet(const QString& name, const QVariantList&
//kDebug() << applet->name() << "sizehint:" << applet->sizeHint() << "geometry:" << applet->geometry();
connect(applet, SIGNAL(configNeedsSaving()), q, SIGNAL(configNeedsSaving()));
connect(applet, SIGNAL(releaseVisualFocus()), q, SIGNAL(releaseVisualFocus()));
QObject::connect(applet, SIGNAL(configNeedsSaving()), q, SIGNAL(configNeedsSaving()));
QObject::connect(applet, SIGNAL(releaseVisualFocus()), q, SIGNAL(releaseVisualFocus()));
q->addApplet(applet, appletGeometry.topLeft(), delayInit);
return applet;
}
bool Containment::Private::regionIsEmpty(const QRectF &region, Applet *ignoredApplet) const
bool ContainmentPrivate::regionIsEmpty(const QRectF &region, Applet *ignoredApplet) const
{
foreach (Applet *applet, applets) {
if (applet != ignoredApplet && applet->geometry().intersects(region)) {
@ -1246,7 +1246,7 @@ bool Containment::Private::regionIsEmpty(const QRectF &region, Applet *ignoredAp
return true;
}
void Containment::Private::appletDestroyed(QObject* object)
void ContainmentPrivate::appletDestroyed(QObject* object)
{
// we do a static_cast here since it really isn't an Applet by this
// point anymore since we are in the qobject dtor. we don't actually
@ -1261,10 +1261,10 @@ void Containment::Private::appletDestroyed(QObject* object)
emit q->configNeedsSaving();
}
void Containment::Private::containmentAppletAnimationComplete(QGraphicsItem *item, Plasma::Animator::Animation anim)
void ContainmentPrivate::containmentAppletAnimationComplete(QGraphicsItem *item, Plasma::Animator::Animation anim)
{
if (anim == Animator::AppearAnimation &&
q->containmentType() == DesktopContainment &&
q->containmentType() == Containment::DesktopContainment &&
item->parentItem() == q) {
Applet *applet = qgraphicsitem_cast<Applet*>(item);
@ -1275,7 +1275,7 @@ void Containment::Private::containmentAppletAnimationComplete(QGraphicsItem *ite
}
}
void Containment::Private::positionContainment()
void ContainmentPrivate::positionContainment()
{
Corona *c = q->corona();
if (!c) {
@ -1289,7 +1289,7 @@ void Containment::Private::positionContainment()
while (it.hasNext()) {
Containment *containment = it.next();
if (containment == q ||
containment->containmentType() == PanelContainment) {
containment->containmentType() == Containment::PanelContainment) {
// weed out all containments we don't care about at all
// e.g. Panels and ourself
it.remove();
@ -1380,7 +1380,7 @@ void Containment::Private::positionContainment()
positioning = false;
}
void Containment::Private::positionPanel(bool force)
void ContainmentPrivate::positionPanel(bool force)
{
if (!q->scene()) {
kDebug() << "no scene yet";
@ -1409,7 +1409,7 @@ void Containment::Private::positionPanel(bool force)
// likely be too slow.
foreach (const Containment* other, q->corona()->containments()) {
if (other == q ||
other->containmentType() != PanelContainment ||
other->containmentType() != Containment::PanelContainment ||
horiz != (other->formFactor() == Plasma::Horizontal)) {
// only line up with panels of the same orientation
continue;

View File

@ -42,6 +42,7 @@ class DataEngine;
class Package;
class Corona;
class View;
class ContainmentPrivate;
/**
* @short The base class for plugins that provide backgrounds and applet grouping containers
@ -413,8 +414,8 @@ class PLASMA_EXPORT Containment : public Applet
Q_PRIVATE_SLOT(d, void toggleDesktopImmutability())
friend class Applet;
class Private;
Private* const d;
friend class ContainmentPrivate;
ContainmentPrivate* const d;
};
} // Plasma namespace

View File

@ -30,10 +30,10 @@ namespace Plasma
class Containment;
class ToolBox;
class Containment::Private
class ContainmentPrivate
{
public:
Private(Containment* c)
ContainmentPrivate(Containment* c)
: q(c),
formFactor(Planar),
location(Floating),
@ -45,7 +45,7 @@ public:
{
}
~Private()
~ContainmentPrivate()
{
qDeleteAll(applets);
applets.clear();

View File

@ -43,10 +43,10 @@ namespace Plasma
// and one happening should occur. currently 30 seconds
const int CONFIG_SYNC_TIMEOUT = 30000;
class Corona::Private
class CoronaPrivate
{
public:
Private(Corona *corona)
CoronaPrivate(Corona *corona)
: q(corona),
immutability(Mutable),
mimetype("text/x-plasmoidservicename"),
@ -59,7 +59,7 @@ public:
}
}
~Private()
~CoronaPrivate()
{
qDeleteAll(containments);
}
@ -67,7 +67,7 @@ public:
void init()
{
configSyncTimer.setSingleShot(true);
connect(&configSyncTimer, SIGNAL(timeout()), q, SLOT(syncConfig()));
QObject::connect(&configSyncTimer, SIGNAL(timeout()), q, SLOT(syncConfig()));
}
void saveLayout(KSharedConfigPtr cg) const
@ -145,10 +145,10 @@ public:
}
containments.append(containment);
connect(containment, SIGNAL(destroyed(QObject*)), q, SLOT(containmentDestroyed(QObject*)));
connect(containment, SIGNAL(configNeedsSaving()), q, SLOT(requestConfigSync()));
connect(containment, SIGNAL(releaseVisualFocus()), q, SIGNAL(releaseVisualFocus()));
connect(containment, SIGNAL(screenChanged(int,int,Plasma::Containment*)),
QObject::connect(containment, SIGNAL(destroyed(QObject*)), q, SLOT(containmentDestroyed(QObject*)));
QObject::connect(containment, SIGNAL(configNeedsSaving()), q, SLOT(requestConfigSync()));
QObject::connect(containment, SIGNAL(releaseVisualFocus()), q, SIGNAL(releaseVisualFocus()));
QObject::connect(containment, SIGNAL(screenChanged(int,int,Plasma::Containment*)),
q, SIGNAL(screenOwnerChanged(int,int,Plasma::Containment*)));
if (!delayedInit) {
@ -169,7 +169,7 @@ public:
Corona::Corona(QObject *parent)
: QGraphicsScene(parent),
d(new Private(this))
d(new CoronaPrivate(this))
{
d->init();
//setViewport(new QGLWidget(QGLFormat(QGL::StencilBuffer | QGL::AlphaChannel)));

View File

@ -31,6 +31,7 @@ namespace Plasma
{
class Containment;
class CoronaPrivate;
/**
* @short A QGraphicsScene for Plasma::Applets
@ -182,11 +183,12 @@ protected:
void dragMoveEvent(QGraphicsSceneDragDropEvent* event);
private:
class Private;
Private * const d;
CoronaPrivate * const d;
Q_PRIVATE_SLOT(d, void containmentDestroyed(QObject*))
Q_PRIVATE_SLOT(d, void syncConfig())
friend class CoronaPrivate;
};
} // namespace Plasma

View File

@ -31,7 +31,7 @@ namespace Plasma
DataContainer::DataContainer(QObject* parent)
: QObject(parent),
d(new Private())
d(new DataContainerPrivate())
{
}

View File

@ -28,6 +28,9 @@
namespace Plasma
{
class DataContainerPrivate;
/**
* @brief A set of data exported via a DataEngine
*
@ -42,6 +45,7 @@ namespace Plasma
class PLASMA_EXPORT DataContainer : public QObject
{
friend class DataEngine;
friend class DataEnginePrivate;
Q_OBJECT
public:
@ -147,8 +151,7 @@ protected Q_SLOTS:
private:
friend class SignalRelay;
class Private;
Private* const d;
DataContainerPrivate* const d;
};
} // Plasma namespace

View File

@ -28,10 +28,10 @@ namespace Plasma
class SignalRelay;
class DataContainer::Private
class DataContainerPrivate
{
public:
Private()
DataContainerPrivate()
: dirty(false), cached(false)
{}
@ -53,7 +53,7 @@ class SignalRelay : public QObject
Q_OBJECT
public:
SignalRelay(DataContainer* parent, DataContainer::Private *data, uint ival, Plasma::IntervalAlignment align)
SignalRelay(DataContainer* parent, DataContainerPrivate *data, uint ival, Plasma::IntervalAlignment align)
: QObject(parent),
dc(parent),
d(data),
@ -125,7 +125,7 @@ public:
}
DataContainer *dc;
DataContainer::Private *d;
DataContainerPrivate *d;
uint m_interval;
Plasma::IntervalAlignment m_align;
int m_timerId;
@ -162,7 +162,7 @@ protected:
}
};
SignalRelay* DataContainer::Private::signalRelay(const DataContainer* dc, QObject *visualization, uint pollingInterval, Plasma::IntervalAlignment align)
SignalRelay* DataContainerPrivate::signalRelay(const DataContainer* dc, QObject *visualization, uint pollingInterval, Plasma::IntervalAlignment align)
{
QMap<uint, SignalRelay *>::const_iterator relayIt = relays.find(pollingInterval);
SignalRelay *relay = 0;
@ -179,7 +179,7 @@ SignalRelay* DataContainer::Private::signalRelay(const DataContainer* dc, QObjec
return relay;
}
bool DataContainer::Private::hasUpdates()
bool DataContainerPrivate::hasUpdates()
{
if (cached) {
//some signalrelay needs us to pretend we did an update

View File

@ -43,14 +43,14 @@ namespace Plasma
DataEngine::DataEngine(QObject* parent, KService::Ptr service)
: QObject(parent),
d(new Private(this, service))
d(new DataEnginePrivate(this, service))
{
connect(d->updateTimer, SIGNAL(timeout()), this, SLOT(scheduleSourcesUpdated()));
}
DataEngine::DataEngine(QObject* parent, const QVariantList& args)
: QObject(parent),
d(new Private(this, KService::serviceByStorageId(args.count() > 0 ? args[0].toString() : QString())))
d(new DataEnginePrivate(this, KService::serviceByStorageId(args.count() > 0 ? args[0].toString() : QString())))
{
connect(d->updateTimer, SIGNAL(timeout()), this, SLOT(scheduleSourcesUpdated()));
}
@ -397,7 +397,7 @@ void DataEngine::setName(const QString& name)
}
// Private class implementations
DataEngine::Private::Private(DataEngine* e, KService::Ptr service)
DataEnginePrivate::DataEnginePrivate(DataEngine* e, KService::Ptr service)
: q(e),
refCount(-1), // first ref
updateTimerId(0),
@ -445,7 +445,7 @@ DataEngine::Private::Private(DataEngine* e, KService::Ptr service)
}
}
void DataEngine::Private::internalUpdateSource(DataContainer* source)
void DataEnginePrivate::internalUpdateSource(DataContainer* source)
{
if (minPollingInterval > 0 &&
source->timeSinceLastUpdate() < (uint)minPollingInterval) {
@ -463,22 +463,22 @@ void DataEngine::Private::internalUpdateSource(DataContainer* source)
}
}
void DataEngine::Private::ref()
void DataEnginePrivate::ref()
{
--refCount;
}
void DataEngine::Private::deref()
void DataEnginePrivate::deref()
{
++refCount;
}
bool DataEngine::Private::isUsed() const
bool DataEnginePrivate::isUsed() const
{
return refCount != 0;
}
DataContainer* DataEngine::Private::source(const QString& sourceName, bool createWhenMissing)
DataContainer* DataEnginePrivate::source(const QString& sourceName, bool createWhenMissing)
{
DataEngine::SourceDict::const_iterator it = sources.find(sourceName);
if (it != sources.constEnd()) {
@ -507,7 +507,7 @@ DataContainer* DataEngine::Private::source(const QString& sourceName, bool creat
DataContainer* s = new DataContainer(q);
s->setObjectName(sourceName);
sources.insert(sourceName, s);
connect(s, SIGNAL(updateRequested(DataContainer*)),
QObject::connect(s, SIGNAL(updateRequested(DataContainer*)),
q, SLOT(internalUpdateSource(DataContainer*)));
if (limit > 0) {
@ -517,7 +517,7 @@ DataContainer* DataEngine::Private::source(const QString& sourceName, bool creat
return s;
}
void DataEngine::Private::connectSource(DataContainer* s, QObject* visualization,
void DataEnginePrivate::connectSource(DataContainer* s, QObject* visualization,
uint pollingInterval,
Plasma::IntervalAlignment align, bool immediateCall)
{
@ -547,7 +547,7 @@ void DataEngine::Private::connectSource(DataContainer* s, QObject* visualization
}
}
DataContainer* DataEngine::Private::requestSource(const QString& sourceName, bool* newSource)
DataContainer* DataEnginePrivate::requestSource(const QString& sourceName, bool* newSource)
{
if (newSource) {
*newSource = false;
@ -569,7 +569,7 @@ DataContainer* DataEngine::Private::requestSource(const QString& sourceName, boo
if (newSource) {
*newSource = true;
}
connect(s, SIGNAL(becameUnused(QString)), q, SLOT(removeSource(QString)));
QObject::connect(s, SIGNAL(becameUnused(QString)), q, SLOT(removeSource(QString)));
}
}
}
@ -577,7 +577,7 @@ DataContainer* DataEngine::Private::requestSource(const QString& sourceName, boo
return s;
}
void DataEngine::Private::trimQueue()
void DataEnginePrivate::trimQueue()
{
uint queueCount = sourceQueue.count();
while (queueCount >= limit) {
@ -586,7 +586,7 @@ void DataEngine::Private::trimQueue()
}
}
void DataEngine::Private::queueUpdate()
void DataEnginePrivate::queueUpdate()
{
if (updateTimer->isActive()) {
return;

View File

@ -37,6 +37,7 @@ class DataContainer;
class DataEngineScript;
class Package;
class Service;
class DataEnginePrivate;
/**
* @class DataEngine
@ -54,6 +55,7 @@ class Service;
**/
class PLASMA_EXPORT DataEngine : public QObject
{
friend class DataEnginePrivate;
friend class DataEngineScript;
friend class DataEngineManager;
friend class NullEngine;
@ -422,8 +424,7 @@ class PLASMA_EXPORT DataEngine : public QObject
private:
Q_PRIVATE_SLOT(d, void internalUpdateSource(DataContainer* source))
class Private;
Private* const d;
DataEnginePrivate* const d;
};
} // Plasma namespace

View File

@ -28,10 +28,10 @@ class QTime;
namespace Plasma
{
class DataEngine::Private
class DataEnginePrivate
{
public:
Private(DataEngine* e, KService::Ptr service);
DataEnginePrivate(DataEngine* e, KService::Ptr service);
DataContainer* source(const QString& sourceName, bool createWhenMissing = true);
void connectSource(DataContainer* s, QObject* visualization, uint pollingInterval,
Plasma::IntervalAlignment align, bool immediateCall = true);

View File

@ -42,14 +42,14 @@ class NullEngine : public DataEngine
}
};
class DataEngineManager::Private
class DataEngineManagerPrivate
{
public:
Private()
DataEngineManagerPrivate()
: nullEng(0)
{}
~Private()
~DataEngineManagerPrivate()
{
foreach (Plasma::DataEngine* engine, engines) {
delete engine;
@ -85,7 +85,7 @@ DataEngineManager* DataEngineManager::self()
}
DataEngineManager::DataEngineManager()
: d(new Private())
: d(new DataEngineManagerPrivate())
{
}

View File

@ -26,6 +26,8 @@
namespace Plasma
{
class DataEngineManagerPrivate;
/**
* @brief DataEngine loader and life time manager
*
@ -80,8 +82,7 @@ class PLASMA_EXPORT DataEngineManager: public QObject
DataEngineManager();
~DataEngineManager();
class Private;
Private* const d;
DataEngineManagerPrivate* const d;
friend class DataEngineManagerSingleton;
};

View File

@ -46,12 +46,12 @@
namespace Plasma
{
class Delegate::Private
class DelegatePrivate
{
public:
Private() { }
DelegatePrivate() { }
~Private() { }
~DelegatePrivate() { }
QFont fontForSubTitle(const QFont& titleFont) const;
QRect titleRect(const QStyleOptionViewItem& option, const QModelIndex& index) const;
@ -70,7 +70,7 @@ class Delegate::Private
};
QFont Delegate::Private::fontForSubTitle(const QFont& titleFont) const
QFont DelegatePrivate::fontForSubTitle(const QFont& titleFont) const
{
QFont subTitleFont = titleFont;
subTitleFont.setPointSize(qMax(subTitleFont.pointSize() - 2,
@ -78,7 +78,7 @@ QFont Delegate::Private::fontForSubTitle(const QFont& titleFont) const
return subTitleFont;
}
QRect Delegate::Private::titleRect(const QStyleOptionViewItem& option, const QModelIndex& index) const
QRect DelegatePrivate::titleRect(const QStyleOptionViewItem& option, const QModelIndex& index) const
{
QFont font(option.font);
font.setBold(true);
@ -108,9 +108,9 @@ QRect Delegate::Private::titleRect(const QStyleOptionViewItem& option, const QMo
return textRect;
}
QRect Delegate::Private::subTitleRect(const QStyleOptionViewItem& option, const QModelIndex& index) const
QRect DelegatePrivate::subTitleRect(const QStyleOptionViewItem& option, const QModelIndex& index) const
{
QString subTitle = index.data(roles[SubTitleRole]).toString();
QString subTitle = index.data(roles[Delegate::SubTitleRole]).toString();
QFontMetrics fm(fontForSubTitle(option.font));
@ -134,7 +134,7 @@ QRect Delegate::Private::subTitleRect(const QStyleOptionViewItem& option, const
Delegate::Delegate(QObject *parent)
: QAbstractItemDelegate(parent),
d(new Private)
d(new DelegatePrivate)
{
}
@ -157,7 +157,7 @@ QRect Delegate::rectAfterTitle(const QStyleOptionViewItem& option, const QModelI
{
QRect textRect = d->titleRect(option, index);
QRect emptyRect(0, textRect.top(), option.rect.width() - textRect.width() - Private::ITEM_LEFT_MARGIN - Private::ITEM_RIGHT_MARGIN - option.decorationSize.width() - Private::ICON_TEXT_MARGIN, textRect.height());
QRect emptyRect(0, textRect.top(), option.rect.width() - textRect.width() - DelegatePrivate::ITEM_LEFT_MARGIN - DelegatePrivate::ITEM_RIGHT_MARGIN - option.decorationSize.width() - DelegatePrivate::ICON_TEXT_MARGIN, textRect.height());
if (option.direction == Qt::LeftToRight) {
emptyRect.moveLeft(textRect.right());
@ -176,7 +176,7 @@ QRect Delegate::rectAfterSubTitle(const QStyleOptionViewItem& option, const QMod
{
QRect textRect = d->subTitleRect(option, index);
QRect emptyRect(0, textRect.top(), option.rect.width() - textRect.width() - Private::ITEM_LEFT_MARGIN - Private::ITEM_RIGHT_MARGIN - option.decorationSize.width() - Private::ICON_TEXT_MARGIN, textRect.height());
QRect emptyRect(0, textRect.top(), option.rect.width() - textRect.width() - DelegatePrivate::ITEM_LEFT_MARGIN - DelegatePrivate::ITEM_RIGHT_MARGIN - option.decorationSize.width() - DelegatePrivate::ICON_TEXT_MARGIN, textRect.height());
if (option.direction == Qt::LeftToRight) {
emptyRect.moveLeft(textRect.right());
@ -214,7 +214,7 @@ void Delegate::paint(QPainter *painter, const QStyleOptionViewItem& option, cons
option.decorationPosition == QStyleOptionViewItem::Left ?
Qt::AlignLeft : Qt::AlignRight,
option.decorationSize,
contentRect.adjusted(Private::ITEM_LEFT_MARGIN,Private::ITEM_TOP_MARGIN,-Private::ITEM_RIGHT_MARGIN,-Private::ITEM_BOTTOM_MARGIN));
contentRect.adjusted(DelegatePrivate::ITEM_LEFT_MARGIN, DelegatePrivate::ITEM_TOP_MARGIN,-DelegatePrivate::ITEM_RIGHT_MARGIN,-DelegatePrivate::ITEM_BOTTOM_MARGIN));
decorationRect.moveTop(contentRect.top() + qMax(0, (contentRect.height() - decorationRect.height())) / 2);
QString titleText = index.data(Qt::DisplayRole).value<QString>();
@ -323,7 +323,7 @@ void Delegate::paint(QPainter *painter, const QStyleOptionViewItem& option, cons
if (index.data(d->roles[ColumnTypeRole]).toInt() == SecondaryActionColumn) {
if (hover) {
// Only draw on hover
const int delta = floor((qreal)(option.decorationSize.width() - Private::ACTION_ICON_SIZE)/2.0);
const int delta = floor((qreal)(option.decorationSize.width() - DelegatePrivate::ACTION_ICON_SIZE)/2.0);
decorationRect.adjust(delta, delta-1, -delta-1, -delta);
decorationIcon.paint(painter, decorationRect, option.decorationAlignment);
}

View File

@ -30,6 +30,8 @@
namespace Plasma
{
class DelegatePrivate;
/**
* Item delegate for rendering items in Plasma menus implemented with item views.
*
@ -106,8 +108,7 @@ protected:
virtual QSize sizeHint(const QStyleOptionViewItem& option , const QModelIndex& index) const;
private:
class Private;
Private * const d;
DelegatePrivate * const d;
};
}

View File

@ -77,10 +77,10 @@ class EmptyGraphicsItem : public QGraphicsItem
// used with QGrahphicsItem::setData
static const int ToolName = 7001;
class DesktopToolBox::Private
class DesktopToolBoxPrivate
{
public:
Private()
DesktopToolBoxPrivate()
: icon("plasma"),
toolBacker(0),
animCircleId(0),
@ -101,7 +101,7 @@ public:
DesktopToolBox::DesktopToolBox(QGraphicsItem *parent)
: ToolBox(parent),
d(new Private)
d(new DesktopToolBoxPrivate)
{
connect(Plasma::Animator::self(), SIGNAL(movementFinished(QGraphicsItem*)), this, SLOT(toolMoved(QGraphicsItem*)));

View File

@ -36,6 +36,7 @@ namespace Plasma
class Widget;
class EmptyGraphicsItem;
class DesktopToolBoxPrivate;
class DesktopToolBox : public ToolBox
{
@ -64,8 +65,7 @@ protected slots:
*/
void toggle();
private:
class Private;
Private *d;
DesktopToolBoxPrivate *d;
};
} // Plasma namespace

View File

@ -46,7 +46,7 @@
namespace Plasma
{
class Dialog::Private
class DialogPrivate
{
public:
/**
@ -68,7 +68,7 @@ public:
Dialog::Dialog( QWidget * parent, Qt::WindowFlags f )
: QWidget(parent, f),
d(new Private)
d(new DialogPrivate)
{
d->q = this;
d->background = new PanelSvg(this);

View File

@ -31,6 +31,8 @@
namespace Plasma
{
class DialogPrivate;
/**
* @short A dialog that uses the Plasma style
*
@ -76,8 +78,7 @@ class PLASMA_EXPORT Dialog : public QWidget
void resizeEvent(QResizeEvent *e);
private:
class Private;
Private * const d;
DialogPrivate * const d;
/**
* React to theme changes
*/

View File

@ -25,14 +25,14 @@
namespace Plasma {
class GLApplet::Private
class GLAppletPrivate
{
public:
Private()
GLAppletPrivate()
{
init();
}
~Private()
~GLAppletPrivate()
{
delete pbuf;
delete dummy;
@ -68,7 +68,7 @@ GLApplet::GLApplet(QGraphicsItem *parent,
const QString &serviceId,
int appletId)
: Applet(parent, serviceId, appletId),
d(new Private)
d(new GLAppletPrivate)
{
if (!d->dummy->isValid() ||
!QGLPixelBuffer::hasOpenGLPbuffers() ||
@ -79,7 +79,7 @@ GLApplet::GLApplet(QGraphicsItem *parent,
GLApplet::GLApplet(QObject *parent, const QVariantList &args)
: Applet(parent, args),
d(new Private)
d(new GLAppletPrivate)
{
if (!d->dummy->isValid() ||
!QGLPixelBuffer::hasOpenGLPbuffers() ||

View File

@ -27,6 +27,8 @@
namespace Plasma
{
class GLAppletPrivate;
/**
* @short Plasma Applet that is fully rendered using OpengGL
*
@ -77,8 +79,7 @@ class PLASMA_EXPORT GLApplet : public Applet
const QStyleOptionGraphicsItem *option,
const QRect &contentsRect);
private:
class Private;
Private *const d;
GLAppletPrivate *const d;
};
}

View File

@ -21,11 +21,11 @@
namespace Plasma {
class BorderLayout::Private {
class BorderLayoutPrivate {
public:
BorderLayout * q;
explicit Private(BorderLayout * parent = 0)
explicit BorderLayoutPrivate(BorderLayout * parent = 0)
: q(parent)
{
sizes[LeftPositioned] = -1;
@ -36,7 +36,7 @@ public:
}
virtual ~Private()
virtual ~BorderLayoutPrivate()
{
}
@ -47,7 +47,7 @@ public:
BorderLayout::BorderLayout(LayoutItem * parent) :
Layout(parent), d(new Private(this))
Layout(parent), d(new BorderLayoutPrivate(this))
{
if (parent) {
parent->setLayout(this);

View File

@ -28,6 +28,8 @@
namespace Plasma {
class BorderLayoutPrivate;
/**
* A layout which lays one item per border (left, top, bottom, right)
* and one item in center.
@ -89,8 +91,7 @@ protected:
void releaseManagedItems();
private:
class Private;
Private * const d;
BorderLayoutPrivate * const d;
};
}

View File

@ -42,10 +42,10 @@
namespace Plasma
{
class Package::Private
class PackagePrivate
{
public:
Private(const PackageStructure::Ptr st, const QString& p)
PackagePrivate(const PackageStructure::Ptr st, const QString& p)
: structure(st),
basePath(p),
valid(QFile::exists(basePath)),
@ -56,7 +56,7 @@ public:
}
}
~Private()
~PackagePrivate()
{
delete metadata;
}
@ -68,13 +68,13 @@ public:
};
Package::Package(const QString& packageRoot, const QString& package, PackageStructure::Ptr structure)
: d(new Private(structure, packageRoot + '/' + package))
: d(new PackagePrivate(structure, packageRoot + '/' + package))
{
structure->setPath(d->basePath);
}
Package::Package(const QString &packagePath, PackageStructure::Ptr structure)
: d(new Private(structure, packagePath))
: d(new PackagePrivate(structure, packagePath))
{
structure->setPath(d->basePath);
}

View File

@ -34,6 +34,7 @@ namespace Plasma
**/
class PackageMetadata;
class PackagePrivate;
class PLASMA_EXPORT Package
{
@ -155,8 +156,7 @@ class PLASMA_EXPORT Package
private:
Q_DISABLE_COPY(Package)
class Private;
Private * const d;
PackagePrivate * const d;
};
} // Namespace

View File

@ -27,7 +27,7 @@
namespace Plasma
{
class PackageMetadata::Private
class PackageMetadataPrivate
{
public:
QString name;
@ -46,12 +46,12 @@ class PackageMetadata::Private
};
PackageMetadata::PackageMetadata()
: d(new Private)
: d(new PackageMetadataPrivate)
{
}
PackageMetadata::PackageMetadata(const QString& path)
: d(new Private)
: d(new PackageMetadataPrivate)
{
read(path);
}

View File

@ -27,6 +27,8 @@
namespace Plasma
{
class PackageMetadataPrivate;
class PLASMA_EXPORT PackageMetadata
{
public:
@ -164,8 +166,7 @@ public:
void setImplementationApi(const QString& language);
private:
class Private;
Private * const d;
PackageMetadataPrivate * const d;
};
}

View File

@ -56,7 +56,7 @@ class ContentStructure
};
class PackageStructure::Private
class PackageStructurePrivate
{
public:
QString type;
@ -67,11 +67,11 @@ public:
static QHash<QString, PackageStructure::Ptr> structures;
};
QHash<QString, PackageStructure::Ptr> PackageStructure::Private::structures;
QHash<QString, PackageStructure::Ptr> PackageStructurePrivate::structures;
PackageStructure::PackageStructure(QObject *parent, const QString &type)
: QObject(parent),
d(new Private)
d(new PackageStructurePrivate)
{
d->type = type;
d->contentsPrefix = "contents/";
@ -88,7 +88,7 @@ PackageStructure::Ptr PackageStructure::load(const QString &packageFormat)
return Ptr(new PackageStructure());
}
PackageStructure::Ptr structure = Private::structures[packageFormat];
PackageStructure::Ptr structure = PackageStructurePrivate::structures[packageFormat];
if (structure) {
return structure;
@ -118,7 +118,7 @@ PackageStructure::Ptr PackageStructure::load(const QString &packageFormat)
if (!configPath.isEmpty()) {
KConfig config(configPath);
structure->read(&config);
Private::structures[packageFormat] = structure;
PackageStructurePrivate::structures[packageFormat] = structure;
}
return structure;

View File

@ -34,6 +34,8 @@ class KConfigBase;
namespace Plasma
{
class PackageStructurePrivate;
/**
* @brief A description of the expected file structure of a given package type
*
@ -256,8 +258,7 @@ protected:
virtual void pathChanged();
private:
class Private;
Private * const d;
PackageStructurePrivate * const d;
};
/**

View File

@ -73,16 +73,16 @@ public:
bool contentAtOrigin : 1;
};
class PanelSvg::Private
class PanelSvgPrivate
{
public:
Private(PanelSvg *psvg)
PanelSvgPrivate(PanelSvg *psvg)
: q(psvg),
cacheAll(false)
{
}
~Private()
~PanelSvgPrivate()
{
qDeleteAll(panels);
panels.clear();
@ -105,7 +105,7 @@ public:
PanelSvg::PanelSvg(QObject* parent)
: Svg(parent),
d(new Private(this))
d(new PanelSvgPrivate(this))
{
connect(this, SIGNAL(repaintNeeded()), this, SLOT(updateNeeded()));
d->panels.insert(QString(), new PanelData());
@ -367,7 +367,7 @@ void PanelSvg::paintPanel(QPainter* painter, const QRectF& rect, const QPointF&
painter->drawPixmap(rect, *(panel->cachedBackground), rect.translated(-pos.x()-leftOffset,-pos.y()-topOffset));
}
void PanelSvg::Private::generateBackground(PanelData *panel)
void PanelSvgPrivate::generateBackground(PanelData *panel)
{
//kDebug() << "generating background";
bool origined = panel->contentAtOrigin;
@ -450,13 +450,13 @@ void PanelSvg::Private::generateBackground(PanelData *panel)
}
// Corners
if (q->hasElement(prefix + "top") && panel->enabledBorders & TopBorder) {
if (q->hasElement(prefix + "top") && panel->enabledBorders & PanelSvg::TopBorder) {
if (!origined) {
contentTop = panel->topHeight;
bottomOffset += panel->topHeight;
}
if (q->hasElement(prefix + "topleft") && panel->enabledBorders & LeftBorder) {
if (q->hasElement(prefix + "topleft") && panel->enabledBorders & PanelSvg::LeftBorder) {
q->paint(&p, QRect(leftOffset, topOffset, panel->leftWidth, panel->topHeight), prefix + "topleft");
if (!origined) {
@ -465,13 +465,13 @@ void PanelSvg::Private::generateBackground(PanelData *panel)
}
}
if (q->hasElement(prefix + "topright") && panel->enabledBorders & RightBorder) {
if (q->hasElement(prefix + "topright") && panel->enabledBorders & PanelSvg::RightBorder) {
q->paint(&p, QRect(rightOffset, topOffset, panel->rightWidth, panel->topHeight), prefix + "topright");
}
}
if (q->hasElement(prefix + "bottom") && panel->enabledBorders & BottomBorder) {
if (q->hasElement(prefix + "bottomleft") && panel->enabledBorders & LeftBorder) {
if (q->hasElement(prefix + "bottom") && panel->enabledBorders & PanelSvg::BottomBorder) {
if (q->hasElement(prefix + "bottomleft") && panel->enabledBorders & PanelSvg::LeftBorder) {
q->paint(&p, QRect(leftOffset, bottomOffset, panel->leftWidth, panel->bottomHeight), prefix + "bottomleft");
if (!origined) {
@ -480,42 +480,42 @@ void PanelSvg::Private::generateBackground(PanelData *panel)
}
}
if (q->hasElement(prefix + "bottomright") && panel->enabledBorders & RightBorder) {
if (q->hasElement(prefix + "bottomright") && panel->enabledBorders & PanelSvg::RightBorder) {
q->paint(&p, QRect(rightOffset, bottomOffset, panel->rightWidth, panel->bottomHeight), prefix + "bottomright");
}
}
// Sides
if (panel->stretchBorders) {
if (panel->enabledBorders & LeftBorder || panel->enabledBorders & RightBorder) {
if (panel->enabledBorders & PanelSvg::LeftBorder || panel->enabledBorders & PanelSvg::RightBorder) {
q->resize(q->size().width(), scaledContentSize.height());
if (q->hasElement(prefix + "left") && panel->enabledBorders & 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 & 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 & TopBorder || panel->enabledBorders & BottomBorder) {
if (panel->enabledBorders & PanelSvg::TopBorder || panel->enabledBorders & PanelSvg::BottomBorder) {
q->resize(scaledContentSize.width(), q->size().height());
if (q->hasElement(prefix + "top") && panel->enabledBorders & 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 & 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 & LeftBorder) {
if (q->hasElement(prefix + "left") && panel->enabledBorders & PanelSvg::LeftBorder) {
QPixmap left(panel->leftWidth, leftHeight);
left.fill(Qt::transparent);
@ -526,7 +526,7 @@ void PanelSvg::Private::generateBackground(PanelData *panel)
p.drawTiledPixmap(QRect(leftOffset, contentTop, panel->leftWidth, contentHeight), left);
}
if (q->hasElement(prefix + "right") && panel->enabledBorders & RightBorder) {
if (q->hasElement(prefix + "right") && panel->enabledBorders & PanelSvg::RightBorder) {
QPixmap right(panel->rightWidth, leftHeight);
right.fill(Qt::transparent);
@ -537,7 +537,7 @@ void PanelSvg::Private::generateBackground(PanelData *panel)
p.drawTiledPixmap(QRect(rightOffset, contentTop, panel->rightWidth, contentHeight), right);
}
if (q->hasElement(prefix + "top") && panel->enabledBorders & TopBorder) {
if (q->hasElement(prefix + "top") && panel->enabledBorders & PanelSvg::TopBorder) {
QPixmap top(topWidth, panel->topHeight);
top.fill(Qt::transparent);
@ -548,7 +548,7 @@ void PanelSvg::Private::generateBackground(PanelData *panel)
p.drawTiledPixmap(QRect(contentLeft, topOffset, contentWidth, panel->topHeight), top);
}
if (q->hasElement(prefix + "bottom") && panel->enabledBorders & BottomBorder) {
if (q->hasElement(prefix + "bottom") && panel->enabledBorders & PanelSvg::BottomBorder) {
QPixmap bottom(topWidth, panel->bottomHeight);
bottom.fill(Qt::transparent);
@ -565,7 +565,7 @@ void PanelSvg::Private::generateBackground(PanelData *panel)
//paint(&p, QRect(contentLeft, contentTop, contentWidth, contentHeight), "center");
}
void PanelSvg::Private::updateSizes()
void PanelSvgPrivate::updateSizes()
{
//kDebug() << "!!!!!!!!!!!!!!!!!!!!!! updating sizes" << prefix;
PanelData *panel = panels[prefix];
@ -575,25 +575,25 @@ void PanelSvg::Private::updateSizes()
panel->cachedBackground = 0;
q->Svg::resize();
if (panel->enabledBorders & TopBorder) {
if (panel->enabledBorders & PanelSvg::TopBorder) {
panel->topHeight = q->elementSize(prefix + "top").height();
} else {
panel->topHeight = 0;
}
if (panel->enabledBorders & LeftBorder) {
if (panel->enabledBorders & PanelSvg::LeftBorder) {
panel->leftWidth = q->elementSize(prefix + "left").width();
} else {
panel->leftWidth = 0;
}
if (panel->enabledBorders & RightBorder) {
if (panel->enabledBorders & PanelSvg::RightBorder) {
panel->rightWidth = q->elementSize(prefix + "right").width();
} else {
panel->rightWidth = 0;
}
if (panel->enabledBorders & BottomBorder) {
if (panel->enabledBorders & PanelSvg::BottomBorder) {
panel->bottomHeight = q->elementSize(prefix + "bottom").height();
} else {
panel->bottomHeight = 0;
@ -605,13 +605,13 @@ void PanelSvg::Private::updateSizes()
panel->stretchBorders = q->hasElement("hint-stretch-borders");
}
void PanelSvg::Private::updateNeeded()
void PanelSvgPrivate::updateNeeded()
{
q->clearCache();
updateSizes();
}
void PanelSvg::Private::updateAndSignalSizes()
void PanelSvgPrivate::updateAndSignalSizes()
{
updateSizes();
emit q->repaintNeeded();

View File

@ -41,6 +41,8 @@ class QMatrix;
namespace Plasma
{
class PanelSvgPrivate;
class PLASMA_EXPORT PanelSvg : public Svg
{
Q_OBJECT
@ -194,8 +196,7 @@ class PLASMA_EXPORT PanelSvg : public Svg
Q_INVOKABLE void paintPanel(QPainter* painter, const QRectF& rect, const QPointF& pos = QPointF(0, 0));
private:
class Private;
Private * const d;
PanelSvgPrivate * const d;
Q_PRIVATE_SLOT(d, void updateSizes())
Q_PRIVATE_SLOT(d, void updateNeeded())

View File

@ -76,10 +76,10 @@ class EmptyGraphicsItem : public QGraphicsItem
// used with QGrahphicsItem::setData
static const int ToolName = 7001;
class PanelToolBox::Private
class PanelToolBoxPrivate
{
public:
Private()
PanelToolBoxPrivate()
: icon("plasma"),
toolBacker(0),
animId(0),
@ -95,7 +95,7 @@ public:
PanelToolBox::PanelToolBox(QGraphicsItem *parent)
: ToolBox(parent),
d(new Private)
d(new PanelToolBoxPrivate)
{
connect(Plasma::Animator::self(), SIGNAL(movementFinished(QGraphicsItem*)), this, SLOT(toolMoved(QGraphicsItem*)));

View File

@ -36,6 +36,7 @@ namespace Plasma
class Widget;
class EmptyGraphicsItem;
class PanelToolBoxPrivate;
class PanelToolBox : public ToolBox
{
@ -59,8 +60,7 @@ protected slots:
void animate(qreal progress);
void toolMoved(QGraphicsItem*);
private:
class Private;
Private *d;
PanelToolBoxPrivate *d;
};
} // Plasma namespace

View File

@ -32,10 +32,10 @@
namespace Plasma
{
class QueryMatch::Private : public QSharedData
class QueryMatchPrivate : public QSharedData
{
public:
Private(AbstractRunner *r)
QueryMatchPrivate(AbstractRunner *r)
: QSharedData(),
runner(r),
type(QueryMatch::ExactMatch),
@ -57,7 +57,7 @@ class QueryMatch::Private : public QSharedData
QueryMatch::QueryMatch(AbstractRunner *runner)
: d(new Private(runner))
: d(new QueryMatchPrivate(runner))
{
if (runner) {
d->id = runner->id();

View File

@ -33,6 +33,7 @@ namespace Plasma
class RunnerContext;
class AbstractRunner;
class QueryMatchPrivate;
/**
* @short A match returned by an AbstractRunner in response to a given
@ -164,8 +165,7 @@ class PLASMA_EXPORT QueryMatch
void setEnabled(bool enable);
private:
class Private;
QSharedDataPointer<Private> d;
QSharedDataPointer<QueryMatchPrivate> d;
};
}

View File

@ -47,17 +47,17 @@
namespace Plasma
{
class RunnerContext::Private : public QSharedData
class RunnerContextPrivate : public QSharedData
{
public:
Private(RunnerContext *context)
RunnerContextPrivate(RunnerContext *context)
: QSharedData(),
type(RunnerContext::UnknownType),
q(context)
{
}
Private(const RunnerContext::Private& p)
RunnerContextPrivate(const RunnerContextPrivate& p)
: QSharedData(),
type(RunnerContext::None),
q(p.q)
@ -65,7 +65,7 @@ class RunnerContext::Private : public QSharedData
//kDebug() << "¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿boo yeah" << type;
}
~Private()
~RunnerContextPrivate()
{
}
@ -77,20 +77,20 @@ class RunnerContext::Private : public QSharedData
// NOTE! this method must NEVER be called from
// code that may be running in multiple threads
// with the same data.
type = UnknownType;
type = RunnerContext::UnknownType;
QString path = QDir::cleanPath(KShell::tildeExpand(term));
int space = term.indexOf(' ');
if (space > 0) {
if (!KStandardDirs::findExe(path.left(space)).isEmpty()) {
type = ShellCommand;
type = RunnerContext::ShellCommand;
}
} else if (!KStandardDirs::findExe(path.left(space)).isEmpty()) {
type = Executable;
type = RunnerContext::Executable;
} else {
KUrl url(term);
if (!url.protocol().isEmpty() && !url.isLocalFile()) {
type = NetworkLocation;
type = RunnerContext::NetworkLocation;
} else if (QFile::exists(path)) {
QFileInfo info(path);
if (info.isSymLink()) {
@ -98,10 +98,10 @@ class RunnerContext::Private : public QSharedData
info = QFileInfo(path);
}
if (info.isDir()) {
type = Directory;
type = RunnerContext::Directory;
mimeType = "inode/folder";
} else if (info.isFile()) {
type = File;
type = RunnerContext::File;
KMimeType::Ptr mimeTypePtr = KMimeType::findByPath(path);
if (mimeTypePtr) {
mimeType = mimeTypePtr->name();
@ -123,7 +123,7 @@ class RunnerContext::Private : public QSharedData
RunnerContext::RunnerContext(QObject *parent)
: QObject(parent),
d(new Private(this))
d(new RunnerContextPrivate(this))
{
}

View File

@ -33,6 +33,7 @@ namespace Plasma
class QueryMatch;
class AbstractRunner;
class RunnerContextPrivate;
/**
* @short The RunnerContext class provides information related to a search,
@ -142,8 +143,7 @@ class PLASMA_EXPORT RunnerContext : public QObject
void matchesChanged();
private:
class Private;
QExplicitlySharedDataPointer<Private> d;
QExplicitlySharedDataPointer<RunnerContextPrivate> d;
};
}

View File

@ -185,17 +185,17 @@ Plasma::AbstractRunner* FindMatchesJob::runner() const
* RunnerManager::Private class
*
*****************************************************/
class RunnerManager::Private
class RunnerManagerPrivate
{
public:
Private(RunnerManager *parent)
RunnerManagerPrivate(RunnerManager *parent)
: q(parent),
deferredRun(0)
{
matchChangeTimer.setSingleShot(true);
connect(&matchChangeTimer, SIGNAL(timeout()), q, SLOT(matchesChanged()));
connect(&context, SIGNAL(matchesChanged()), q, SLOT(scheduleMatchesChanged()));
QObject::connect(&matchChangeTimer, SIGNAL(timeout()), q, SLOT(matchesChanged()));
QObject::connect(&context, SIGNAL(matchesChanged()), q, SLOT(scheduleMatchesChanged()));
}
void scheduleMatchesChanged()
@ -307,7 +307,7 @@ public:
*****************************************************/
RunnerManager::RunnerManager(QObject *parent)
: QObject(parent),
d(new Private(this))
d(new RunnerManagerPrivate(this))
{
KConfigGroup config(KGlobal::config(), "PlasmaRunnerManager");
d->loadConfiguration(config);
@ -317,7 +317,7 @@ RunnerManager::RunnerManager(QObject *parent)
RunnerManager::RunnerManager(KConfigGroup& config, QObject *parent)
: QObject(parent),
d(new Private(this))
d(new RunnerManagerPrivate(this))
{
d->loadConfiguration(config);
//ThreadWeaver::setDebugLevel(true, 4);

View File

@ -35,6 +35,7 @@ namespace Plasma
class QueryMatch;
class AbstractRunner;
class RunnerContext;
class RunnerManagerPrivate;
/**
* @short The RunnerManager class decides what installed runners are runnable,
@ -139,8 +140,9 @@ class PLASMA_EXPORT RunnerManager : public QObject
Q_PRIVATE_SLOT(d, void matchesChanged())
Q_PRIVATE_SLOT(d, void jobDone(ThreadWeaver::Job*))
class Private;
Private * const d;
RunnerManagerPrivate * const d;
friend class RunnerManagerPrivate;
};
}

View File

@ -25,7 +25,7 @@
namespace Plasma
{
class AppletScript::Private
class AppletScriptPrivate
{
public:
Applet* applet;
@ -33,7 +33,7 @@ public:
AppletScript::AppletScript(QObject *parent)
: ScriptEngine(parent),
d(new Private)
d(new AppletScriptPrivate)
{
d->applet = 0;
}

View File

@ -37,6 +37,8 @@ class QStyleOptionGraphicsItem;
namespace Plasma
{
class AppletScriptPrivate;
class PLASMA_EXPORT AppletScript : public ScriptEngine
{
Q_OBJECT
@ -130,8 +132,7 @@ protected:
const Package* package() const;
private:
class Private;
Private * const d;
AppletScriptPrivate * const d;
};
#define K_EXPORT_PLASMA_APPLETSCRIPTENGINE(libname, classname) \

View File

@ -24,7 +24,7 @@
namespace Plasma
{
class DataEngineScript::Private
class DataEngineScriptPrivate
{
public:
DataEngine* dataEngine;
@ -32,7 +32,7 @@ public:
DataEngineScript::DataEngineScript(QObject *parent)
: ScriptEngine(parent),
d(new Private)
d(new DataEngineScriptPrivate)
{
}

View File

@ -29,6 +29,7 @@ namespace Plasma
{
class DataEngine;
class DataEngineScriptPrivate;
class PLASMA_EXPORT DataEngineScript : public ScriptEngine
{
@ -87,8 +88,7 @@ protected:
void removeAllSources();
private:
class Private;
Private * const d;
DataEngineScriptPrivate * const d;
};
#define K_EXPORT_PLASMA_DATAENGINESCRIPTENGINE(libname, classname) \

View File

@ -25,7 +25,7 @@
namespace Plasma
{
class RunnerScript::Private
class RunnerScriptPrivate
{
public:
AbstractRunner* runner;
@ -33,7 +33,7 @@ public:
RunnerScript::RunnerScript(QObject *parent)
: ScriptEngine(parent),
d(new Private)
d(new RunnerScriptPrivate)
{
}

View File

@ -31,6 +31,7 @@ namespace Plasma
class AbstractRunner;
class RunnerContext;
class QueryMatch;
class RunnerScriptPrivate;
class PLASMA_EXPORT RunnerScript : public ScriptEngine
{
@ -84,8 +85,7 @@ protected:
const Package* package() const;
private:
class Private;
Private * const d;
RunnerScriptPrivate * const d;
};
#define K_EXPORT_PLASMA_RUNNERSCRIPTENGINE(libname, classname) \

View File

@ -41,6 +41,7 @@ class DataEngine;
class DataEngineScript;
class RunnerScript;
class Package;
class ScriptEnginePrivate;
/**
* @brief The base class for scripting interfaces to be used in loading
@ -85,8 +86,7 @@ protected:
virtual const Package* package() const;
private:
class Private;
Private * const d;
ScriptEnginePrivate * const d;
};
/**

View File

@ -36,13 +36,13 @@ namespace Plasma
Service::Service(QObject *parent)
: QObject(parent),
d(new Private(this))
d(new ServicePrivate(this))
{
}
Service::Service(QObject *parent, const QVariantList &args)
: QObject(parent),
d(new Private(this))
d(new ServicePrivate(this))
{
Q_UNUSED(args);
}

View File

@ -32,6 +32,7 @@ namespace Plasma
{
class ServiceJob;
class ServicePrivate;
/**
* @brief This class provides a generic API for write access to settings or services.
@ -173,8 +174,9 @@ protected:
private:
Q_PRIVATE_SLOT(d, void jobFinished(KJob*))
class Private;
Private * const d;
ServicePrivate * const d;
friend class ServicePrivate;
};
} // namespace Plasma

View File

@ -56,10 +56,10 @@ public:
}
};
class Service::Private
class ServicePrivate
{
public:
Private(Service *service)
ServicePrivate(Service *service)
: q(service),
config(0),
tempFile(0)

View File

@ -22,10 +22,10 @@
namespace Plasma
{
class ServiceJob::Private
class ServiceJobPrivate
{
public:
Private(const QString &dest, const QString &op, const QMap<QString, QVariant> &params)
ServiceJobPrivate(const QString &dest, const QString &op, const QMap<QString, QVariant> &params)
: destination(dest),
operation(op),
parameters(params)
@ -40,7 +40,7 @@ public:
ServiceJob::ServiceJob(const QString &destination, const QString &operation,
const QMap<QString, QVariant> &parameters, QObject *parent)
: KJob(parent),
d(new Private(destination, operation, parameters))
d(new ServiceJobPrivate(destination, operation, parameters))
{
}

View File

@ -28,6 +28,8 @@
namespace Plasma
{
class ServiceJobPrivate;
/**
* @brief This class provides jobs for use with Plasma::Service
*/
@ -76,8 +78,7 @@ protected:
void setResult(const QVariant &result);
private:
class Private;
Private * const d;
ServiceJobPrivate * const d;
};
} // namespace Plasma

22
svg.cpp
View File

@ -60,10 +60,10 @@ class SharedSvgRenderer : public KSvgRenderer, public QSharedData
}
};
class Svg::Private
class SvgPrivate
{
public:
Private(Svg *svg)
SvgPrivate(Svg *svg)
: q(svg),
renderer(0),
multipleImages(false),
@ -72,7 +72,7 @@ class Svg::Private
{
}
~Private()
~SvgPrivate()
{
eraseRenderer();
}
@ -80,8 +80,8 @@ class Svg::Private
void setImagePath(const QString &imagePath, Svg *q)
{
if (themed) {
disconnect(Plasma::Theme::defaultTheme(), SIGNAL(themeChanged()), q, SLOT(themeChanged()));
disconnect(KGlobalSettings::self(), SIGNAL(kdisplayPaletteChanged()), q, SLOT(colorsChanged()));
QObject::disconnect(Plasma::Theme::defaultTheme(), SIGNAL(themeChanged()), q, SLOT(themeChanged()));
QObject::disconnect(KGlobalSettings::self(), SIGNAL(kdisplayPaletteChanged()), q, SLOT(colorsChanged()));
}
themed = !QDir::isAbsolutePath(imagePath);
@ -89,13 +89,13 @@ class Svg::Private
if (themed) {
themePath = imagePath;
connect(Plasma::Theme::defaultTheme(), SIGNAL(themeChanged()), q, SLOT(themeChanged()));
QObject::connect(Plasma::Theme::defaultTheme(), SIGNAL(themeChanged()), q, SLOT(themeChanged()));
// check if svg wants colorscheme applied
createRenderer();
applyColors = renderer->elementExists("hint-apply-color-scheme");
if (applyColors && !Theme::defaultTheme()->colorScheme()) {
connect(KGlobalSettings::self(), SIGNAL(kdisplayPaletteChanged()), q, SLOT(colorsChanged()));
QObject::connect(KGlobalSettings::self(), SIGNAL(kdisplayPaletteChanged()), q, SLOT(colorsChanged()));
}
} else {
@ -272,9 +272,9 @@ class Svg::Private
createRenderer();
applyColors = renderer->elementExists("hint-apply-color-scheme");
if (applyColors && !Theme::defaultTheme()->colorScheme()) {
connect(KGlobalSettings::self(), SIGNAL(kdisplayPaletteChanged()), q, SLOT(colorsChanged()));
QObject::connect(KGlobalSettings::self(), SIGNAL(kdisplayPaletteChanged()), q, SLOT(colorsChanged()));
} else {
disconnect(KGlobalSettings::self(), SIGNAL(kdisplayPaletteChanged()), q, SLOT(colorsChanged()));
QObject::disconnect(KGlobalSettings::self(), SIGNAL(kdisplayPaletteChanged()), q, SLOT(colorsChanged()));
}
emit q->repaintNeeded();
@ -303,11 +303,11 @@ class Svg::Private
bool applyColors;
};
QHash<QString, SharedSvgRenderer::Ptr> Svg::Private::renderers;
QHash<QString, SharedSvgRenderer::Ptr> SvgPrivate::renderers;
Svg::Svg(QObject* parent)
: QObject(parent),
d(new Private(this))
d(new SvgPrivate(this))
{
}

9
svg.h
View File

@ -36,6 +36,9 @@ class QMatrix;
namespace Plasma
{
class SvgPrivate;
class PanelSvgPrivate;
/**
* @brief A theme aware image-centric SVG class
*
@ -187,11 +190,13 @@ class PLASMA_EXPORT Svg : public QObject
void repaintNeeded();
private:
class Private;
Private* const d;
SvgPrivate* const d;
Q_PRIVATE_SLOT(d, void themeChanged())
Q_PRIVATE_SLOT(d, void colorsChanged())
friend class SvgPrivate;
friend class PanelSvgPrivate;
};
} // Plasma namespace

View File

@ -45,10 +45,10 @@ namespace Plasma
static const int DEFAULT_WALLPAPER_WIDTH = 1920;
static const int DEFAULT_WALLPAPER_HEIGHT = 1200;
class Theme::Private
class ThemePrivate
{
public:
Private(Theme *theme)
ThemePrivate(Theme *theme)
: q(theme),
defaultWallpaperTheme(DEFAULT_WALLPAPER_THEME),
defaultWallpaperSuffix(DEFAULT_WALLPAPER_SUFFIX),
@ -109,10 +109,10 @@ public:
bool hasWallpapers : 1;
};
PackageStructure::Ptr Theme::Private::packageStructure(0);
const char *Theme::Private::defaultTheme = "default";
PackageStructure::Ptr ThemePrivate::packageStructure(0);
const char *ThemePrivate::defaultTheme = "default";
QString Theme::Private::findInTheme(const QString &image, const QString &theme) const
QString ThemePrivate::findInTheme(const QString &image, const QString &theme) const
{
//TODO: this should be using Package
QString search;
@ -134,7 +134,7 @@ QString Theme::Private::findInTheme(const QString &image, const QString &theme)
return search;
}
void Theme::Private::compositingChanged()
void ThemePrivate::compositingChanged()
{
#ifdef Q_WS_X11
bool nowCompositingActive = compositeWatch->owner() != None;
@ -166,7 +166,7 @@ Theme* Theme::defaultTheme()
Theme::Theme(QObject* parent)
: QObject(parent),
d(new Private(this))
d(new ThemePrivate(this))
{
settingsChanged();
@ -192,16 +192,16 @@ Theme::~Theme()
PackageStructure::Ptr Theme::packageStructure()
{
if (!Private::packageStructure) {
Private::packageStructure = new ThemePackage();
if (!ThemePrivate::packageStructure) {
ThemePrivate::packageStructure = new ThemePackage();
}
return Private::packageStructure;
return ThemePrivate::packageStructure;
}
void Theme::settingsChanged()
{
setThemeName(d->config().readEntry("name", Private::defaultTheme));
setThemeName(d->config().readEntry("name", ThemePrivate::defaultTheme));
}
void Theme::setThemeName(const QString &themeName)
@ -210,7 +210,7 @@ void Theme::setThemeName(const QString &themeName)
if (theme.isEmpty() || theme == d->themeName) {
// let's try and get the default theme at least
if (d->themeName.isEmpty()) {
theme = Private::defaultTheme;
theme = ThemePrivate::defaultTheme;
} else {
return;
}
@ -225,7 +225,7 @@ void Theme::setThemeName(const QString &themeName)
return;
}
theme = Private::defaultTheme;
theme = ThemePrivate::defaultTheme;
}
d->themeName = theme;
@ -265,7 +265,7 @@ void Theme::setThemeName(const QString &themeName)
if (d->isDefault) {
// we're the default theme, let's save our state
KConfigGroup &cg = d->config();
if (Private::defaultTheme == d->themeName) {
if (ThemePrivate::defaultTheme == d->themeName) {
cg.deleteEntry("name");
} else {
cg.writeEntry("name", d->themeName);
@ -284,8 +284,8 @@ QString Theme::imagePath(const QString& name) const
{
QString path = d->findInTheme(name + ".svg", d->themeName);
if (path.isEmpty() && d->themeName != Private::defaultTheme) {
path = d->findInTheme(name + ".svg", Private::defaultTheme);
if (path.isEmpty() && d->themeName != ThemePrivate::defaultTheme) {
path = d->findInTheme(name + ".svg", ThemePrivate::defaultTheme);
}
if (path.isEmpty()) {

View File

@ -31,6 +31,9 @@
namespace Plasma
{
class ThemePrivate;
/**
* @short Interface to the Plasma theme
*
@ -188,8 +191,8 @@ class PLASMA_EXPORT Theme : public QObject
private:
friend class ThemeSingleton;
class Private;
Private* const d;
friend class ThemePrivate;
ThemePrivate* const d;
Q_PRIVATE_SLOT(d, void compositingChanged())
};

View File

@ -35,10 +35,10 @@
namespace Plasma
{
class ToolBox::Private
class ToolBoxPrivate
{
public:
Private()
ToolBoxPrivate()
: size(50),
iconSize(32, 32),
hidden(false),
@ -55,7 +55,7 @@ public:
ToolBox::ToolBox(QGraphicsItem *parent)
: QGraphicsItem(parent),
d(new Private)
d(new ToolBoxPrivate)
{
setAcceptsHoverEvents(true);
}

View File

@ -33,6 +33,7 @@ namespace Plasma
//class Widget;
//class EmptyGraphicsItem;
class ToolBoxPrivate;
class ToolBox : public QObject, public QGraphicsItem
{
@ -75,8 +76,7 @@ protected:
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
private:
class Private;
Private *d;
ToolBoxPrivate *d;
};
} // Plasma namespace

View File

@ -24,7 +24,7 @@
namespace Plasma
{
class UiLoader::Private
class UiLoaderPrivate
{
public:
QStringList widgets;
@ -32,7 +32,7 @@ public:
};
UiLoader::UiLoader( QObject *parent )
: d( new Private() )
: d( new UiLoaderPrivate() )
{
d->widgets
<< "CheckBox"

View File

@ -33,6 +33,7 @@ namespace Plasma
class Widget;
class Layout;
class LayoutItem;
class UiLoaderPrivate;
/**
* Dynamically create plasma Widgets and Layouts.
@ -54,8 +55,7 @@ public:
Layout *createLayout(const QString &className, LayoutItem *parent);
private:
class Private;
Private *const d;
UiLoaderPrivate *const d;
};
}

View File

@ -31,10 +31,10 @@ using namespace Plasma;
namespace Plasma
{
class View::Private
class ViewPrivate
{
public:
Private(View *view, int uniqueId)
ViewPrivate(View *view, int uniqueId)
: drawWallpaper(true),
trackChanges(true),
desktop(-1),
@ -54,7 +54,7 @@ public:
}
}
~Private()
~ViewPrivate()
{
}
@ -95,11 +95,11 @@ public:
static int s_maxViewId;
};
int View::Private::s_maxViewId(0);
int ViewPrivate::s_maxViewId(0);
View::View(Containment *containment, QWidget *parent)
: QGraphicsView(parent),
d(new Private(this, 0))
d(new ViewPrivate(this, 0))
{
Q_ASSERT(containment);
d->initGraphicsView();
@ -109,7 +109,7 @@ View::View(Containment *containment, QWidget *parent)
View::View(Containment *containment, int viewId, QWidget *parent)
: QGraphicsView(parent),
d(new Private(this, viewId))
d(new ViewPrivate(this, viewId))
{
Q_ASSERT(containment);
d->initGraphicsView();

6
view.h
View File

@ -32,6 +32,7 @@ namespace Plasma
class Containment;
class Corona;
class ViewPrivate;
/**
* @short A QGraphicsView for Plasma::Applets. Each View is associated with
@ -174,10 +175,11 @@ protected:
KConfigGroup config() const;
private:
class Private;
Private * const d;
ViewPrivate * const d;
Q_PRIVATE_SLOT(d, void updateSceneRect())
friend class ViewPrivate;
};
} // namespace Plasma

View File

@ -31,15 +31,15 @@
namespace Plasma
{
class CheckBox::Private
class CheckBoxPrivate
{
public:
Private()
CheckBoxPrivate()
: svg(0)
{
}
~Private()
~CheckBoxPrivate()
{
delete svg;
}
@ -71,7 +71,7 @@ public:
CheckBox::CheckBox(QGraphicsWidget *parent)
: QGraphicsProxyWidget(parent),
d(new Private)
d(new CheckBoxPrivate)
{
QCheckBox* native = new QCheckBox;
connect(native, SIGNAL(toggled(bool)), this, SIGNAL(toggled(bool)));

View File

@ -30,6 +30,8 @@ class QCheckBox;
namespace Plasma
{
class CheckBoxPrivate;
class PLASMA_EXPORT CheckBox : public QGraphicsProxyWidget
{
Q_OBJECT
@ -105,8 +107,7 @@ protected:
void resizeEvent(QGraphicsSceneResizeEvent *event);
private:
class Private;
Private * const d;
CheckBoxPrivate * const d;
};
} // namespace Plasma

View File

@ -30,21 +30,21 @@
namespace Plasma
{
class ComboBox::Private
class ComboBoxPrivate
{
public:
Private()
ComboBoxPrivate()
{
}
~Private()
~ComboBoxPrivate()
{
}
};
ComboBox::ComboBox(QGraphicsWidget *parent)
: QGraphicsProxyWidget(parent),
d(new Private)
d(new ComboBoxPrivate)
{
KComboBox* native = new KComboBox;
connect(native, SIGNAL(activated(const QString &)), this, SIGNAL(activated(const QString &)));

View File

@ -30,6 +30,8 @@ class KComboBox;
namespace Plasma
{
class ComboBoxPrivate;
class PLASMA_EXPORT ComboBox : public QGraphicsProxyWidget
{
Q_OBJECT
@ -81,8 +83,7 @@ protected:
void resizeEvent(QGraphicsSceneResizeEvent *event);
private:
class Private;
Private * const d;
ComboBoxPrivate * const d;
};
} // namespace Plasma

View File

@ -34,14 +34,14 @@
using namespace Plasma;
class Flash::Private
class Plasma::FlashPrivate
{
public:
enum FlashType { Text, Pixmap };
enum State { Visible, Invisible };
Private() { }
~Private() { }
FlashPrivate() { }
~FlashPrivate() { }
QString text;
QColor color;
@ -63,13 +63,13 @@ class Flash::Private
Flash::Flash(QGraphicsItem *parent)
: QGraphicsWidget(parent),
d(new Private)
d(new FlashPrivate)
{
d->defaultDuration = 3000;
d->type = Private::Text;
d->type = FlashPrivate::Text;
d->color = Qt::black;
d->animId = 0;
d->state = Private::Invisible;
d->state = FlashPrivate::Invisible;
setSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::Minimum );
@ -99,7 +99,7 @@ void Flash::setFont( const QFont &font )
void Flash::flash( const QString &text, int duration, const QTextOption &option)
{
kDebug() << duration;
d->type = Private::Text;
d->type = FlashPrivate::Text;
d->duration = (duration == 0) ? d->defaultDuration : duration;
d->text = text;
d->textOption = option;
@ -108,7 +108,7 @@ void Flash::flash( const QString &text, int duration, const QTextOption &option)
void Flash::flash( const QPixmap &pixmap, int duration, Qt::Alignment align )
{
d->type = Private::Pixmap;
d->type = FlashPrivate::Pixmap;
d->duration = (duration == 0) ? d->defaultDuration : duration;
d->pixmap = pixmap;
d->alignment = align;
@ -117,13 +117,13 @@ void Flash::flash( const QPixmap &pixmap, int duration, Qt::Alignment align )
void Flash::kill()
{
if( d->state == Private::Visible )
if( d->state == FlashPrivate::Visible )
fadeOut();
}
void Flash::fadeIn()
{
d->state = Private::Visible;
d->state = FlashPrivate::Visible;
d->renderedPixmap = renderPixmap();
d->animId = Plasma::Animator::self()->animateElement(this, Plasma::Animator::AppearAnimation);
Plasma::Animator::self()->setInitialPixmap( d->animId, d->renderedPixmap );
@ -133,10 +133,10 @@ void Flash::fadeIn()
void Flash::fadeOut()
{
if( d->state == Private::Invisible )
if( d->state == FlashPrivate::Invisible )
return; // Flash was already killed - do not animate again
d->state = Private::Invisible;
d->state = FlashPrivate::Invisible;
d->animId = Plasma::Animator::self()->animateElement(this, Plasma::Animator::DisappearAnimation);
Plasma::Animator::self()->setInitialPixmap( d->animId, d->renderedPixmap );
}
@ -147,11 +147,11 @@ QPixmap Flash::renderPixmap()
pm.fill(Qt::transparent);
QPainter painter( &pm );
if( d->type == Private::Text ) {
if( d->type == FlashPrivate::Text ) {
painter.setPen( d->color );
painter.setFont( d->font );
painter.drawText( QRect( QPoint(0, 0), size().toSize() ), d->text, d->textOption);
} else if( d->type == Private::Pixmap ) {
} else if( d->type == FlashPrivate::Pixmap ) {
QPoint p;
if( d->alignment & Qt::AlignLeft )
p.setX( 0 );
@ -178,7 +178,7 @@ void Flash::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWi
if( d->animId && !Plasma::Animator::self()->currentPixmap(d->animId).isNull() ) {
painter->drawPixmap( 0, 0, Plasma::Animator::self()->currentPixmap(d->animId) );
} else if( d->state == Private::Visible ) {
} else if( d->state == FlashPrivate::Visible ) {
painter->drawPixmap( 0, 0, d->renderedPixmap );
}
}

View File

@ -29,6 +29,8 @@
namespace Plasma
{
class FlashPrivate;
/**
* Class that allows to flash text or icons inside plasma
*/
@ -59,8 +61,7 @@ class PLASMA_EXPORT Flash : public QGraphicsWidget
QPixmap renderPixmap();
private:
class Private;
Private * const d;
FlashPrivate * const d;
};
}

View File

@ -30,21 +30,21 @@
namespace Plasma
{
class GroupBox::Private
class GroupBoxPrivate
{
public:
Private()
GroupBoxPrivate()
{
}
~Private()
~GroupBoxPrivate()
{
}
};
GroupBox::GroupBox(QGraphicsWidget *parent)
: QGraphicsProxyWidget(parent),
d(new Private)
d(new GroupBoxPrivate)
{
QGroupBox* native = new QGroupBox;
setWidget(native);

View File

@ -30,6 +30,8 @@ class QGroupBox;
namespace Plasma
{
class GroupBoxPrivate;
class PLASMA_EXPORT GroupBox : public QGraphicsProxyWidget
{
Q_OBJECT
@ -78,8 +80,7 @@ protected:
void resizeEvent(QGraphicsSceneResizeEvent *event);
private:
class Private;
Private * const d;
GroupBoxPrivate * const d;
};
} // namespace Plasma

View File

@ -58,11 +58,11 @@
namespace Plasma
{
Icon::Private::Private(Icon *i)
IconPrivate::IconPrivate(Icon *i)
: q(i),
iconSvg(0),
iconSize(48, 48),
states(Private::NoState),
states(IconPrivate::NoState),
orientation(Qt::Vertical),
numDisplayLines(2),
invertLayout(false),
@ -73,7 +73,7 @@ Icon::Private::Private(Icon *i)
m_hoverAlpha = 20/255;
}
Icon::Private::~Private()
IconPrivate::~IconPrivate()
{
qDeleteAll(cornerActions);
delete iconSvg;
@ -169,11 +169,11 @@ void IconAction::rebuildPixmap()
m_pixmap = QPixmap(26, 26);
m_pixmap.fill(Qt::transparent);
int element = Icon::Private::Minibutton;
int element = IconPrivate::Minibutton;
if (m_pressed) {
element = Icon::Private::MinibuttonPressed;
element = IconPrivate::MinibuttonPressed;
} else if (m_hovered) {
element = Icon::Private::MinibuttonHover;
element = IconPrivate::MinibuttonHover;
}
QPainter painter(&m_pixmap);
@ -260,14 +260,14 @@ void IconAction::paint(QPainter *painter) const
Icon::Icon(QGraphicsItem *parent)
: QGraphicsWidget(parent),
d(new Private(this))
d(new IconPrivate(this))
{
init();
}
Icon::Icon(const QString &text, QGraphicsItem *parent)
: QGraphicsWidget(parent),
d(new Private(this))
d(new IconPrivate(this))
{
setText(text);
init();
@ -275,7 +275,7 @@ Icon::Icon(const QString &text, QGraphicsItem *parent)
Icon::Icon(const QIcon &icon, const QString &text, QGraphicsItem *parent)
: QGraphicsWidget(parent),
d(new Private(this))
d(new IconPrivate(this))
{
setText(text);
setIcon(icon);
@ -299,14 +299,14 @@ void Icon::init()
int focusVMargin = QApplication::style()->pixelMetric(QStyle::PM_FocusFrameVMargin);
// Margins for horizontal mode (list views, tree views, table views)
d->setHorizontalMargin(Private::TextMargin, focusHMargin, focusVMargin);
d->setHorizontalMargin(Private::IconMargin, focusHMargin, focusVMargin);
d->setHorizontalMargin(Private::ItemMargin, 0, 0);
d->setHorizontalMargin(IconPrivate::TextMargin, focusHMargin, focusVMargin);
d->setHorizontalMargin(IconPrivate::IconMargin, focusHMargin, focusVMargin);
d->setHorizontalMargin(IconPrivate::ItemMargin, 0, 0);
// Margins for vertical mode (icon views)
d->setVerticalMargin(Private::TextMargin, 6, 2);
d->setVerticalMargin(Private::IconMargin, focusHMargin, focusVMargin);
d->setVerticalMargin(Private::ItemMargin, 0, 0);
d->setVerticalMargin(IconPrivate::TextMargin, 6, 2);
d->setVerticalMargin(IconPrivate::IconMargin, focusHMargin, focusVMargin);
d->setVerticalMargin(IconPrivate::ItemMargin, 0, 0);
d->setActiveMargins();
d->currentSize = QSizeF(-1, -1);
@ -324,7 +324,7 @@ void Icon::addIconAction(QAction *action)
d->cornerActions.append(iconAction);
connect(action, SIGNAL(destroyed(QObject*)), this, SLOT(actionDestroyed(QObject*)));
iconAction->setRect(d->actionRect((Private::ActionPosition)count));
iconAction->setRect(d->actionRect((IconPrivate::ActionPosition)count));
}
void Icon::setAction(QAction *action)
@ -396,7 +396,7 @@ QPainterPath Icon::shape() const
return roundedRectangle(QRectF(QPointF(0.0, 0.0), d->currentSize).adjusted(-2, -2, 2, 2), 10.0);
}
QSizeF Icon::Private::displaySizeHint(const QStyleOptionGraphicsItem *option, const qreal width) const
QSizeF IconPrivate::displaySizeHint(const QStyleOptionGraphicsItem *option, const qreal width) const
{
if (text.isEmpty() && infoText.isEmpty()) {
return QSizeF( .0, .0 );
@ -408,8 +408,8 @@ QSizeF Icon::Private::displaySizeHint(const QStyleOptionGraphicsItem *option, co
qreal textWidth = width -
horizontalMargin[Private::TextMargin].left -
horizontalMargin[Private::TextMargin].right;
horizontalMargin[IconPrivate::TextMargin].left -
horizontalMargin[IconPrivate::TextMargin].right;
//allow only five lines of text
const qreal maxHeight = numDisplayLines*Plasma::Theme::defaultTheme()->fontMetrics().lineSpacing();
@ -445,8 +445,8 @@ void Icon::layoutIcons(const QStyleOptionGraphicsItem *option)
if (!d->text.isEmpty() || !d->infoText.isEmpty()) {
heightAvail = d->currentSize.height() -
d->displaySizeHint(option, d->currentSize.width()).height() -
d->verticalMargin[Private::TextMargin].top -
d->verticalMargin[Private::TextMargin].bottom;
d->verticalMargin[IconPrivate::TextMargin].top -
d->verticalMargin[IconPrivate::TextMargin].bottom;
//never make a label higher than half the total height
heightAvail = qMax(heightAvail, d->currentSize.height()/2);
} else {
@ -456,12 +456,12 @@ void Icon::layoutIcons(const QStyleOptionGraphicsItem *option)
//aspect ratio very "tall"
if (d->currentSize.width() < heightAvail) {
iconWidth = d->currentSize.width() -
d->horizontalMargin[Private::IconMargin].left -
d->horizontalMargin[Private::IconMargin].right;
d->horizontalMargin[IconPrivate::IconMargin].left -
d->horizontalMargin[IconPrivate::IconMargin].right;
} else {
iconWidth = heightAvail -
d->verticalMargin[Private::IconMargin].top -
d->verticalMargin[Private::IconMargin].bottom;
d->verticalMargin[IconPrivate::IconMargin].top -
d->verticalMargin[IconPrivate::IconMargin].bottom;
}
} else {
//Horizontal layout
@ -471,12 +471,12 @@ void Icon::layoutIcons(const QStyleOptionGraphicsItem *option)
if (d->text.isEmpty() && d->infoText.isEmpty()) {
// with no text, we just take up the whole geometry
iconWidth = d->currentSize.width() -
d->horizontalMargin[Private::IconMargin].left -
d->horizontalMargin[Private::IconMargin].right;
d->horizontalMargin[IconPrivate::IconMargin].left -
d->horizontalMargin[IconPrivate::IconMargin].right;
} else {
iconWidth = d->currentSize.height() -
d->verticalMargin[Private::IconMargin].top -
d->verticalMargin[Private::IconMargin].bottom;
d->verticalMargin[IconPrivate::IconMargin].top -
d->verticalMargin[IconPrivate::IconMargin].bottom;
}
}
@ -484,7 +484,7 @@ void Icon::layoutIcons(const QStyleOptionGraphicsItem *option)
int count = 0;
foreach (IconAction* iconAction, d->cornerActions) {
iconAction->setRect(d->actionRect((Private::ActionPosition)count));
iconAction->setRect(d->actionRect((IconPrivate::ActionPosition)count));
++count;
}
}
@ -503,14 +503,14 @@ void Icon::setSvg(const QString &svgFilePath, const QString &elementId)
void Icon::hoverEffect(bool show)
{
if (show) {
d->states |= Private::HoverState;
d->states |= IconPrivate::HoverState;
}
if (d->m_hoverAnimId == -1 && !d->drawBg) {
// we do this only when we don't do the anim, because
// this gets set at animation end when we are animating
if (!show) {
d->states &= ~Private::HoverState;
d->states &= ~IconPrivate::HoverState;
}
return;
@ -541,12 +541,12 @@ void Icon::hoverAnimationUpdate(qreal progress)
d->m_hoverAnimId = -1;
}
if (!d->m_fadeIn && progress == 1 ) {
d->states &= ~Private::HoverState;
d->states &= ~IconPrivate::HoverState;
}
update();
}
void Icon::Private::drawBackground(QPainter *painter, IconState state)
void IconPrivate::drawBackground(QPainter *painter, IconState state)
{
if (!drawBg) {
return;
@ -557,13 +557,13 @@ void Icon::Private::drawBackground(QPainter *painter, IconState state)
QColor border = textColor;
switch (state) {
case Private::HoverState:
case IconPrivate::HoverState:
shadow.setHsv(shadow.hue(),
shadow.saturation(),
shadow.value() + (int)(darkShadow ? 50 * m_hoverAlpha: -50 * m_hoverAlpha),
200 + (int)m_hoverAlpha * 55); // opacity
break;
case Private::PressedState:
case IconPrivate::PressedState:
shadow.setHsv(shadow.hue(),
shadow.saturation(),
shadow.value() + (darkShadow?(int)(50*m_hoverAlpha):(int)(-50*m_hoverAlpha)),
@ -585,7 +585,7 @@ void Icon::Private::drawBackground(QPainter *painter, IconState state)
painter->restore();
}
QPixmap Icon::Private::decoration(const QStyleOptionGraphicsItem *option, bool useHoverEffect)
QPixmap IconPrivate::decoration(const QStyleOptionGraphicsItem *option, bool useHoverEffect)
{
QPixmap result;
@ -624,12 +624,12 @@ QPixmap Icon::Private::decoration(const QStyleOptionGraphicsItem *option, bool u
return result;
}
QPointF Icon::Private::iconPosition(const QStyleOptionGraphicsItem *option, const QPixmap &pixmap) const
QPointF IconPrivate::iconPosition(const QStyleOptionGraphicsItem *option, const QPixmap &pixmap) const
{
const QRectF itemRect = subtractMargin(option->rect, Private::ItemMargin);
const QRectF itemRect = subtractMargin(option->rect, IconPrivate::ItemMargin);
// Compute the nominal decoration rectangle
const QSizeF size = addMargin(iconSize, Private::IconMargin);
const QSizeF size = addMargin(iconSize, IconPrivate::IconMargin);
Qt::LayoutDirection direction = iconDirection(option);
@ -656,7 +656,7 @@ QPointF Icon::Private::iconPosition(const QStyleOptionGraphicsItem *option, cons
return QPointF(pixmapRect.topLeft());
}
QRectF Icon::Private::labelRectangle(const QStyleOptionGraphicsItem *option, const QPixmap &icon,
QRectF IconPrivate::labelRectangle(const QStyleOptionGraphicsItem *option, const QPixmap &icon,
const QString &string) const
{
Q_UNUSED(string)
@ -665,8 +665,8 @@ QRectF Icon::Private::labelRectangle(const QStyleOptionGraphicsItem *option, con
return option->rect;
}
const QSizeF decoSize = addMargin(iconSize, Private::IconMargin);
const QRectF itemRect = subtractMargin(option->rect, Private::ItemMargin);
const QSizeF decoSize = addMargin(iconSize, IconPrivate::IconMargin);
const QRectF itemRect = subtractMargin(option->rect, IconPrivate::ItemMargin);
QRectF textArea(QPointF(0, 0), itemRect.size());
if (orientation == Qt::Vertical) {
@ -681,7 +681,7 @@ QRectF Icon::Private::labelRectangle(const QStyleOptionGraphicsItem *option, con
}
// Lays the text out in a rectangle no larger than constraints, eliding it as necessary
QSizeF Icon::Private::layoutText(QTextLayout &layout, const QStyleOptionGraphicsItem *option,
QSizeF IconPrivate::layoutText(QTextLayout &layout, const QStyleOptionGraphicsItem *option,
const QString &text, const QSizeF &constraints) const
{
const QSizeF size = layoutText(layout, text, constraints.width());
@ -696,7 +696,7 @@ QSizeF Icon::Private::layoutText(QTextLayout &layout, const QStyleOptionGraphics
}
// Lays the text out in a rectangle no wider than maxWidth
QSizeF Icon::Private::layoutText(QTextLayout &layout, const QString &text, qreal maxWidth) const
QSizeF IconPrivate::layoutText(QTextLayout &layout, const QString &text, qreal maxWidth) const
{
QFontMetricsF metrics(layout.font());
qreal leading = metrics.leading();
@ -725,7 +725,7 @@ QSizeF Icon::Private::layoutText(QTextLayout &layout, const QString &text, qreal
// or word breaking the line if it's wider than the max width, and finally adding an
// ellipses at the end of the last line, if there are more lines than will fit within
// the vertical size constraints.
QString Icon::Private::elidedText(QTextLayout &layout, const QStyleOptionGraphicsItem *option,
QString IconPrivate::elidedText(QTextLayout &layout, const QStyleOptionGraphicsItem *option,
const QSizeF &size) const
{
Q_UNUSED(option)
@ -768,7 +768,7 @@ QString Icon::Private::elidedText(QTextLayout &layout, const QStyleOptionGraphic
return elided;
}
void Icon::Private::layoutTextItems(const QStyleOptionGraphicsItem *option,
void IconPrivate::layoutTextItems(const QStyleOptionGraphicsItem *option,
const QPixmap &icon, QTextLayout *labelLayout,
QTextLayout *infoLayout, QRectF *textBoundingRect) const
{
@ -778,7 +778,7 @@ void Icon::Private::layoutTextItems(const QStyleOptionGraphicsItem *option,
QFontMetricsF fm(labelLayout->font());
const QRectF textArea = labelRectangle(option, icon, text);
QRectF textRect = subtractMargin(textArea, Private::TextMargin);
QRectF textRect = subtractMargin(textArea, IconPrivate::TextMargin);
//kDebug() << this << "text area" << textArea << "text rect" << textRect;
// Sizes and constraints for the different text parts
@ -819,7 +819,7 @@ void Icon::Private::layoutTextItems(const QStyleOptionGraphicsItem *option,
//kDebug() << "final position is" << labelLayout->position();
}
QBrush Icon::Private::foregroundBrush(const QStyleOptionGraphicsItem *option) const
QBrush IconPrivate::foregroundBrush(const QStyleOptionGraphicsItem *option) const
{
const QPalette::ColorGroup group = option->state & QStyle::State_Enabled ?
QPalette::Normal : QPalette::Disabled;
@ -831,7 +831,7 @@ QBrush Icon::Private::foregroundBrush(const QStyleOptionGraphicsItem *option) co
return option->palette.brush(group, QPalette::Text);
}
QBrush Icon::Private::backgroundBrush(const QStyleOptionGraphicsItem *option) const
QBrush IconPrivate::backgroundBrush(const QStyleOptionGraphicsItem *option) const
{
const QPalette::ColorGroup group = option->state & QStyle::State_Enabled ?
QPalette::Normal : QPalette::Disabled;
@ -845,7 +845,7 @@ QBrush Icon::Private::backgroundBrush(const QStyleOptionGraphicsItem *option) co
return background;
}
void Icon::Private::drawTextItems(QPainter *painter, const QStyleOptionGraphicsItem *option,
void IconPrivate::drawTextItems(QPainter *painter, const QStyleOptionGraphicsItem *option,
const QTextLayout &labelLayout, const QTextLayout &infoLayout) const
{
Q_UNUSED(option)
@ -872,7 +872,7 @@ void Icon::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWid
Q_UNUSED(widget)
#ifdef BACKINGSTORE_BLUR_HACK
if (d->state == Private::HoverState && scene()) {
if (d->state == IconPrivate::HoverState && scene()) {
QList<QGraphicsView*> views = scene()->views();
if (views.count() > 0) {
QPixmap* pix = static_cast<QPixmap*>(views[0]->windowSurface()->paintDevice());
@ -892,18 +892,18 @@ void Icon::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWid
// Compute the metrics, and lay out the text items
// ========================================================================
Private::IconState state = Private::NoState;
if (d->states & Private::ManualPressedState) {
state = Private::PressedState;
} else if (d->states & Private::PressedState) {
if (d->states & Private::HoverState) {
state = Private::PressedState;
IconPrivate::IconState state = IconPrivate::NoState;
if (d->states & IconPrivate::ManualPressedState) {
state = IconPrivate::PressedState;
} else if (d->states & IconPrivate::PressedState) {
if (d->states & IconPrivate::HoverState) {
state = IconPrivate::PressedState;
}
} else if (d->states & Private::HoverState) {
state = Private::HoverState;
} else if (d->states & IconPrivate::HoverState) {
state = IconPrivate::HoverState;
}
QPixmap icon = d->decoration(option, state != Private::NoState);
QPixmap icon = d->decoration(option, state != IconPrivate::NoState);
const QPointF iconPos = d->iconPosition(option, icon);
d->drawBackground(painter, state);
@ -933,9 +933,9 @@ void Icon::drawActionButtonBase(QPainter* painter, const QSize &size, int elemen
QRadialGradient gradient(radius, radius, radius, radius, radius);
int alpha;
if (element == Private::MinibuttonPressed) {
if (element == IconPrivate::MinibuttonPressed) {
alpha = 255;
} else if (element == Private::MinibuttonHover) {
} else if (element == IconPrivate::MinibuttonHover) {
alpha = 200;
} else {
alpha = 160;
@ -1004,7 +1004,7 @@ QSizeF Icon::iconSize() const
bool Icon::isDown()
{
return d->states & Private::PressedState;
return d->states & IconPrivate::PressedState;
}
void Icon::mousePressEvent(QGraphicsSceneMouseEvent *event)
@ -1014,7 +1014,7 @@ void Icon::mousePressEvent(QGraphicsSceneMouseEvent *event)
return;
}
d->states |= Private::PressedState;
d->states |= IconPrivate::PressedState;
d->clickStartPos = scenePos();
bool handled = false;
@ -1034,19 +1034,19 @@ void Icon::mousePressEvent(QGraphicsSceneMouseEvent *event)
void Icon::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
{
if (~d->states & Private::PressedState) {
if (~d->states & IconPrivate::PressedState) {
QGraphicsWidget::mouseMoveEvent(event);
return;
}
if (boundingRect().contains(event->pos())) {
if (~d->states & Private::HoverState) {
d->states |= Private::HoverState;
if (~d->states & IconPrivate::HoverState) {
d->states |= IconPrivate::HoverState;
update();
}
} else {
if (d->states & Private::HoverState) {
d->states &= ~Private::HoverState;
if (d->states & IconPrivate::HoverState) {
d->states &= ~IconPrivate::HoverState;
update();
}
}
@ -1054,12 +1054,12 @@ void Icon::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
void Icon::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
{
if (~d->states & Private::PressedState) {
if (~d->states & IconPrivate::PressedState) {
QGraphicsWidget::mouseMoveEvent(event);
return;
}
d->states &= ~Private::PressedState;
d->states &= ~IconPrivate::PressedState;
//don't pass click when the mouse was moved
bool handled = d->clickStartPos != scenePos();
@ -1113,7 +1113,7 @@ void Icon::hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
action->hide();
action->event(event->type(), event->pos());
}
// d->states &= ~Private::HoverState; // Will be set once progress is zero again ...
// d->states &= ~IconPrivate::HoverState; // Will be set once progress is zero again ...
hoverEffect(false);
update();
@ -1123,11 +1123,11 @@ void Icon::hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
void Icon::setPressed(bool pressed)
{
if (pressed) {
d->states |= Private::ManualPressedState;
d->states |= Private::PressedState;
d->states |= IconPrivate::ManualPressedState;
d->states |= IconPrivate::PressedState;
} else {
d->states &= ~Private::ManualPressedState;
d->states &= ~Private::PressedState;
d->states &= ~IconPrivate::ManualPressedState;
d->states &= ~IconPrivate::PressedState;
}
update();
}
@ -1137,7 +1137,7 @@ void Icon::setUnpressed()
setPressed(false);
}
void Icon::Private::syncToAction()
void IconPrivate::syncToAction()
{
if (!action) {
return;
@ -1172,8 +1172,8 @@ QSizeF Icon::sizeFromIconSize(const qreal iconWidth) const
{
if (d->text.isEmpty() && d->infoText.isEmpty()) {
//no text, less calculations
return d->addMargin(d->addMargin(QSizeF(iconWidth, iconWidth), Private::IconMargin),
Private::ItemMargin);
return d->addMargin(d->addMargin(QSizeF(iconWidth, iconWidth), IconPrivate::IconMargin),
IconPrivate::ItemMargin);
}
QFontMetricsF fm = Plasma::Theme::defaultTheme()->fontMetrics();
@ -1184,20 +1184,20 @@ QSizeF Icon::sizeFromIconSize(const qreal iconWidth) const
width = qMax(fm.width(d->text.left(12)),
fm.width(d->infoText.left(12))) +
fm.width("xx") +
d->horizontalMargin[Private::TextMargin].left +
d->horizontalMargin[Private::TextMargin].right;
d->horizontalMargin[IconPrivate::TextMargin].left +
d->horizontalMargin[IconPrivate::TextMargin].right;
width = qMax(width,
iconWidth +
d->horizontalMargin[Private::IconMargin].left +
d->horizontalMargin[Private::IconMargin].right);
d->horizontalMargin[IconPrivate::IconMargin].left +
d->horizontalMargin[IconPrivate::IconMargin].right);
} else {
width = iconWidth +
d->horizontalMargin[Private::IconMargin].left +
d->horizontalMargin[Private::IconMargin].right +
d->horizontalMargin[IconPrivate::IconMargin].left +
d->horizontalMargin[IconPrivate::IconMargin].right +
qMax(fm.width(d->text), fm.width(d->infoText)) + fm.width("xx") +
d->horizontalMargin[Private::TextMargin].left +
d->horizontalMargin[Private::TextMargin].right;
d->horizontalMargin[IconPrivate::TextMargin].left +
d->horizontalMargin[IconPrivate::TextMargin].right;
}
qreal height;
@ -1210,21 +1210,21 @@ QSizeF Icon::sizeFromIconSize(const qreal iconWidth) const
if (d->orientation == Qt::Vertical) {
height = iconWidth + textHeight +
d->verticalMargin[Private::TextMargin].top +
d->verticalMargin[Private::TextMargin].bottom +
d->verticalMargin[Private::IconMargin].top +
d->verticalMargin[Private::IconMargin].bottom;
d->verticalMargin[IconPrivate::TextMargin].top +
d->verticalMargin[IconPrivate::TextMargin].bottom +
d->verticalMargin[IconPrivate::IconMargin].top +
d->verticalMargin[IconPrivate::IconMargin].bottom;
} else {
//Horizontal
height = qMax(iconWidth +
d->verticalMargin[Private::IconMargin].top +
d->verticalMargin[Private::IconMargin].bottom,
d->verticalMargin[IconPrivate::IconMargin].top +
d->verticalMargin[IconPrivate::IconMargin].bottom,
textHeight +
d->verticalMargin[Private::TextMargin].top +
d->verticalMargin[Private::TextMargin].bottom);
d->verticalMargin[IconPrivate::TextMargin].top +
d->verticalMargin[IconPrivate::TextMargin].bottom);
}
return d->addMargin(QSizeF(width, height), Private::ItemMargin);
return d->addMargin(QSizeF(width, height), IconPrivate::ItemMargin);
}
} // namespace Plasma

View File

@ -46,6 +46,8 @@ class QAction;
namespace Plasma
{
class IconPrivate;
class PLASMA_EXPORT Icon : public QGraphicsWidget
{
Q_OBJECT
@ -265,8 +267,6 @@ protected:
void hoverLeaveEvent(QGraphicsSceneHoverEvent *event);
public:
class Private;
/**
* @internal
**/
@ -278,8 +278,9 @@ private:
void layoutIcons(const QStyleOptionGraphicsItem *option);
void hoverEffect(bool);
Private * const d;
IconPrivate * const d;
friend class IconPrivate;
private Q_SLOTS:
void actionDestroyed(QObject* obj);
void readColors();

View File

@ -88,7 +88,7 @@ struct Margin
qreal left, right, top, bottom;
};
class Icon::Private
class IconPrivate
{
public:
enum MarginType { ItemMargin = 0, TextMargin, IconMargin, NMargins };
@ -103,8 +103,8 @@ public:
Q_DECLARE_FLAGS(IconStates, IconState)
public:
Private(Icon *i);
~Private();
IconPrivate(Icon *i);
~IconPrivate();
void drawBackground(QPainter *painter, IconState state);
void drawText(QPainter *painter);
@ -200,10 +200,10 @@ public:
static const int iconActionMargin = 4;
};
Q_DECLARE_OPERATORS_FOR_FLAGS(Icon::Private::IconStates)
Q_DECLARE_OPERATORS_FOR_FLAGS(IconPrivate::IconStates)
// Inline methods
void Icon::Private::setLayoutOptions(QTextLayout &layout, const QStyleOptionGraphicsItem *option) const
void IconPrivate::setLayoutOptions(QTextLayout &layout, const QStyleOptionGraphicsItem *option) const
{
QTextOption textoption;
textoption.setTextDirection(option->direction);
@ -214,7 +214,7 @@ void Icon::Private::setLayoutOptions(QTextLayout &layout, const QStyleOptionGrap
layout.setTextOption(textoption);
}
Qt::LayoutDirection Icon::Private::iconDirection(const QStyleOptionGraphicsItem *option) const
Qt::LayoutDirection IconPrivate::iconDirection(const QStyleOptionGraphicsItem *option) const
{
Qt::LayoutDirection direction;
@ -231,13 +231,13 @@ Qt::LayoutDirection Icon::Private::iconDirection(const QStyleOptionGraphicsItem
return direction;
}
void Icon::Private::setActiveMargins()
void IconPrivate::setActiveMargins()
{
activeMargins = (orientation == Qt::Horizontal ?
horizontalMargin : verticalMargin);
}
void Icon::Private::setVerticalMargin(MarginType type, qreal left, qreal top, qreal right, qreal bottom)
void IconPrivate::setVerticalMargin(MarginType type, qreal left, qreal top, qreal right, qreal bottom)
{
verticalMargin[type].left = left;
verticalMargin[type].right = right;
@ -245,7 +245,7 @@ void Icon::Private::setVerticalMargin(MarginType type, qreal left, qreal top, qr
verticalMargin[type].bottom = bottom;
}
void Icon::Private::setHorizontalMargin(MarginType type, qreal left, qreal top, qreal right, qreal bottom)
void IconPrivate::setHorizontalMargin(MarginType type, qreal left, qreal top, qreal right, qreal bottom)
{
horizontalMargin[type].left = left;
horizontalMargin[type].right = right;
@ -253,41 +253,41 @@ void Icon::Private::setHorizontalMargin(MarginType type, qreal left, qreal top,
horizontalMargin[type].bottom = bottom;
}
void Icon::Private::setVerticalMargin(MarginType type, qreal horizontal, qreal vertical)
void IconPrivate::setVerticalMargin(MarginType type, qreal horizontal, qreal vertical)
{
setVerticalMargin(type, horizontal, vertical, horizontal, vertical);
}
void Icon::Private::setHorizontalMargin(MarginType type, qreal horizontal, qreal vertical)
void IconPrivate::setHorizontalMargin(MarginType type, qreal horizontal, qreal vertical)
{
setHorizontalMargin(type, horizontal, vertical, horizontal, vertical);
}
QRectF Icon::Private::addMargin(const QRectF &rect, MarginType type) const
QRectF IconPrivate::addMargin(const QRectF &rect, MarginType type) const
{
const Margin &m = activeMargins[type];
return rect.adjusted(-m.left, -m.top, m.right, m.bottom);
}
QRectF Icon::Private::subtractMargin(const QRectF &rect, MarginType type) const
QRectF IconPrivate::subtractMargin(const QRectF &rect, MarginType type) const
{
const Margin &m = activeMargins[type];
return rect.adjusted(m.left, m.top, -m.right, -m.bottom);
}
QSizeF Icon::Private::addMargin(const QSizeF &size, MarginType type) const
QSizeF IconPrivate::addMargin(const QSizeF &size, MarginType type) const
{
const Margin &m = activeMargins[type];
return QSizeF(size.width() + m.left + m.right, size.height() + m.top + m.bottom);
}
QSizeF Icon::Private::subtractMargin(const QSizeF &size, MarginType type) const
QSizeF IconPrivate::subtractMargin(const QSizeF &size, MarginType type) const
{
const Margin &m = activeMargins[type];
return QSizeF(size.width() - m.left - m.right, size.height() - m.top - m.bottom);
}
QRectF Icon::Private::actionRect(ActionPosition position) const
QRectF IconPrivate::actionRect(ActionPosition position) const
{
switch (position) {
case TopLeft:

View File

@ -31,16 +31,16 @@
namespace Plasma
{
class Label::Private
class LabelPrivate
{
public:
Private(Label *label)
LabelPrivate(Label *label)
: q(label),
svg(0)
{
}
~Private()
~LabelPrivate()
{
delete svg;
}
@ -83,7 +83,7 @@ public:
Label::Label(QGraphicsWidget *parent)
: QGraphicsProxyWidget(parent),
d(new Private(this))
d(new LabelPrivate(this))
{
QLabel* native = new QLabel;

View File

@ -31,6 +31,8 @@ class QLabel;
namespace Plasma
{
class LabelPrivate;
class PLASMA_EXPORT Label : public QGraphicsProxyWidget
{
Q_OBJECT
@ -95,8 +97,7 @@ protected:
private:
Q_PRIVATE_SLOT(d, void setPalette())
class Private;
Private * const d;
LabelPrivate * const d;
};
} // namespace Plasma

View File

@ -30,21 +30,21 @@
namespace Plasma
{
class LineEdit::Private
class LineEditPrivate
{
public:
Private()
LineEditPrivate()
{
}
~Private()
~LineEditPrivate()
{
}
};
LineEdit::LineEdit(QGraphicsWidget *parent)
: QGraphicsProxyWidget(parent),
d(new Private)
d(new LineEditPrivate)
{
KLineEdit* native = new KLineEdit;
connect(native, SIGNAL(editingFinished()), this, SIGNAL(editingFinished()));

View File

@ -30,6 +30,8 @@ class KLineEdit;
namespace Plasma
{
class LineEditPrivate;
class PLASMA_EXPORT LineEdit : public QGraphicsProxyWidget
{
Q_OBJECT
@ -78,8 +80,7 @@ Q_SIGNALS:
void textEdited(const QString & text);
private:
class Private;
Private * const d;
LineEditPrivate * const d;
};
} // namespace Plasma

View File

@ -24,14 +24,14 @@
namespace Plasma {
class Meter::Private
class MeterPrivate
{
public:
Private(Meter* m) :
MeterPrivate(Meter* m) :
minimum(0),
maximum(100),
value(0),
meterType(AnalogMeter),
meterType(Meter::AnalogMeter),
image(0),
minrotate(0),
maxrotate(360),
@ -99,13 +99,13 @@ public:
void setSizePolicyAndPreferredSize()
{
switch (meterType) {
case BarMeterHorizontal:
case Meter::BarMeterHorizontal:
meter->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
break;
case BarMeterVertical:
case Meter::BarMeterVertical:
meter->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding);
break;
case AnalogMeter:
case Meter::AnalogMeter:
default:
meter->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
break;
@ -125,7 +125,7 @@ public:
QList<QColor> colors;
QList<QFont> fonts;
QString svg;
MeterType meterType;
Meter::MeterType meterType;
Plasma::Svg *image;
int minrotate;
int maxrotate;
@ -134,7 +134,7 @@ public:
Meter::Meter(QGraphicsItem *parent) :
QGraphicsWidget(parent),
d(new Private(this))
d(new MeterPrivate(this))
{
d->setSizePolicyAndPreferredSize();
}

View File

@ -27,6 +27,8 @@
namespace Plasma
{
class MeterPrivate;
/**
* This class provides generic meter widget for the Plasma desktop.
*
@ -198,8 +200,7 @@ protected:
QWidget *widget = 0);
private:
class Private;
Private *const d;
MeterPrivate *const d;
};
} // End of namepace

View File

@ -31,15 +31,15 @@
namespace Plasma
{
class PushButton::Private
class PushButtonPrivate
{
public:
Private()
PushButtonPrivate()
: svg(0)
{
}
~Private()
~PushButtonPrivate()
{
delete svg;
}
@ -71,7 +71,7 @@ public:
PushButton::PushButton(QGraphicsWidget *parent)
: QGraphicsProxyWidget(parent),
d(new Private)
d(new PushButtonPrivate)
{
KPushButton* native = new KPushButton;
connect(native, SIGNAL(clicked()), this, SIGNAL(clicked()));

View File

@ -30,6 +30,8 @@ class KPushButton;
namespace Plasma
{
class PushButtonPrivate;
class PLASMA_EXPORT PushButton : public QGraphicsProxyWidget
{
Q_OBJECT
@ -92,8 +94,7 @@ protected:
void resizeEvent(QGraphicsSceneResizeEvent *event);
private:
class Private;
Private * const d;
PushButtonPrivate * const d;
};
} // namespace Plasma

View File

@ -31,15 +31,15 @@
namespace Plasma
{
class RadioButton::Private
class RadioButtonPrivate
{
public:
Private()
RadioButtonPrivate()
: svg(0)
{
}
~Private()
~RadioButtonPrivate()
{
delete svg;
}
@ -71,7 +71,7 @@ public:
RadioButton::RadioButton(QGraphicsWidget *parent)
: QGraphicsProxyWidget(parent),
d(new Private)
d(new RadioButtonPrivate)
{
QRadioButton* native = new QRadioButton;
connect(native, SIGNAL(toggled(bool)), this, SIGNAL(toggled(bool)));

View File

@ -30,6 +30,8 @@ class QRadioButton;
namespace Plasma
{
class RadioButtonPrivate;
class PLASMA_EXPORT RadioButton : public QGraphicsProxyWidget
{
Q_OBJECT
@ -105,8 +107,7 @@ protected:
void resizeEvent(QGraphicsSceneResizeEvent *event);
private:
class Private;
Private * const d;
RadioButtonPrivate * const d;
};
} // namespace Plasma

View File

@ -43,13 +43,13 @@
namespace Plasma
{
class SignalPlotter::Private
class SignalPlotterPrivate
{
public:
Private()
SignalPlotterPrivate()
: svgBackground(0)
{ }
~Private() { }
~SignalPlotterPrivate() { }
int precision;
uint samples;
@ -97,7 +97,7 @@ class SignalPlotter::Private
SignalPlotter::SignalPlotter(QGraphicsItem *parent)
: QGraphicsWidget(parent),
d(new Private)
d(new SignalPlotterPrivate)
{
d->precision = 0;
d->bezierCurveOffset = 0;

View File

@ -29,6 +29,8 @@
namespace Plasma
{
class SignalPlotterPrivate;
struct PlotColor
{
QColor color;
@ -432,8 +434,7 @@ protected:
void drawHorizontalLines(QPainter *p, int top, int w, int h);
private:
class Private;
Private *const d;
SignalPlotterPrivate *const d;
};
} // Plasma namespace

View File

@ -30,15 +30,15 @@
namespace Plasma
{
class <Name>::Private
class <Name>Private
{
public:
Private()
<Name>Private()
: svg(0)
{
}
~Private()
~<Name>Private()
{
delete svg;
}
@ -72,7 +72,7 @@ public:
<Name>::<Name>(QGraphicsWidget *parent)
: QGraphicsProxyWidget(parent),
d(new Private)
d(new <Name>Private)
{
<Native>* native = new <Native>;
//TODO: forward signals

View File

@ -30,6 +30,8 @@ class <Native>;
namespace Plasma
{
class <Name>Private;
class PLASMA_EXPORT <Name> : public QGraphicsProxyWidget
{
Q_OBJECT
@ -91,8 +93,7 @@ protected:
void resizeEvent(QGraphicsSceneResizeEvent *event);
private:
class Private;
Private * const d;
<Name>Private * const d;
};
} // namespace Plasma

View File

@ -30,21 +30,21 @@
namespace Plasma
{
class TextEdit::Private
class TextEditPrivate
{
public:
Private()
TextEditPrivate()
{
}
~Private()
~TextEditPrivate()
{
}
};
TextEdit::TextEdit(QGraphicsWidget *parent)
: QGraphicsProxyWidget(parent),
d(new Private)
d(new TextEditPrivate)
{
KTextEdit* native = new KTextEdit;
connect(native, SIGNAL(textChanged()), this, SIGNAL(textChanged()));

View File

@ -31,6 +31,8 @@ class KTextEdit;
namespace Plasma
{
class TextEditPrivate;
class PLASMA_EXPORT TextEdit : public QGraphicsProxyWidget
{
Q_OBJECT
@ -83,8 +85,7 @@ protected:
void resizeEvent(QGraphicsSceneResizeEvent *event);
private:
class Private;
Private * const d;
TextEditPrivate * const d;
};
} // namespace Plasma

Some files were not shown because too many files have changed in this diff Show More