integrating plasma into kdevelop's dashboard

Aaron J. Seigo aseigo at kde.org
Wed Jul 28 05:14:29 CEST 2010


On July 27, 2010, Aleix Pol wrote:
> I've been looking into it and it's fine to use DataEngines. I have the
> exact same problem though. I can create a kdevelop DataEngine with a
> project DataContainer, but this is still created in the PluginLoader and I
> can't have a reference to the Project.

here's an example of how you could create an engine that knows when the 
project changes:

QWeakPointer<MyDataEngine *> m_engine;

DataEngine *MyPluginLoader::loadDataEngine(const QString &name)
{
	if (name == "org.kde.kdevelop.project") {
                m_engine = new MyDataEngine;
                connect(m_projectManager, SIGNAL(projectChanged(QString)),
                               m_engine.data(), 
SLOT(projectChanged(QString)));
                return m_engine.data();
       }

     return 0;
}
            
remember that DataEngineManager will delete the engine when it is no longer 
used, so be sure to use a QWeakPointer.

similar approaches to the above should give you all the flexibility needed.

-- 
Aaron J. Seigo
humru othro a kohnu se
GPG Fingerprint: 8B8B 2209 0C6F 7C47 B1EA  EE75 D6B7 2EB1 A7F1 DB43

KDE core developer sponsored by Qt Development Frameworks
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
Url : http://mail.kde.org/pipermail/plasma-devel/attachments/20100727/93850caa/attachment.sig 


More information about the Plasma-devel mailing list