<div class="gmail_quote">2010/6/18 Sebastian Trüg <span dir="ltr"><<a href="mailto:trueg@kde.org">trueg@kde.org</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
- it allows to add custom facets like "recently modified" easily, I am</blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
not sure if Facet subclassing is required for that but it might be.<br></blockquote><div><br></div><div>Well, the idea is to subclass Facet for each new facet you want to add; for now they are three, but creating new ones should be easy.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">- it automatically updates when the base query or the selected facets<br>
change<br>
<br></blockquote><div><br></div><div>Of course...</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
I was thinking of a FacetModel based on QAbstractItemModel but that is<br>
just one idea. I am not even sure if that is a good one.<br></blockquote><div><br></div><div>I have to take a look at the code before answering here... :)</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
SemBrowser currently has Facet as a subclass of QWidget. I am not sure<br>
that is the most flexible approach. IMHO a decoupling of facets from<br>
representation is desirable.<br></blockquote><div><br></div><div>You're completely right here: I did it in this way, but I knew it was not the best way; I will decouple view and model, so creating a new facet means subclass Facet (the model part, adding its own queries) without having to bother about the view part (or just choose which kind of visualization you want for the new facet).</div>
<div><br></div><div>I don't know about using a FacetModel: currently I'm using a model for those facets with a list of items (or, better, terms), but for example time and type do not need a model; I think in the end the best structure is having Facet (and Term) classes, which represent the model part, some UI representing the view part, and a controller for them (which, in Sembrowser, would be the side panel itself, communicating with the file browser part, but it can be anything else). You know, MVC... :)</div>
<div><br></div></div>-- <br>Sivieri Alessandro<br><a href="mailto:alessandro.sivieri@gmail.com">alessandro.sivieri@gmail.com</a><br><a href="http://www.chimera-bellerofonte.eu/">http://www.chimera-bellerofonte.eu/</a><br>
<a href="http://www.poul.org/">http://www.poul.org/</a><br>