Add missing d-pointers

svn path=/trunk/KDE/kdebase/workspace/plasma/lib/; revision=668014
This commit is contained in:
Matt Williams 2007-05-24 19:36:05 +00:00
parent 022f7f671b
commit 5d1eb7f460
4 changed files with 29 additions and 8 deletions

View File

@ -25,22 +25,33 @@
namespace Plasma
{
class DataEngineManager::Private
{
public:
Private()
{}
Plasma::DataEngine::Dict m_engines;
};
DataEngineManager::DataEngineManager()
: d(new Private())
{
}
DataEngineManager::~DataEngineManager()
{
foreach (Plasma::DataEngine* engine, m_engines) {
foreach (Plasma::DataEngine* engine, d->m_engines) {
delete engine;
}
m_engines.clear();
d->m_engines.clear();
}
Plasma::DataEngine* DataEngineManager::dataEngine(const QString& name) const
{
Plasma::DataEngine::Dict::const_iterator it = m_engines.find(name);
if (it != m_engines.end()) {
Plasma::DataEngine::Dict::const_iterator it = d->m_engines.find(name);
if (it != d->m_engines.end()) {
// ref and return the engine
//Plasma::DataEngine *engine = *it;
return *it;
@ -78,7 +89,7 @@ Plasma::DataEngine* DataEngineManager::loadDataEngine(const QString& name)
engine->ref();
engine->setObjectName(offers.first()->name());
engine->setIcon(offers.first()->icon());
m_engines[name] = engine;
d->m_engines[name] = engine;
return engine;
}
@ -90,7 +101,7 @@ void DataEngineManager::unloadDataEngine(const QString& name)
engine->deref();
if (!engine->isUsed()) {
m_engines.remove(name);
d->m_engines.remove(name);
delete engine;
}
}

View File

@ -41,7 +41,8 @@ class PLASMA_EXPORT DataEngineManager
QStringList knownEngines() const;
private:
Plasma::DataEngine::Dict m_engines;
class Private;
Private* const d;
};
} // namespace Plasma

View File

@ -23,8 +23,13 @@
namespace Plasma
{
class LineEdit::Private
{
};
LineEdit::LineEdit(QGraphicsItem *parent, QGraphicsScene *scene)
: QGraphicsTextItem(parent, scene)
: QGraphicsTextItem(parent, scene),
d(new Private())
{
setTextInteractionFlags(Qt::TextEditorInteraction);
}

View File

@ -43,6 +43,10 @@ class KDE_EXPORT LineEdit : public QGraphicsTextItem
public Q_SLOTS:
void updated(const QString&, const Plasma::DataEngine::Data&);
private:
class Private;
Private* const d;
};
} // namespace Plasma