[Okular-devel] Review Request 123427: Save view information per file

Felix Mauch felix_mauch at web.de
Tue Sep 15 18:35:18 UTC 2015



> On Aug. 10, 2015, 10:59 p.m., Albert Astals Cid wrote:
> > ui/pageview.cpp, line 1402
> > <https://git.reviewboard.kde.org/r/123427/diff/2/?file=390795#file390795line1402>
> >
> >     You should use a string here and not an int, otherwise if in the future we add, move or remove items in this menu the numbers are going to be a pain to store/restore
> 
> Felix Mauch wrote:
>     I don't like hard-coded strings very much, as you'll have to change all those later on, as well. However, I agree, that my simple solution is even worse than that. What about using the data field of the action? The viewMode enum-Type from Okular::Settings is stored in there. So when new modes are added there or the menu entries are reordered, no further changes should be necessary. However, I'd still have to use an int internally, as I can't save the enum type in the QVariant. Yet, I could to a casting the
>     
>     ```cpp
>     int mode;
>     for (int i=0; i < d->aViewMode->menu()->actions().size(); ++i) {
>         const QAction* action = d->aViewMode->menu()->actions().at(i);
>         if(action->isChecked() ) {
>             QVariant mode_id = action->data();
>             mode = mode_id.toInt();
>             break;
>         }
>     }
>     return mode;
>     ```
> 
> Albert Astals Cid wrote:
>     Yes using something like the viewMode that doesn't tie physical order of the actions to the saved setting is much better.
> 
> Albert Astals Cid wrote:
>     Did you find the time to develop something like what was suggested above?

Hej Albert,

yes, I did something, however work came in between. I've got some more time now and this issue has high priority on my agenda. Hopefully I'll get it finished this week.


- Felix


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/123427/#review83684
-----------------------------------------------------------


On Sept. 15, 2015, 6:35 p.m., Felix Mauch wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/123427/
> -----------------------------------------------------------
> 
> (Updated Sept. 15, 2015, 6:35 p.m.)
> 
> 
> Review request for Okular.
> 
> 
> Bugs: 341318
>     http://bugs.kde.org/show_bug.cgi?id=341318
> 
> 
> Repository: okular
> 
> 
> Description
> -------
> 
> Adds the functiionality to save the view mode (single page, facing...) and continuous scrolling to the document information as it is already done with the zoom information.
> 
> 
> Diffs
> -----
> 
>   core/document.cpp cd9ea6d 
>   core/view.h a369d24 
>   ui/pageview.h 376bbdc 
>   ui/pageview.cpp dc9eab8 
> 
> Diff: https://git.reviewboard.kde.org/r/123427/diff/
> 
> 
> Testing
> -------
> 
> I use a version with this patch applied since a couple of days. The intended functionality seems to work reliably.
> Maybe it would be nice to implement a "standard view" selection in the options dialog as it's done for the zoom mode.
> 
> 
> Thanks,
> 
> Felix Mauch
> 
>

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


More information about the Okular-devel mailing list