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
=== modified file 'src/zeitgeist-event.c'
--- src/zeitgeist-event.c 2012-02-02 09:56:38 +0000
+++ src/zeitgeist-event.c 2012-02-02 14:57:19 +0000
@@ -441,6 +441,8 @@
441 * from, not where it resides.441 * from, not where it resides.
442 *442 *
443 * Returns: The origin of @event.443 * Returns: The origin of @event.
444 *
445 * Since: 0.3.14
444 */446 */
445const gchar*447const gchar*
446zeitgeist_event_get_origin (ZeitgeistEvent *event)448zeitgeist_event_get_origin (ZeitgeistEvent *event)
@@ -460,6 +462,8 @@
460 * Set the origin of an event.462 * Set the origin of an event.
461 * This differs from a subject's origin, as it describes where the event comes463 * This differs from a subject's origin, as it describes where the event comes
462 * from, not where it resides.464 * from, not where it resides.
465 *
466 * Since: 0.3.14
463 */467 */
464void468void
465zeitgeist_event_set_origin (ZeitgeistEvent *event,469zeitgeist_event_set_origin (ZeitgeistEvent *event,
466470
=== modified file 'src/zeitgeist-subject.c'
--- src/zeitgeist-subject.c 2012-01-31 14:25:11 +0000
+++ src/zeitgeist-subject.c 2012-02-02 14:57:19 +0000
@@ -248,6 +248,18 @@
248 priv->storage = copy;248 priv->storage = copy;
249}249}
250250
251/**
252 * zeitgeist_subject_get_current_uri:
253 * @subject: The subject to get the current_uri from
254 *
255 * Get the current_uri of a subject.
256 * This attribute is only significant for subjects for a
257 * #ZEITGEIST_ZG_MOVE_EVENT.
258 *
259 * Returns: The current_uri of @subject.
260 *
261 * Since: 0.3.14
262 */
251const gchar*263const gchar*
252zeitgeist_subject_get_current_uri (ZeitgeistSubject *subject)264zeitgeist_subject_get_current_uri (ZeitgeistSubject *subject)
253{265{
@@ -257,6 +269,18 @@
257 return priv->current_uri;269 return priv->current_uri;
258}270}
259271
272/**
273 * zeitgeist_subject_set_current_uri:
274 * @subject: The subject to set the current_uri for
275 * @current_uri: The current_uri to set
276 *
277 * Set the current_uri of a subject.
278 * It is illegal to give this attribute a value other than the subject's
279 * URI (as returned by zeitgeist_subject_get_uri()), unless used with a
280 * #ZEITGEIST_ZG_MOVE_EVENT.
281 *
282 * Since: 0.3.14
283 */
260void284void
261zeitgeist_subject_set_current_uri (ZeitgeistSubject *subject,285zeitgeist_subject_set_current_uri (ZeitgeistSubject *subject,
262 const gchar *current_uri)286 const gchar *current_uri)

Subscribers

People subscribed via source and target branches