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 795070 - GSimpleAction: Improve documentation (slightly)
GSimpleAction: Improve documentation (slightly)
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: docs
2.56.x
Other All
: Normal minor
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2018-04-08 10:44 UTC by Daniel Boles
Modified: 2018-04-09 13:04 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
GSimpleAction: Explain nullable @parameter(_type)s (1.80 KB, patch)
2018-04-08 10:45 UTC, Daniel Boles
none Details | Review
GSimpleAction: Explain "(expected|correct) type" (1.87 KB, patch)
2018-04-08 10:45 UTC, Daniel Boles
none Details | Review
GSimpleAction: Slightly improve docs for new()s (1.52 KB, patch)
2018-04-08 10:46 UTC, Daniel Boles
none Details | Review
GSimpleAction: Clarify/fix @parameter(_type) docs (1.93 KB, patch)
2018-04-08 18:11 UTC, Daniel Boles
committed Details | Review
GSimpleAction: Explain "(expected|correct) type" (1.87 KB, patch)
2018-04-08 18:12 UTC, Daniel Boles
committed Details | Review
GSimpleAction: Slightly improve docs for new()s (1.50 KB, patch)
2018-04-08 18:12 UTC, Daniel Boles
committed Details | Review

Description Daniel Boles 2018-04-08 10:44:51 UTC
These are just some tweaks to avoid users having to infer things & to formatting.
Comment 1 Daniel Boles 2018-04-08 10:45:22 UTC
Created attachment 370654 [details] [review]
GSimpleAction: Explain nullable @parameter(_type)s

If something is nullable, it's always helpful to confirm what NULL means
Comment 2 Daniel Boles 2018-04-08 10:45:40 UTC
Created attachment 370655 [details] [review]
GSimpleAction: Explain "(expected|correct) type"

Let's avoid users having to infer what these mean; it's easy to explain.
Comment 3 Daniel Boles 2018-04-08 10:46:12 UTC
Created attachment 370656 [details] [review]
GSimpleAction: Slightly improve docs for new()s

Explain why we say "See new_stateful()" (although it's pretty obvious).
Drop a redundant copy of the argument description in the body text.
Add a # to the GVariant type name so that we can have a nice link.
Comment 4 Philip Withnall 2018-04-08 16:47:07 UTC
Review of attachment 370654 [details] [review]:

Yup
Comment 5 Philip Withnall 2018-04-08 16:48:03 UTC
Review of attachment 370655 [details] [review]:

::: gio/gsimpleaction.c
@@ +379,3 @@
+   * @parameter will always be of the expected type, i.e. the parameter type
+   * specified when the action was created. If an incorrect type is given when
+   * activating the action, this signal is not be emitted.

s/is not be emitted/is not emitted/.
Comment 6 Philip Withnall 2018-04-08 16:48:47 UTC
Review of attachment 370656 [details] [review]:

::: gio/gsimpleaction.c
@@ +602,3 @@
  *
+ * The created action is stateless. See g_simple_action_new_stateful() if you
+ * want to create an action that has state.

s/if you want to/to/.
Comment 7 Daniel Boles 2018-04-08 16:58:16 UTC
Thanks for the quick reviews. I've applied those grammar fixes.

I also updated the 1st patch to explain why I change references to "the activate function" to ::activate, namely that we as SimpleAction take that over, so the user never deals with it. I dunno how I forgot that bit of the message before.

Should that be changed in the property description too?

  g_object_class_install_property (object_class, PROP_PARAMETER_TYPE,
                                   g_param_spec_boxed ("parameter-type",
                                                       P_("Parameter Type"),
                                                       P_("The type of GVariant passed to activate()"),

But then: in GSimpleAction we are installing a property with the same name as a read-only one that already exists in GAction, so maybe that's an argument for keeping the name the same there? It hardly seems like the most important place to change this anyway.
Comment 8 Daniel Boles 2018-04-08 18:11:48 UTC
Created attachment 370663 [details] [review]
GSimpleAction: Clarify/fix @parameter(_type) docs

later if wanted.

--

GSimpleAction: Clarify/fix @parameter(_type) docs

If something is nullable, it's always helpful to identify what NULL
means. Also, this is not the parameter for the .activate() vfunc, as we
take that over: rather, it is the parameter for the ::activate signal.
Comment 9 Daniel Boles 2018-04-08 18:12:18 UTC
Created attachment 370664 [details] [review]
GSimpleAction: Explain "(expected|correct) type"

Let's avoid users having to infer what these mean; it's easy to explain.
Comment 10 Daniel Boles 2018-04-08 18:12:32 UTC
Created attachment 370665 [details] [review]
GSimpleAction: Slightly improve docs for new()s

Explain why we say "See new_stateful()" (although it's pretty obvious).
Drop a redundant copy of the argument description in the body text.
Add a # to the GVariant type name so that we can have a nice link.
Comment 11 Philip Withnall 2018-04-09 12:25:59 UTC
Review of attachment 370663 [details] [review]:

Yup
Comment 12 Philip Withnall 2018-04-09 12:26:12 UTC
Review of attachment 370664 [details] [review]:

Yup
Comment 13 Philip Withnall 2018-04-09 12:26:24 UTC
Review of attachment 370665 [details] [review]:

Yup.
Comment 14 Daniel Boles 2018-04-09 12:37:13 UTC
Thanks. Should I pick to glib-2-56? (this and bug 795096)
Comment 15 Philip Withnall 2018-04-09 12:54:14 UTC
(In reply to Daniel Boles from comment #14)
> Thanks. Should I pick to glib-2-56? (this and bug 795096)

No, generally documentation tweaks are not important enough to backport unless specifically requested by distributions (or unless they correct errors). Backporting too much makes it harder for distributions to see the important patches to cherry-pick.
Comment 16 Daniel Boles 2018-04-09 13:04:24 UTC
Thanks, pushed to master