[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-panel-devel
Subject:    Re: integrating plasma into kdevelop's dashboard
From:       Aleix Pol <aleixpol () kde ! org>
Date:       2010-07-28 12:44:00
Message-ID: AANLkTinhn5Hy2imZD-Dm-P-ZdHOcJ03e0iAicQBt4RbE () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


On Wed, Jul 28, 2010 at 5:14 AM, Aaron J. Seigo <aseigo@kde.org> wrote:

> 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
>
> _______________________________________________
> Plasma-devel mailing list
> Plasma-devel@kde.org
> https://mail.kde.org/mailman/listinfo/plasma-devel
>
>
The problem is not that the project change, it'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.

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.

Aleix

[Attachment #5 (text/html)]

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



_______________________________________________
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic