[Okular-devel] Review Request 123676: FEATURE: Implement the '--unique-per-file' as suggested in Bug #319839

Jonathan Verner jonathan.verner at matfyz.cz
Thu May 7 17:15:51 UTC 2015


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

Review request for Okular.


Bugs: 319839
    http://bugs.kde.org/show_bug.cgi?id=319839


Repository: okular


Description
-------

This commit implements a variant of the '--unique' option, allowing
okular to start instances which are unique for a given path.

If one runs okular with the --unique-per-file option and gives a path as
an argument, then okular first checks whether this path is not already
opened in some "unique-per-file" instance. If so, it reloads this path
in that instance and tries to raise its window. If not, it opens the
file and makes itself a "unique-per-file" instance for the path.

The implementation is similar to the way the '--unique' option is
handled. Each "unique-per-file" instance registers a special DBUS
interface whose name is constructed as follows: 'org.kde.okular_'
is appended with a base64-encoded path (base64-encoding is used so that
the resulting name is a valid DBUS interface name) for which the
instance should be unique. On this interface it listens for requests for
reloading (or, mainly, changing current position) of the path. When
okular is run with the '--unique-per-file' option, it first checks
whether the appropriate interface is registered. If yes, it uses it to
reload the file. Otherwise it registeres this interface and opens the
file normally.


Diffs
-----

  shell/main.cpp cc3d39bb4cac70a2e54b8cbcdaed30b71ceca214 
  shell/okular_main.cpp b66b6a5f7cd30e6d123ba0b0a2d871e11807ea15 
  shell/shell.h fea80acfbf91968d90babd281d199341b6370bbd 
  shell/shell.cpp 73559689bd28758f36edb25b09a7036fd21a7835 
  shell/shellutils.h d5518c344c47dd81033a883cc43cca387764d362 
  shell/shellutils.cpp 0dd737cf70ac888225a919799bd71905cfb89580 
  tests/mainshelltest.cpp a044895c1935c587552e875a98627e58d19ed443 

Diff: https://git.reviewboard.kde.org/r/123676/diff/


Testing
-------

I manually tested both the --unique and the --unique-per-file options.
Both behave as expected and do not interfere with each other.

I am not sure how to write an automated test, though.


Thanks,

Jonathan Verner

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


More information about the Okular-devel mailing list