From: Travis Reitter Date: Thu, 11 Aug 2011 14:44:53 +0000 (+0200) Subject: Remove FieldDetails (obsoleted by AbstractFieldDetails and implementors) X-Git-Tag: FOLKS_0_6_0~9 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ae161634fb59b3bd0954c48d5b64b5bb2a908cfe;p=platform%2Fupstream%2Ffolks.git Remove FieldDetails (obsoleted by AbstractFieldDetails and implementors) --- diff --git a/folks/Makefile.am b/folks/Makefile.am index e71c637..1fde141 100644 --- a/folks/Makefile.am +++ b/folks/Makefile.am @@ -20,7 +20,6 @@ libfolks_la_SOURCES = \ birthday-details.vala \ email-details.vala \ favourite-details.vala \ - field-details.vala \ gender-details.vala \ group-details.vala \ web-service-details.vala \ diff --git a/folks/field-details.vala b/folks/field-details.vala deleted file mode 100644 index 73950c4..0000000 --- a/folks/field-details.vala +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright (C) 2011 Collabora Ltd. - * - * This library is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 2.1 of the License, or - * (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this library. If not, see . - * - * Authors: - * Marco Barisione - * Travis Reitter - */ - -using GLib; -using Gee; - -/** - * Object representing any type of string value that can have some vCard-like - * parameters associated with it. - * - * Some contact details, like phone numbers or URLs, can have some - * extra details associated with them. - * For instance, a phone number expressed in vcard notation as - * `tel;type=work,voice:(111) 555-1234` would be represented as - * a AbstractFieldDetails with value "(111) 555-1234" and with parameters - * `['type': ('work', 'voice')]`. - * - * @since UNRELEASED - */ -public class Folks.FieldDetails : AbstractFieldDetails -{ - /** - * Create a new FieldDetails. - * - * @param value the value of the field - * @param parameters initial parameters. See - * {@link AbstractFieldDetails.parameters}. A `null` value is equivalent to an - * empty map of parameters. - * - * @return a new FieldDetails - * - * @since 0.3.5 - */ - public FieldDetails (string value, - MultiMap? parameters = null) - { - this.value = value; - if (parameters != null) - this.parameters = parameters; - } - - /** - * {@inheritDoc} - * - * @since UNRELEASED - */ - public override bool equal (AbstractFieldDetails that) - { - return base.equal (that); - } - - /** - * {@inheritDoc} - * - * @since UNRELEASED - */ - public override uint hash () - { - return base.hash (); - } -} diff --git a/tests/folks/Makefile.am b/tests/folks/Makefile.am index 0d24b12..cbb895b 100644 --- a/tests/folks/Makefile.am +++ b/tests/folks/Makefile.am @@ -39,7 +39,7 @@ AM_VALAFLAGS = \ # in order from least to most complex noinst_PROGRAMS = \ - field-details \ + abstract-field-details \ utils \ backend-loading \ aggregation \ @@ -69,8 +69,8 @@ aggregation_SOURCES = \ aggregation.vala \ $(NULL) -field_details_SOURCES = \ - field-details.vala \ +abstract_field_details_SOURCES = \ + abstract-field-details.vala \ $(NULL) utils_SOURCES = \ @@ -95,7 +95,7 @@ MAINTAINERCLEANFILES = \ $(addsuffix .c,$(noinst_PROGRAMS)) \ backend_loading_vala.stamp \ aggregation_vala.stamp \ - field_details_vala.stamp \ + abstract_field_details_vala.stamp \ utils_vala.stamp \ avatar_cache_vala.stamp \ object_cache_vala.stamp \ diff --git a/tests/folks/field-details.vala b/tests/folks/abstract-field-details.vala similarity index 88% rename from tests/folks/field-details.vala rename to tests/folks/abstract-field-details.vala index 3b94573..ed3cdd4 100644 --- a/tests/folks/field-details.vala +++ b/tests/folks/abstract-field-details.vala @@ -20,11 +20,11 @@ using Gee; using Folks; -public class FieldDetailsTests : Folks.TestCase +public class EmailFieldDetailsTests : Folks.TestCase { - public FieldDetailsTests () + public EmailFieldDetailsTests () { - base ("FieldDetails"); + base ("EmailFieldDetails"); this.add_test ("parameter replacement", this.test_param_replacement); this.add_test ("simple equality", this.test_simple_equality); this.add_test ("parameter equality", this.test_params_equality); @@ -45,10 +45,10 @@ public class FieldDetailsTests : Folks.TestCase string param_name = "metasyntactic-variables"; string[] values_1 = {"foo", "bar", "baz"}; string[] values_2 = {"qux", "quxx"}; - FieldDetails details; + EmailFieldDetails details; Collection values; - details = new FieldDetails (param_name); + details = new EmailFieldDetails (param_name); foreach (var val in values_1) details.add_parameter (param_name, val); @@ -93,9 +93,9 @@ public class FieldDetailsTests : Folks.TestCase public void test_simple_equality () { - FieldDetails details_a_1 = new FieldDetails ("foo"); - FieldDetails details_a_2 = new FieldDetails ("foo"); - FieldDetails details_b_1 = new FieldDetails ("bar"); + EmailFieldDetails details_a_1 = new EmailFieldDetails ("foo"); + EmailFieldDetails details_a_2 = new EmailFieldDetails ("foo"); + EmailFieldDetails details_b_1 = new EmailFieldDetails ("bar"); /* Very-basic comparisons */ assert (details_a_1.equal (details_a_2)); @@ -106,8 +106,8 @@ public class FieldDetailsTests : Folks.TestCase public void test_params_equality () { - FieldDetails details_a_1 = new FieldDetails ("foo"); - FieldDetails details_a_2 = new FieldDetails ("foo"); + EmailFieldDetails details_a_1 = new EmailFieldDetails ("foo"); + EmailFieldDetails details_a_2 = new EmailFieldDetails ("foo"); /* Add the parameters differently to the two instances to ensure these * methods work as expected */ @@ -162,7 +162,7 @@ public class FieldDetailsTests : Folks.TestCase assert (!details_a_1.equal (details_b_1)); /* Comparing different derived classes */ - FieldDetails details_c_1 = new FieldDetails ("foo@example.org"); + EmailFieldDetails details_c_1 = new EmailFieldDetails ("foo@example.org"); assert (!details_a_1.equal (details_c_1)); } } @@ -172,7 +172,7 @@ public int main (string[] args) Test.init (ref args); TestSuite root = TestSuite.get_root (); - root.add_suite (new FieldDetailsTests ().get_suite ()); + root.add_suite (new EmailFieldDetailsTests ().get_suite ()); Test.run (); diff --git a/tools/inspect/utils.vala b/tools/inspect/utils.vala index 66c9f29..4d68e39 100644 --- a/tools/inspect/utils.vala +++ b/tools/inspect/utils.vala @@ -346,8 +346,8 @@ private class Folks.Inspect.Utils { output_string = "{ "; bool first = true; - Set prop_list = - (Set) prop_value.get_object (); + var prop_list = + (Set>) prop_value.get_object (); foreach (var p in prop_list) {