[Okular-devel] Using Okular Generators as a basis for Nepomuk Indexers

Vishesh Handa me at vhanda.in
Thu Feb 14 12:44:21 UTC 2013


Hey everyone

( Please remember to cc me or the nepomuk mailing list )

As you might remember, we foolishly tried to use Okular to fetch the text
and document metadata for 4.10. Okular, clearly isn't ready to be used in
such a way cause its UI parts are quite integrated with the rest. Would it
be feasible to change that?

In Nepomuk when we were trying to create the Okular::Document, we passed a
null pointer for the widget.

This posed the following problems -
1.) Document class -
     a.) It tries to override the cursor via QApplication - we don't have a
QApplication
     b.) It tries to create a QPrinter in order to determine the paper size

One very simple way to fix both of these is to not call them when you don't
have a widget. I've attached a very simplistic patch which does that.

2.) Generators - All the generators use the main widget and often create
dialogs. How do we counter this? Again, the only mechanism that I could
think of was for Okular to tell the generators not to create any ui
elements, and we modify all the generators to abide by that.

In the case of the PDF generator, the only UI components that I noticed was
the password dialog. The DVI generator has this whole DVIRenderer which I'm
not too sure of.

Anyway, it seems like it can be done with some effort.

Is this direction acceptable to the Okular team? Or should I just ignore
all of this and write nepomuk indexers using the libraries used in the
generators? Doing that would lead to quite a lot of code duplication, but
it might be considerably faster since we only need the plain text and
document metadata.


-- 
Vishesh Handa
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/okular-devel/attachments/20130214/83e59758/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: okular-no-ui.diff
Type: application/octet-stream
Size: 5328 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/okular-devel/attachments/20130214/83e59758/attachment-0001.obj>


More information about the Okular-devel mailing list