<html>
<head>
<base href="https://bugs.freedesktop.org/" />
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW --- - [PATCH] Add wrapper for Annot::setFlags"
href="https://bugs.freedesktop.org/show_bug.cgi?id=58015#c8">Comment # 8</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW --- - [PATCH] Add wrapper for Annot::setFlags"
href="https://bugs.freedesktop.org/show_bug.cgi?id=58015">bug 58015</a>
from <span class="vcard"><a class="email" href="mailto:carlosgc@gnome.org" title="Carlos Garcia Campos <carlosgc@gnome.org>"> <span class="fn">Carlos Garcia Campos</span></a>
</span></b>
<pre>Comment on <span class=""><a href="attachment.cgi?id=71198" name="attach_71198" title="patch: update the demo">attachment 71198</a> <a href="attachment.cgi?id=71198&action=edit" title="patch: update the demo">[details]</a></span> <a href='page.cgi?id=splinter.html&bug=58015&attachment=71198'>[review]</a>
patch: update the demo
Review of <span class=""><a href="attachment.cgi?id=71198" name="attach_71198" title="patch: update the demo">attachment 71198</a> <a href="attachment.cgi?id=71198&action=edit" title="patch: update the demo">[details]</a></span> <a href='page.cgi?id=splinter.html&bug=58015&attachment=71198'>[review]</a>:
-----------------------------------------------------------------
Looks great, I have a just some minor comments
::: glib/demo/annots.c
@@ +694,5 @@
<span class="quote">> + case ANNOTS_FLAG_HIDDEN_COLUMN:
> + flag_bit = POPPLER_ANNOT_FLAG_HIDDEN;
> + break;
> + default:
> + flag_bit = POPPLER_ANNOT_FLAG_PRINT;</span >
Instead of default, add the case ANNOTS_FLAG_PRINT_COLUMN: better, and add
default: doing nothing or with g_assert_not_reached().
@@ +699,5 @@
<span class="quote">> + break;
> + }
> +
> + if (fixed)
> + flags = flags | flag_bit;</span >
This could be flags |= flag_bit no?
@@ +701,5 @@
<span class="quote">> +
> + if (fixed)
> + flags = flags | flag_bit;
> + else
> + flags = flags & (~flag_bit);</span >
And this flags &= ~flag_bit
@@ +941,4 @@
<span class="quote">> NULL);
>
> renderer = gtk_cell_renderer_toggle_new ();
> + g_signal_connect (G_OBJECT (renderer), "toggled",</span >
g_signal_connect expects a gpointer so no need to cast to GObject.
@@ +965,5 @@
<span class="quote">> renderer = gtk_cell_renderer_toggle_new ();
> + g_signal_connect (G_OBJECT (renderer), "toggled",
> + G_CALLBACK (pgd_annots_flags_toggled),
> + (gpointer) demo);
> + g_object_set_data (G_OBJECT (renderer), "column", GINT_TO_POINTER (ANNOTS_FLAG_PRINT_COLUMN));</span >
I think it would be simpler to add three different callbacks and call a custom
method passing the column</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>