Closed CodedOre closed 1 year ago
@IBBoard, if you have the time, I would appreciate some feedback on this concept. Before I attempt to continue this branch (or as I know myself rewrite it) I would like to have some feedback on the idea of the extendable collection. At the end, the discussion about ExpandableCollection
initiated the work on this idea.
Literally looking at it now π I've been busy with other things, and then trying to fix up my window sizing branch before I looked at this π
The only thing that I don't quite get is why not make
PullableCollection
extendCollection
and makePaginatedCollection
extendPullableCollection
? Is it a Vala-ism to have more multiple inheritance rather than a longer inheritance chain?
I have orientated that after how Gtk does it inheritance, as I wanted to avoid a long chain of inheritances.
Also, I don't think its possible to inherit an interface of an abstract class.
So, I have reworked the branch a bit.
I have now decided to implement the compare method as an abstract one in the Collection
class. As a result, there is a new ReversePostList
class which implements the sorting for the timelines. This isn't quite es modular as I originally wanted, but I haven't been able to make the delegate method to be working properly.
Also, the segfault while sorting is still present...\
And even if you cut out the sorting, CollectionView
fails to show anything, as it fails to identify the items as GObjects
...\
My guess is that it has to do with generics, have to look into that more.
Other than that, what I would want to add as well is:
CollectionView
.ClientLists
to be sub-classes of Collection
, would make sense for me.Also, the segfault while sorting is still present...
Apparently this is caused by the timelines adding headers. Well, the idea is anyway to change this, so I removed that for now.
And even if you cut out the sorting, CollectionView fails to show anything, as it fails to identify the items as GObjects... My guess is that it has to do with generics, have to look into that more.
And my guess was wrong. I just missed a few brackets when calling a method... So, it does work (for now).
Alright, it's later than I planned, but now the backend should be complete. Might be some room for improvements though.
The frontend, especially CollectionView
, was only modified so it works, so it probably could be improved for the new structure of Collection
.
Since the threads are now sorted as well, I think we can merge this now.
In #74, @IBBoard wanted to extend
Collection
by sub-classing it soHomeTimeline
andUserTimeline
can have a method to pull for older posts, without having to adding the method toThread
, as it would be pointless there. When I looked into implementing notifications today, I found that it could technically be managed byCollection
as well, instead of getting it's own managment. So, in the last few hours, I have developed this concept on how we could changeCollection
to be more flexible.Here is the basic overview:
Collection
itself is only aListModel
, which enforces sorting. Sorting is done by calling the abstractsorter
property, which allows classes which are based onCollection
to choose a implementation ofCollectionSorter
which suits them. Methods to pull items are added by extending Interfaces, so thatThread
can have one basic pulling method, while the timelines can implement pulling older ones as well.So, the basic idea is to have a basic
Collection
, which is extendable, so it can be used with various cases.However, there are still some issues and ToDo's:
ReversePostSorter
is comparing items.direct_parent
of the oldCollection
. Or another solution to keep threads together while sorting posts.Collection
Most importantly though: Since this was just an idea I quickly coded together in the last few hours, I would like to have a bit of feedback, especially from @IBBoard, if this is a good idea and how this could be improved.