API changes:
* Add AbstractFieldDetails.id to identify instances of details
* Deprecate PostalAddress.uid in favor of AbstractFieldDetails.id
+* Deprecate NoteFieldDetails.uid in favor of AbstractFieldDetails.id
Behavior changes:
* PostalAddress.equal() now ignores PostalAddress.uid
+* NoteFieldDetails.equal() now ignores NoteFieldDetails.uid
Overview of changes from libfolks 0.6.4 to libfolks 0.6.4.1
=============================================================
*/
public class Folks.NoteFieldDetails : AbstractFieldDetails<string>
{
- /* FIXME: deprecate this */
- private string _uid;
+ private string _id;
+ /**
+ * {@inheritDoc}
+ */
+ public override string id
+ {
+ get { return this._id; }
+ set { this._id = (value != null ? value : ""); }
+ }
+
/**
* The UID of the note (if any).
*/
+ [Deprecated (since = "UNRELEASED", replacement = "AbstractFieldDetails.id")]
public string uid
{
- get { return _uid; }
- set { _uid = (value != null ? value : ""); }
+ get { return this.id; }
+ set { this.id = value; }
}
/**
this.value = value;
if (parameters != null)
this.parameters = parameters;
- this.uid = uid;
+
+ /* These are kept the same value now */
+ this.id = uid;
}
/**
if (that_nfd == null)
return false;
- return (this.uid == that_nfd.uid && this.value == that_nfd.value);
+ return (this.value == that_nfd.value);
}
/**
if (this.value != null)
retval += this.value.hash ();
- if (this.uid != null)
- retval += this.uid.hash ();
+ if (this.id != null)
+ retval += this.id.hash ();
return retval;
}
if (i.full_name == this._fullname)
{
i.notify["notes"].connect (this._notify_note_cb);
- foreach (var n in i.notes)
+ foreach (var note_fd in i.notes)
{
- if (n.equal (new NoteFieldDetails (this._note)))
+ var note_fd_expected = new NoteFieldDetails (this._note, null,
+ null);
+
+ /* We copy the tracker_id - we don't know it.
+ * We could get it from the 1st personas iid but there is no
+ * real need. */
+ note_fd_expected.id = note_fd.id;
+
+ if (note_fd.equal (note_fd_expected))
{
+ /* Ensure that setting the Note uid directly (which is
+ * deprecated) is equivalent to setting the id on a
+ * NoteFieldDetails directly */
+ var note_fd_2 = new NoteFieldDetails (
+ note_fd_expected.value, null, note_fd.id);
+ assert (note_fd.equal (note_fd_2));
+ assert (note_fd.id == note_fd_2.id);
+
this._found_note = true;
this._main_loop.quit ();
}