On Sunday 22 November 2015, Olivier Churlaud wrote:
> Le 22/11/2015 00:46, Aleix Pol a écrit :
> > On Sat, Nov 21, 2015 at 5:36 PM, Olivier Churlaud <oliv...@churlaud.com> 
wrote:
> >> Hi,
> >> 
> >> I'm porting Amarok to KF5. I'm basically done with the pure C++/Qt part.
> >> There is a folder that used to be powered by Plasma::Applet [1]. I have
> >> now to port this to plasma-framework. Could you redirect me to a
> >> project which use them so that it can inspire me? I have no idea of how
> >> to begin....
> > 
> > You can look at plasma-workspace/shell. Note that most Plasmoids are
> > written in QML nowadays, rather than C++.
> 
> I know that plasmoids are in QML and that's exactly my problem. I don't
> know how to build the context with the plasma-framework, and I've never
> seen a project which uses it (out of plasmoids, but it's not what I'm
> looking for).  I could try to do pure QML in the project, but it was
> designed with the old plasma-framework and I think it should stay like
> this.
Hi,
I think all depends what are your design goals.
If you want to maintain a similar thing, a view with applets that can be added 
and removed, I think using plasma-framework makes sense because it gives you 
the infrastructure to have such applets in self contained packages and a 
layout to save and restore from.
Regardless if you decide to use the whole plasma-framework, I think if you 
want to maintain the "addon, applet" nature of the things in the amarok 
context view, you should use the same approach for packages: they can also be 
used separately from plasma with the kpackage framework (managed install, 
update, remove and load from tarballs with your qml code inside, useful to 
interact with things like kdelook)

If you end up using plasma, I don't think a straight port of the current 
amarok context view is very feasible, because plasma is changed quite a lo 
(not beingbased on qgraphicsview anymore and all)
what i suggest you is to start to experiment by writing a standalone app as 
little as possible that loads/saves plasmoids, a minimal shell ( hmm, i should 
add one in the examples in p-w now that i think about) and then if you are 
able to make it work as your liking, you take those class you written and 
stick it as a view in amarok.
I suggest you to take a look at the file "standaloneappcorona.cpp" in plasma-
framework, is way simpler than "shellcorona.cpp" that is the use used in a 
normal desktop session: you won't have to worry about things like multi 
screen, panels or activities (what you need to implement is a Corona subclass, 
it's the central part for layout save and restore).

After that, In order to make the single applet talk with the Amarok internals, 
there are several methods possible, but all quite simple, so it's secondary at 
the moment i think :)

There are somethings i can think about for which probably plasma-framework is 
not quite ready, but if there is interest i can work to fix them,, like you 
may need some headers of a library which doesn't install headers yet 
(plasmaquick) and the filter on desktop entry keys "X-KDE-ParentApp" should be 
reimplemented, but it's all an easy fix.

Personally, I would like an application using plasma-framework, as it would 
mean the part of using it as a library would be debugged and ironed out (as 
the kf5  is not used that way so far)

Of course all of this wouldn't be necessary if the context view would become a 
more fixed thing with one single view and not extensible... again it all 
depends what the design goals are ;)

-- 
Marco Martin

>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<

Reply via email to