[Okular-devel] [Bug 205076] New: okular: inconsistent handling of reference given as part of command line arg

Jochen Trumpf Jochen.Trumpf at anu.edu.au
Tue Aug 25 14:22:28 CEST 2009


https://bugs.kde.org/show_bug.cgi?id=205076

           Summary: okular: inconsistent handling of reference given as
                    part of command line arg
           Product: okular
           Version: unspecified
          Platform: Compiled Sources
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: NOR
         Component: general
        AssignedTo: okular-devel at kde.org
        ReportedBy: Jochen.Trumpf at anu.edu.au


Version:            (using Devel)
Compiler:          gcc (Gentoo 4.3.2-r3 p1.6, pie-10.1.5) 4.3.2 
OS:                Linux
Installed from:    Compiled sources

The "cut and paste work" in the Shell constructor has fixed handling of the
reference part of an (incomplete) "url" given on the command line, such as 

okular test.dvi#src:13test.tex

for me. However, if the --unique switch is used and okular is already running,
no new Shell is constructed (obviously) but the document is opened via dbus and
Part::openDocument( const QString &doc ). Here, the string doc is converted to
a url using a simple KUrl constructor. In this process, the '#' is encoded as
%23 and the openUrl call fails.

So,

okular --unique test.dvi#src:13test.tex

followed by 

okular --unique test.dvi#src:13test.tex

opens the document correctly but gives an error for the second call.
Before you say this is a feature ;-), consider the following:

okular --unique file:///full/path/test.dvi#src:13test.tex

followed by 

okular --unique file:///full/path/test.dvi#src:13test.tex

works just fine*! If the url is fully qualified, the KUrl constructor
recognises the '#' and splits off the reference. 
I am not sure what the best way of fixing this is. Simply taking the "cut and
paste" code from the Shell constructor and using it in Part::openDocument works
for me (with the obvious modifications), but this seems an ugly solution (code
duplication).

* actually, there is a separate (very tricky) bug in the actual handling of
source references which I will report separately

-- 
Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the Okular-devel mailing list