Merge lp:~robert-ancell/ubuntu-ui-toolkit/statesaver-docs into lp:ubuntu-ui-toolkit

Proposed by Robert Ancell
Status: Rejected
Rejected by: Zoltan Balogh
Proposed branch: lp:~robert-ancell/ubuntu-ui-toolkit/statesaver-docs
Merge into: lp:ubuntu-ui-toolkit
Diff against target: 76 lines (+18/-18)
1 file modified
modules/Ubuntu/Components/plugin/ucstatesaver.cpp (+18/-18)
To merge this branch: bzr merge lp:~robert-ancell/ubuntu-ui-toolkit/statesaver-docs
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Needs Fixing
Ubuntu SDK team Pending
Review via email: mp+237714@code.launchpad.net

Commit message

Fix some spelling/grammar mistakes and do some rewording to make documentation clearer

Description of the change

Fix some spelling and grammar mistakes in the documentation. I've also attempted to reword some sentences to be clearer.

In general, the StateSaver documentation is very difficult to understand. In particular:

- It talks about serialization which is a technical detail on how the data is stored but not something the API consumer actually sees.
- It talks about "component completion time", "deactivated" and "closed properly" but it's not clear exactly what these are / when they occur.
- It talks about "synchronizing" but it's not clear what's being synchronized.
- Don't know what an "attachee" is.

To post a comment you must log in.
Revision history for this message
Robert Ancell (robert-ancell) wrote :

I also don't know what an "attached object" is.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Zsombor Egri (zsombi) wrote :

First, thanks for fixing this! Let me answer these, perhaps we can make the docs more understandable.
> - It talks about serialization which is a technical detail on how the data is stored but not
> something the API consumer actually sees.

The property values are saved once the component is completed or when the application deactivates (see below what that means). It is restored to the saved state when the application is (re)started. The saved data is cleared once the application is closed properly.

> - It talks about "component completion time", "deactivated" and "closed properly" but it's not
> clear exactly what these are / when they occur.

Component completion time is well known in QML world.
An application is "deactivated" when it looses focus (goes background, in our case on device goes to sleep, but on desktop is simply background).
An application is "closed properly" when the user quits (on desktop) or "kills" the app from the task management parallax (on device). When the lifecycle management kills it, that's an improper app close. Or when an app is SIGTERM-ed or SIGINT-ed on desktop.

> - It talks about "synchronizing" but it's not clear what's being synchronised.

The example where this synchronisation is mentioned is where the StateSaver's enabled property is bound with the TextField's enabled, so when the TextField is disabled, the StateSaver will also be. I thought we can call this as synchronised, but hope you find a better explanation for it tbh... The idea is that StateSaver will not save any properties of the attached (below) is that one is disabled, but the state saver's enabled should also be driven independently from its attachee.

> - Don't know what an "attachee" is.

Attachee is the object (or item) to which the attached properties are attached :) Again, a QML term.
An attached object is the object which holds the attached properties (in our case StateSaver is the attached object, and the attached properties are "enabled" and "properties").

And last, please sync the MR with staging and re-submit this MR against that, and not agains trunk.
lp:~ubuntu-sdk-team/ubuntu-ui-toolkit/staging

Unmerged revisions

1110. By Robert Ancell

Fix some spelling/grammar mistakes and do some rewording to make documentation clearer

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'modules/Ubuntu/Components/plugin/ucstatesaver.cpp'
2--- modules/Ubuntu/Components/plugin/ucstatesaver.cpp 2014-09-03 16:12:24 +0000
3+++ modules/Ubuntu/Components/plugin/ucstatesaver.cpp 2014-10-09 02:31:17 +0000
4@@ -142,19 +142,19 @@
5 * \instantiates UCStateSaverAttached
6 * \inqmlmodule Ubuntu.Components 1.1
7 * \ingroup ubuntu-services
8- * \brief Attached propertyes to save component property states.
9- *
10- * StateSaver attached object provides the ability to save component property values
11- * that can be restored after an inproper application close. The properties subject
12- * of serialization must be given in the \l properties as a string, separated with
13- * commas. The serialization will happen automatically on component's completion
14- * time, as well as when the application is deactivated. Automatic serialization
15- * of a component can be turned off by simply setting false to \l enabled property.
16- *
17- * \note The application name must be set correctly to the package name so that
18- * state saving can work (e.g. com.ubuntu.calendar) through \l MainView::applicationName.
19- *
20- * States saved are discarded when the application is closed properly. The state
21+ * \brief Attached properties to save component property states.
22+ *
23+ * The StateSaver attached object provides the ability to save component property values
24+ * so they can be restored after an inproper application close. The names of the properties
25+ * to be serialized are listed in the \l properties property.
26+ * The storage will happen automatically at the component's completion
27+ * time or when the application is deactivated. Automatic serialization
28+ * of a component can be disabled by setting the \l enabled property to false.
29+ *
30+ * \note The application name must be set in \l MainView::applicationName and match the
31+ * package name so that state saving can work (e.g. com.ubuntu.calendar).
32+ *
33+ * Saved states are discarded when the application is closed properly. The state
34 * loading is ignored (but not discarded) when the application is launched through
35 * UriHandler.
36 *
37@@ -187,10 +187,10 @@
38 * \endqml
39 *
40 * StateSaver computes a unique identifier for the attachee using the component's
41- * and all its parents' \a{id}. Therefore attachee component as well as all its
42+ * and all its parents' \a{id}s. Therefore attachee component as well as all its
43 * parents must have a valid ID set.
44 *
45- * The following example will give error for the \a input, as the root component
46+ * The following example will give an error for \a input, as the root component
47 * has no id specified:
48 * \qml
49 * Item {
50@@ -223,7 +223,7 @@
51 *
52 * When used with Repeater, each created item from the Repeater's delegate will
53 * be saved separately. Note that due to the way Repeater works, Repeaters do not
54- * need to have id specified.
55+ * need to have an id specified.
56 *
57 * \qml
58 * Item {
59@@ -265,7 +265,7 @@
60 // getter/setter
61 /*!
62 * \qmlproperty bool StateSaver::enabled
63- * The property drives the automatic state saving. When disabled, state saving
64+ * This property drives the automatic state saving. When disabled, state saving
65 * will not happen on properties.
66 *
67 * The default value is true.
68@@ -292,7 +292,7 @@
69 * List of properties to be serialized, separated with commas. Properties must be
70 * writable and can only be \l{http://qt-project.org/doc/qt-5.0/qtqml/qtqml-typesystem-basictypes.html}{QML base types}.
71 *
72- * A custom singl eline input which saves the text, polaceholderText, font and color would look as follows:
73+ * A custom single line input which saves the text, placeholderText, font and color would look as follows:
74 * \qml
75 * TextField {
76 * id: input

Subscribers

People subscribed via source and target branches

to status/vote changes: