summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTravis Reitter <travis.reitter@collabora.co.uk>2011-10-21 15:17:41 (GMT)
committerTravis Reitter <travis.reitter@collabora.co.uk>2011-10-24 18:39:23 (GMT)
commit144583fd56fcbb9325e54ee6ded5d5005a3d3b62 (patch)
tree5fca67e4900c66c27307ee9c18f24f6dfeaced82
parentba233588b1208c761e4512054626f6ddb6db8647 (diff)
downloadfolks-144583fd56fcbb9325e54ee6ded5d5005a3d3b62.tar.gz
folks-144583fd56fcbb9325e54ee6ded5d5005a3d3b62.tar.xz
Migrate PhoneDetails to using AbstractFieldDetails.id
Helps: bgo#662433 - AbstractFieldDetails.equal() is ambiguous about checking parameters.
-rw-r--r--backends/tracker/lib/trf-persona.vala9
-rw-r--r--folks/phone-details.vala10
2 files changed, 14 insertions, 5 deletions
diff --git a/backends/tracker/lib/trf-persona.vala b/backends/tracker/lib/trf-persona.vala
index b37b0af..636bbe3 100644
--- a/backends/tracker/lib/trf-persona.vala
+++ b/backends/tracker/lib/trf-persona.vala
@@ -1194,8 +1194,7 @@ public class Trf.Persona : Folks.Persona,
string[] p_info = p.split ("\t");
var phone_fd =
new PhoneFieldDetails (p_info[Trf.PhoneFields.PHONE]);
- phone_fd.set_parameter ("tracker_id",
- p_info[Trf.PhoneFields.TRACKER_ID]);
+ phone_fd.id = p_info[Trf.PhoneFields.TRACKER_ID];
phones.add (phone_fd);
}
}
@@ -1212,7 +1211,7 @@ public class Trf.Persona : Folks.Persona,
foreach (var p in this._phone_numbers)
{
- if (p.get_parameter_values ("tracker_id").contains (tracker_id))
+ if (p.id == tracker_id)
{
found = true;
break;
@@ -1222,7 +1221,7 @@ public class Trf.Persona : Folks.Persona,
if (!found)
{
var phone_fd = new PhoneFieldDetails (phone);
- phone_fd.set_parameter ("tracker_id", tracker_id);
+ phone_fd.id = tracker_id;
this._phone_numbers.add (phone_fd);
this.notify_property ("phone-numbers");
}
@@ -1236,7 +1235,7 @@ public class Trf.Persona : Folks.Persona,
foreach (var p in this._phone_numbers)
{
- if (p.get_parameter_values ("tracker_id").contains (tracker_id))
+ if (p.id == tracker_id)
{
this._phone_numbers.remove (p);
found = true;
diff --git a/folks/phone-details.vala b/folks/phone-details.vala
index 8491822..384c05a 100644
--- a/folks/phone-details.vala
+++ b/folks/phone-details.vala
@@ -41,6 +41,16 @@ public class Folks.PhoneFieldDetails : AbstractFieldDetails<string>
private const string[] _valid_digits = { "#", "*", "0", "1", "2", "3", "4",
"5", "6", "7", "8", "9" };
+ private string _id;
+ /**
+ * {@inheritDoc}
+ */
+ public override string id
+ {
+ get { return this._id; }
+ set { this._id = (value != null ? value : ""); }
+ }
+
/**
* Create a new PhoneFieldDetails.
*