← Back to team overview

gtg-contributors team mailing list archive

Refactorisation finished !

 

Yes, I've finished my refactorisation.

Well, in fact, not really. What I mean is that I've finished to put in
place every stuffs I wanted to move. Now, we still have a lot of work to
do to fix bugs and regressions.


What we have now is lot more developer friendly View layer. The
requester is a lot more friendly to use. If you want to display only a
subset of tasks, you can either:

- have access to the main FilteredTree (the one displayed in the main
window) and apply filters on it (you can create you own)

- get your own personal FilteredTree and apply on it the filters you
want without interfering with the main view. (this is how the closed
tasks pane is built currently)


Also, and I want to stress that point, it's very important that from
now, every information comes from the bottom to the top. There should be
no horizontal communication at all between views.

TaskEditor and TaskBrowser should only be views like many others. The
views are handled by a new module called "viewmanager" which is
responsible for the GTK mainloop.

This is still not perfect. Don't hesitate to propose patch or to help
cleaning stuffs. If you are unsure, don't hesitate to ask.

>From now, I will try to answer every single question I receive about the
architecture to help you all to get your feet in this new codebase.


The main problem is with the plugin API that I barely touched. Like
everything in GTG (and I'm the most guilty about that here), it was done
reversely : instead of having hooks everywhere in the code to ask if a
plugin want to do something, we were doing stuffs reversly. For example,
our plugin API was directly adding/removing stuffs in the UI by playing
with the UI. Instead, the browser.py should ask the plugin API "Do you
want to put a button there ?".

This is something I barely touched and I'm don't have huge motivation
for that so any help from plugin writers is welcome.


Some statistics
***************

This refactorisation was, in fact, a logical step after Bertrand's huge
refactorisation before 0.2 release.

Before factorisation, we had 14287 loc (without comments) in 85 .py
files

After factorisation, we now have 14387 loc (without comments) in 91 .py
files.

It means that the whole work only added 100 loc, which is not so bad (I
wanted to be negative). Afaik, this is a good indicator when doing
refactorisation.

Some files were hugely cleaned :

browser.py : from 2001 loc to 1583 (including comments)
datastore.py : from 395 to 207
requester.py : from 368 to 231



Roadmap
*******

As soon as 0.2.2 is released, I believe that we should merge the
refactorisation (and freeze the daily-build PPA) with, of course, a big
warning to the community. This will allow faster testing and bug
solving.

As soon as this branch is merged, I will start working on multi-backends
support. I find that the preferences GUI is a real nice place that only
needs to be filled :-) (Kudo to Paul, I think it's his work)

Any help on building the GUI would be highly appreciated so I can
concentrate on the engine


Known regressions and stuffs that need to be done
*************************************************

Criticals:

- The tag treeview is broken. Bertrand is working on it.
https://bugs.edge.launchpad.net/gtg/+bug/529256
https://bugs.edge.launchpad.net/gtg/+bug/529271

- Plugins API is broken (and most plugins should be)
https://bugs.edge.launchpad.net/gtg/+bug/529520
After the plugin API is updated, a separate bug should be filled for
each broken plugin.
But, please, don't waste your time with the "backends" plugins. By the
time of 0.3, they will be useless and it might be more useful to make
request about what can be missing in the backend API to write you
backend (see localfile.py)

- Drag-n-drop is broken (in fact, the code is commented out and should
be adapted)
https://bugs.edge.launchpad.net/gtg/+bug/529273

- Expanded state is not restored anymore (and change at every start
depending on the thread loading your tasks).
https://bugs.edge.launchpad.net/gtg/+bug/529255

- Preferences window should be handled by the viewmanager, not the
taskbrowser
https://bugs.edge.launchpad.net/gtg/+bug/529528


I'm too lazy to report bug but I should:
- DBus is broken, due to the huge change to the requester.

- Inactive tags are not considered. We discussed to make inactive tags
hiding tasks not only in the workview but also in the mainview and
display those tasks only in tag specific views. I cannot find that
discussion anymore but I like the idea. 
I would also be straightforward to implement with the bankfilter.


- When a task has multiple parents, the refresh is done only for one of
those parents (which makes sense in the code.).  The good news is that,
beside this little bug, multi-parent works fine.



Thanks a lot for your help and early testing. I'm ready to be challenged
by your feedbacks and questions :-)


Lionel




Follow ups