Review Request: Save/Restore the ProjectTreeView.

Andreas Pakulat apaku at gmx.de
Thu Jan 5 20:25:55 UTC 2012



> On Jan. 5, 2012, 11:51 a.m., Andreas Pakulat wrote:
> > Current master requires KDE 4.6 already I believe (if not it should due to the huge amount of fixes related to kate).
> > 
> > I didn't look at the patch itself yet, but how does your code handle the case of two project views being restored? As far as I recall there's no API for plugins/views to find out which kconfig group to use to restore view-state from since this is completely hidden in sublime/shell code.
> > 
> > Apart from that IMHO storing this in the project configuration is wrong. The view state has nothing to do with the project itself, its about view-state and view-state should go into the session configuration file. The project-configuration file is for project-specific data, which expansion state is not, since I can load the same project into two different sessions and would not want one session to overwrite the view-state of another session for that project.
> 
> Andrew Fuller wrote:
>     CMakeLists still has set(KDE_MIN_VERSION "4.5.0")  I can bump that if you like, but that doesn't belong in this patch considering the remove of the #if/#else (below).
>     
>     Re: multiple project views.  Until now I was not aware that this was even possible.  I will address that in my updated patch (which will be hopefully tomorrow).

I'd say it should be bumped, but I'm not active anymore so I'll leave that to the active group of devs.

As I said, I don't think you'll be able to adress multiple project views currently since a view-object does not know which config group to read the state from. This has been a long-time todo for the sublime/shell API but didn't get done yet (again afaik, I'm a bit out of touch these days).

Anyway, if Milian is ok with that it might still be useful enough to warrant this minor issue, after all there are not going to be many people with more than 1 projects view. There's IIRC also a plan to have some views as 'singleton', i.e. only a single instance of the view is ever created and the project tree is a prime candidate for that IMHO.


- Andreas


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/103619/#review9567
-----------------------------------------------------------


On Jan. 3, 2012, 6:29 a.m., Andrew Fuller wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/103619/
> -----------------------------------------------------------
> 
> (Updated Jan. 3, 2012, 6:29 a.m.)
> 
> 
> Review request for KDevelop.
> 
> 
> Description
> -------
> 
> Save/Restore the ProjectTreeView.  This enables a more seamless transition when returning to a project that was closed.
> 
> I'm using KViewStateSaver to do the actual save/restore which unfortunately has an interface change between KDE 4.5 and 4.6, so there's a small #if #else (twice) in the code.  This can be removed when KDE 4.5 is no longer supported.
> 
> I was directed in #kdevelop to store this in the project config files (as done in this patch).  There are two implications of storing it there since the tree view combines all the projects together.  The first is that when multiple projects are open, then the stored values may contain data for other projects (in practice this is irrelevant, it just feels impure).  The other is that because it gets restored piecemeal that the scrollbar is incorrect.  This is also irrelevant.  Just imperfect.
> 
> This would also work very well stored in the session config.  To do this I would only need to add a signal for when the session is about to be closed.  Currently the QuitSession signal triggers all the cleanup and I would need to guarantee that the settings are saved before the model is emptied.
> 
> Finally, I did a best-guess to follow the coding style within kdevplatform, but some files were conflicting and http://www.kdevelop.org/mediawiki/index.php/Coding_Guidelines (from Architecture.dox) is MIA.  So please point out any style errors as well.
> 
> 
> Diffs
> -----
> 
>   plugins/projectmanagerview/projecttreeview.h 16893f0713b83a78a5b025a55fcfa082265d4419 
>   plugins/projectmanagerview/projecttreeview.cpp 8237af513627c0459d571de2bccc275e8a4b0ae9 
>   project/CMakeLists.txt bac4b22b8a9966f4efe4080a6d24e0de17c48e12 
>   project/projectmodelsaver.h PRE-CREATION 
>   project/projectmodelsaver.cpp PRE-CREATION 
> 
> Diff: http://git.reviewboard.kde.org/r/103619/diff/diff
> 
> 
> Testing
> -------
> 
> Load a session, Exit, and return.  Voilà!  The tree is right where you left it.
> 
> 
> Thanks,
> 
> Andrew Fuller
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20120105/7b424da9/attachment.html>


More information about the KDevelop-devel mailing list