<div class="gmail_quote">On Wed, Jul 28, 2010 at 5:14 AM, Aaron J. Seigo <span dir="ltr">&lt;<a href="mailto:aseigo@kde.org">aseigo@kde.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">On July 27, 2010, Aleix Pol wrote:<br>
</div><div class="im">&gt; I&#39;ve been looking into it and it&#39;s fine to use DataEngines. I have the<br>
&gt; exact same problem though. I can create a kdevelop DataEngine with a<br>
&gt; project DataContainer, but this is still created in the PluginLoader and I<br>
&gt; can&#39;t have a reference to the Project.<br>
<br>
</div>here&#39;s an example of how you could create an engine that knows when the<br>
project changes:<br>
<br>
QWeakPointer&lt;MyDataEngine *&gt; m_engine;<br>
<br>
DataEngine *MyPluginLoader::loadDataEngine(const QString &amp;name)<br>
{<br>
        if (name == &quot;org.kde.kdevelop.project&quot;) {<br>
                m_engine = new MyDataEngine;<br>
                connect(m_projectManager, SIGNAL(projectChanged(QString)),<br>
                               m_engine.data(),<br>
SLOT(projectChanged(QString)));<br>
                return m_engine.data();<br>
       }<br>
<br>
     return 0;<br>
}<br>
<br>
remember that DataEngineManager will delete the engine when it is no longer<br>
used, so be sure to use a QWeakPointer.<br>
<br>
similar approaches to the above should give you all the flexibility needed.<br>
<font color="#888888"><br>
--<br>
</font><div><div></div><div class="h5">Aaron J. Seigo<br>
humru othro a kohnu se<br>
GPG Fingerprint: 8B8B 2209 0C6F 7C47 B1EA  EE75 D6B7 2EB1 A7F1 DB43<br>
<br>
KDE core developer sponsored by Qt Development Frameworks<br>
</div></div><br>_______________________________________________<br>
Plasma-devel mailing list<br>
<a href="mailto:Plasma-devel@kde.org">Plasma-devel@kde.org</a><br>
<a href="https://mail.kde.org/mailman/listinfo/plasma-devel" target="_blank">https://mail.kde.org/mailman/listinfo/plasma-devel</a><br>
<br></blockquote></div><br><div>The problem is not that the project change, it&#39;s that there are many projects open at the same time and I need to be able to tell which one the plasmoid is targeting.</div><div><br></div>
<div>I thought I could use that data engine approach but looks like that all projects would have to share the same DataEngine instance so I still need to tell them separately what project do they have to target somehow.</div>
<div><br></div><div>Aleix</div>