After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 682882 - python binding can't get the index of a pdf file
python binding can't get the index of a pdf file
Status: RESOLVED FIXED
Product: evince
Classification: Core
Component: general
3.5.x
Other Linux
: Normal normal
: ---
Assigned To: Evince Maintainers
Evince Maintainers
Depends on:
Blocks:
 
 
Reported: 2012-08-28 14:24 UTC by Gonzalo Odiard
Modified: 2012-09-06 15:26 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
read_pdf_index.py is a minimal testcase to get the index in a pdf file (912 bytes, text/x-python)
2012-08-28 14:24 UTC, Gonzalo Odiard
  Details
Proposed patch (1.53 KB, patch)
2012-09-06 13:24 UTC, Gonzalo Odiard
needs-work Details | Review
Updated test case (1.07 KB, text/plain)
2012-09-06 13:25 UTC, Gonzalo Odiard
  Details
New patch, addressing comments (1.54 KB, patch)
2012-09-06 15:12 UTC, Gonzalo Odiard
committed Details | Review

Description Gonzalo Odiard 2012-08-28 14:24:47 UTC
Created attachment 222636 [details]
read_pdf_index.py is a minimal testcase to get the index in a pdf file 

I am trying to get the index in a pdf file using the pygi bindings, but after finish the JobLinks, the model is None.

A testcase is attached. To use it, substitute the pdf uri by one with a index. If the pdf does not have a index, a message is displayed in the command line.

I think I am doing the same than in ev-sidebar-links.c
Comment 1 Gonzalo Odiard 2012-09-06 13:24:11 UTC
Created attachment 223649 [details] [review]
Proposed patch
Comment 2 Gonzalo Odiard 2012-09-06 13:25:21 UTC
Created attachment 223651 [details]
Updated test case
Comment 3 Gonzalo Odiard 2012-09-06 13:26:50 UTC
I found a solution. Attached a patch, and updated the test case.
Comment 4 Carlos Garcia Campos 2012-09-06 13:36:07 UTC
Review of attachment 223649 [details] [review]:

Patch looks good, thanks! I have a few minor comments, though.

::: libview/ev-jobs.c
@@ +413,3 @@
 
+/**
+ * ev_job_links_get_model

Missing trailing : here

@@ +415,3 @@
+ * ev_job_links_get_model
+ * @job: #EvJobLinks
+ * Return value: (transfer none): The GtkTreeModel loaded

Leave a blank line between parameters and body. Use #GtkTreeModel

@@ +416,3 @@
+ * @job: #EvJobLinks
+ * Return value: (transfer none): The GtkTreeModel loaded
+ * Get a GtkTreeModel loaded with the links

#GtkTreeModel here too. This line goes before the Return value: tag. See other api doc comments. See also the gtk-doc manual for more info: 

http://developer.gnome.org/gtk-doc-manual/stable/

::: libview/ev-jobs.h
@@ +462,3 @@
 GType           ev_job_links_get_type     (void) G_GNUC_CONST;
 EvJob          *ev_job_links_new          (EvDocument     *document);
+GtkTreeModel*    ev_job_links_get_model    (EvJobLinks *job);

Please follow the existing coding style, the * goes with the function name not the variable, like in ev_job_links_new, and parameters are lined up
Comment 5 Gonzalo Odiard 2012-09-06 15:12:02 UTC
Created attachment 223661 [details] [review]
New patch, addressing comments
Comment 6 Gonzalo Odiard 2012-09-06 15:14:07 UTC
Thanks by the review, attached a new patch with the changes requested.


(In reply to comment #4)
> Review of attachment 223649 [details] [review]:
> 
> Patch looks good, thanks! I have a few minor comments, though.
> 
> .....
Comment 7 Carlos Garcia Campos 2012-09-06 15:25:49 UTC
Comment on attachment 223661 [details] [review]
New patch, addressing comments

Thanks!