[Okular-devel] Review Request: Unfolded toc remains unfolded on reload unless the file is changed

Albert Astals Cid tsdgeos at terra.es
Thu Jan 3 21:00:52 UTC 2013



> On Jan. 2, 2013, 9:46 p.m., Albert Astals Cid wrote:
> > part.cpp, line 1622
> > <http://git.reviewboard.kde.org/r/107994/diff/5/?file=103405#file103405line1622>
> >
> >     Do we really need this collapse here?
> 
> Jaydeep Solanki wrote:
>     yes I added that because suppose an "Open" tag attribute is there in the toc on a specific node, so okular will expand that node, but if the user had closed that node before reload then this will keep it closed after reload, otherwise along with m_oldTocExpandedIndexes, that node will also get expanded.
> 
> Albert Astals Cid wrote:
>     But have you tried that really works? Because the "Open" tag attribute will get executed after this code, so adding the collapse all won't do anything, no?
>     Which file you used to test that?
> 
> Jaydeep Solanki wrote:
>     No the "Open" tag will get executed before this code.
>     TOCModel::fill(..) expands the nodes with the open tags, which will obviously get called first because without filling the new model, how can it be compared with the old one.
>     
>
> 
> Albert Astals Cid wrote:
>     TOCModel::fill calls expand with Qt::QueuedConnection meaning it will not get executed *until* the event loop comes back, so unless you can prove it works (again, have you tried it) I am thinking it is executed afterwards
> 
> Jaydeep Solanki wrote:
>     yes, you are correct, it get's executed afterwards, here's the link to the file I used to test http://goo.gl/BtfBX
>     
>     So what do you suggest, because this can be really annoying that a user closes everything & then when he reloads, everything explodes out !!

Try moving the members that we "remember" that we are reopening the document to toc or tocmodel, this way you may have enough information in ::fill to know it is indeed the same TOC and that you don't need to call the expand notes for the ones marked as "Open".

Am i making any sense?


- Albert


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


On Dec. 31, 2012, 2 p.m., Jaydeep Solanki wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/107994/
> -----------------------------------------------------------
> 
> (Updated Dec. 31, 2012, 2 p.m.)
> 
> 
> Review request for Okular.
> 
> 
> Description
> -------
> 
> This fix will preserve the state of the Table Of Content (toc) on document reload, but if the toc is edited/changed, then it will be restored to default (i.e. all nodes will be folded)
> 
> 
> This addresses bug 312138.
>     http://bugs.kde.org/show_bug.cgi?id=312138
> 
> 
> Diffs
> -----
> 
>   part.h 0c57560 
>   part.cpp 1922128 
>   ui/toc.h eeeff98 
>   ui/toc.cpp 4c84b62 
>   ui/tocmodel.h a857dc0 
>   ui/tocmodel.cpp 39add80 
> 
> Diff: http://git.reviewboard.kde.org/r/107994/diff/
> 
> 
> Testing
> -------
> 
> Checked. Works fine with me.
> 
> 
> Thanks,
> 
> Jaydeep Solanki
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/okular-devel/attachments/20130103/ae2a70e4/attachment.html>


More information about the Okular-devel mailing list