Bug 330593 - Implement an Okular Bookmark Runner
Summary: Implement an Okular Bookmark Runner
Status: CONFIRMED
Alias: None
Product: krunner
Classification: Plasma
Component: general (show other bugs)
Version: 5.0
Platform: unspecified Linux
: NOR wishlist
Target Milestone: ---
Assignee: Kai Uwe Broulik
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-01-30 20:35 UTC by Barade
Modified: 2016-07-04 15:55 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Barade 2014-01-30 20:35:05 UTC
when typing the name of a bookmark stored in a PDF document, krunner doesn't list it
please move if this is a bug related to krunner not to okular

Reproducible: Always
Comment 1 Albert Astals Cid 2014-01-30 21:27:04 UTC
To Baloo devels: Just pass the href of the bookmarks.xml file back to Okular, right now it fails to open the file at the exact point of the bookmark, but that's trivially fixable once you're calling back.
Comment 2 Vishesh Handa 2014-09-11 11:58:52 UTC
Hi. Could you please provide the following info -

1. How do you store a bookmark in Okular? Do you mean a manually created "Bookmark" or the "Table of Contents".

2. You're expecting that when you make a bookmark called "Dog" in file.pdf, and then you search for "Dog", the 'file.pdf' comes in the results?
Comment 3 Barade 2014-09-11 16:34:03 UTC
I create the bookmark manually and I expect the bookmark "Dog" to be listed as bookmark in krunner.
krunner usually displays bookmarks (from the browser for example) as custom results.
If I select the result I expect Okular to open the PDF and to scroll to the bookmarks position.
Comment 4 Vishesh Handa 2014-09-11 23:06:55 UTC
Marking as CONFIRMED.
Comment 5 mau 2014-09-30 14:39:16 UTC
Would be really nice to have that Feature.
Comment 6 Pinak Ahuja 2014-10-07 07:00:37 UTC
I would like to work on this, where do I start looking around in the code?
Comment 7 Vishesh Handa 2014-10-08 09:12:44 UTC
Hey Pinak. I know this bug is assigned to Baloo, but it's going to be very difficult to implement in Baloo. We discussed this a little (Okular developers and I), and we think it might be more sensible for us to write a krunner for specially searching through Okular.

Reasons why Baloo is not the best candidate for solving this -
- Baloo is just a file indexer. It indexes the metadata inside the files.
- Okular does not store annotations inside the file. Rather, it stores them in an xml file in its data directory. You'll have to look for that files name.
- If Baloo were to be used, one would have to index that file specifically and then associate it with the pdf files. It gets quite complex.
- Additionally, Baloo's current architecture just makes it return file paths. For this we would need it to return a custom url which okular could recognize and them open in that specific location.
Comment 8 Albert Astals Cid 2014-10-08 09:23:20 UTC
"Okular does not store annotations inside the file" -> "Okular does not store bookmarks inside the file"
Comment 9 Vladimir 2014-11-24 13:16:23 UTC
In order to cover several similar use-cases, such as:
a) searching by Okular bookmarks / reviews (in KRunner and Dolpnin)
b) searching by KMail tags/mail-attached notes(in KRunner)
..

I think there should be possibility to write some plugin-based particular providers used to carry on additional metadata to Baloo.

Beside this, baloo feature to return custom urls(which is quite complex) could be used to implement obvious feature to show preview/snippets in a regular text search results list.
Comment 10 Vladimir 2014-11-24 14:40:21 UTC
After quick Baloo sources viewing I have two suggestions:

A) Baloo EmailIndexer does not index mail attributes(that's why KMail mail notes/comments are not included to full-text mail index). I think it is pretty easy to improve.
B) In a similar way it would be great for Okular to save its bookmarks to Akonadi DB rather than to own preference file, so Baloo would be able to use Akonadi additional metadata to improve filesystem full-text index including pdf's bookmarks and review comments