Sorry it was late and I was a little out of it. <br><br>Basically, in my data Engine - which is written in Python, if I add in that block, then when my plasmoid runs it will cause the data Engine to get that data. When I'm back home I'll have to match up this email and your previous email with my code to see what I'm doing. (Because I think I already have the dataSource.connectSource(bla))<br>
<br>Actually, if I can look into what I sent the mailing list recently....<br><br>here's the engine part of what I have right now in the QML part of my code:<br><br> PlasmaCore.DataSource {<br><br> id: viewsSource<br>
<br> engine: "flickrviewsengine"<br><br> interval: 0<br><br> Component.onCompleted: connectedSources = sources<br><br> onSourceAdded: connectSource(source)<br><br> }<br><br><br>
So is that not enough to connect to the source? <br><br>To try and clarify things as much as possible - because I was posting as I was debugging things in a mad fit of inspiration at 0200 local time - let me try and sum up here.<br>
<br>If you remove the python code that's in this email chain from the data engine code, but leave everything else about my QML the same, then my plasmoid connects to the dataEngine, but there's no data inside. I know it's connected because viewsSource.valid gives true. <br>
<br>Now, I add that python code, uninstall and reinstall the engine. When I run my plasmoid THIS time, I can see all the debug statements that I've put into my engine code. I see the engine is working and then I get data out. I know this because I did a <br>
<br>text: viewsSource.data["1500"]["Group 1500"]<br><br>And I can see the contents of my data Engine. <br><br>So it works! yay! So why come to the mailing list? Because I want to make sure I'm doing this correctly since adding in all my sources would cause this plasmoid to take forever to load. It takes 15 minutes or more for all the data to be pulled off the internet and put into the engine for all the data sources. If it has to be that way, then it has to be that way. But I was hoping that by using a data engine I could have the data engine just grab the sources in parallel. Then, in the plasmoid, you could click on buttons for each of the sources - 25, 50, 1500, etc and whichever ones already have data in them would allow you to interact with them while the other ones downloaded.<br clear="all">
--<br>Eric Mesa<br><a href="http://www.ericsbinaryworld.com" target="_blank">http://www.ericsbinaryworld.com</a><br>
<br><br><div class="gmail_quote">On Tue, Jan 24, 2012 at 5:20 AM, Sebastian Kügler <span dir="ltr"><<a href="mailto:sebas@kde.org" target="_blank">sebas@kde.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>On Tuesday, January 24, 2012 09:46:21 Sebastian Kügler wrote:<br>
> On Tuesday, January 24, 2012 08:43:49 Eric Mesa wrote:<br>
> > Here's an interesting little tidbit that might make this all finally<br>
> > work<br>
> ><br>
> > correctly.<br>
> ><br>
> > If I add this in:<br>
> ><br>
> > def sources(self):<br>
> > sources = ["1500"]<br>
> > return sources<br>
<br>
</div>That looks a lot like Python syntax... :)<br>
<br>
sources() is just an accessor though, instead use setData(...) or<br>
addSource(...) if you want to put data into your engine.<br>
<div><br>
> > to my engine - then whenever it's connected to, it grabs the data into<br>
> > the engine. So it looks like the data was empty otherwise, even if I<br>
> > used plasmaengineexplorer to make sure data was in there first. The<br>
> > question is - is this the right thing to do? Or is there a way of<br>
> > telling it to grab the data as it's requested by my plasmoid? When I<br>
> > add i the rest of my sources it will take a while for the data to be<br>
> > available.<br>
><br>
> plasmaengineexplorer starts a different process, so what happens in there<br>
> doesn't happen in your plasmoid, they're entirely different things. You<br>
> have to populate the dataengine from your plasmoid, using<br>
> dataSource.connectSource(bla).<br>
<br>
</div>Also useful, in order to debug in your code:<br>
<br>
if (dataSource["mysource"]) { print(dataSource["mysource"]); }<br>
<br>
or if (typeof(dataSource["mySource"]) ...<br>
<br>
You can also check what you're connected to:<br>
<br>
or print(dataSource.connectedSources)<br>
<br>
In your DataSource:<br>
<br>
DataSource {<br>
id: ds<br>
[...]<br>
onNewData: {<br>
print(source, data);<br>
}<br>
}<br>
<br>
this should make it a bit easier to do basic print-level debugging.<br>
<br>
Cheers,<br>
<div>--<br>
sebas<br>
<br>
<a href="http://www.kde.org" target="_blank">http://www.kde.org</a> | <a href="http://vizZzion.org" target="_blank">http://vizZzion.org</a> | GPG Key ID: 9119 0EF9<br>
</div>_______________________________________________<br>
Plasma-devel mailing list<br>
<a href="mailto:Plasma-devel@kde.org" target="_blank">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>
</blockquote></div><br>