Merge lp:~rainct/libzeitgeist/776651-doc into lp:libzeitgeist

Proposed by Siegfried Gevatter
Status: Merged
Merged at revision: 218
Proposed branch: lp:~rainct/libzeitgeist/776651-doc
Merge into: lp:libzeitgeist
Diff against target: 63 lines (+28/-0)
2 files modified
src/zeitgeist-event.c (+4/-0)
src/zeitgeist-subject.c (+24/-0)
To merge this branch: bzr merge lp:~rainct/libzeitgeist/776651-doc
Reviewer Review Type Date Requested Status
Mikkel Kamstrup Erlandsen Needs Fixing
Review via email: mp+91283@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Mikkel Kamstrup Erlandsen (kamstrup) wrote :

30 +/**
31 + * zeitgeist_subject_get_current_uri:
32 + * @subject: The subject to get the current_uri from
33 + *
34 + * Get the current_uri of a subject.
35 + * This attribute is only significant for subjects for a
36 + * #ZEITGEIST_ZG_MOVE_EVENT.
37 + *
38 + * Returns: The current_uri of @subject.
39 + *
40 + * Since: 0.3.14
41 + */

This is not entirely true is guess?

If a file has been deleted and zg registers it then the current_uri will be NULL, no? And current_uri != uri if at any point in the past Zg has seen a MOVE_EVENT on uri - the ocs make it sounds like it is only relevant when the subject instance is embedded in a MoveEvent instance..?

review: Needs Fixing
Revision history for this message
Siegfried Gevatter (rainct) wrote :

Good catch. Didn't remember how weird our move events are :P.

How about this?

/**
 * zeitgeist_subject_get_current_uri:
 * @subject: The subject to get the current_uri from
 *
 * Get the current_uri of a subject.
 *
 * This is the updated URI taking into account possible relocations of the resource.
 * It is illegal to insert an event with subjects having a `current_uri' different
 * than their `uri'.
 *
 * A special case is events with #ZEITGEIST_ZG_MOVE_EVENT interpretation. In this
 * case, `current_uri' is the destination to which `uri' is being moved, and they
 * are expected to be different.
 *
 * Returns: The current_uri of @subject.
 *
 * Since: 0.3.14
 */

Revision history for this message
Mikkel Kamstrup Erlandsen (kamstrup) wrote :

Yep. Sounds spot on to me.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/zeitgeist-event.c'
2--- src/zeitgeist-event.c 2012-02-02 09:56:38 +0000
3+++ src/zeitgeist-event.c 2012-02-02 14:57:19 +0000
4@@ -441,6 +441,8 @@
5 * from, not where it resides.
6 *
7 * Returns: The origin of @event.
8+ *
9+ * Since: 0.3.14
10 */
11 const gchar*
12 zeitgeist_event_get_origin (ZeitgeistEvent *event)
13@@ -460,6 +462,8 @@
14 * Set the origin of an event.
15 * This differs from a subject's origin, as it describes where the event comes
16 * from, not where it resides.
17+ *
18+ * Since: 0.3.14
19 */
20 void
21 zeitgeist_event_set_origin (ZeitgeistEvent *event,
22
23=== modified file 'src/zeitgeist-subject.c'
24--- src/zeitgeist-subject.c 2012-01-31 14:25:11 +0000
25+++ src/zeitgeist-subject.c 2012-02-02 14:57:19 +0000
26@@ -248,6 +248,18 @@
27 priv->storage = copy;
28 }
29
30+/**
31+ * zeitgeist_subject_get_current_uri:
32+ * @subject: The subject to get the current_uri from
33+ *
34+ * Get the current_uri of a subject.
35+ * This attribute is only significant for subjects for a
36+ * #ZEITGEIST_ZG_MOVE_EVENT.
37+ *
38+ * Returns: The current_uri of @subject.
39+ *
40+ * Since: 0.3.14
41+ */
42 const gchar*
43 zeitgeist_subject_get_current_uri (ZeitgeistSubject *subject)
44 {
45@@ -257,6 +269,18 @@
46 return priv->current_uri;
47 }
48
49+/**
50+ * zeitgeist_subject_set_current_uri:
51+ * @subject: The subject to set the current_uri for
52+ * @current_uri: The current_uri to set
53+ *
54+ * Set the current_uri of a subject.
55+ * It is illegal to give this attribute a value other than the subject's
56+ * URI (as returned by zeitgeist_subject_get_uri()), unless used with a
57+ * #ZEITGEIST_ZG_MOVE_EVENT.
58+ *
59+ * Since: 0.3.14
60+ */
61 void
62 zeitgeist_subject_set_current_uri (ZeitgeistSubject *subject,
63 const gchar *current_uri)

Subscribers

People subscribed via source and target branches