[folks] Remove FieldDetails (obsoleted by AbstractFieldDetails and implementors)



commit ae161634fb59b3bd0954c48d5b64b5bb2a908cfe
Author: Travis Reitter <travis reitter collabora co uk>
Date:   Thu Aug 11 16:44:53 2011 +0200

    Remove FieldDetails (obsoleted by AbstractFieldDetails and implementors)

 folks/Makefile.am                                  |    1 -
 folks/field-details.vala                           |   79 --------------------
 tests/folks/Makefile.am                            |    8 +-
 ...ld-details.vala => abstract-field-details.vala} |   24 +++---
 tools/inspect/utils.vala                           |    4 +-
 5 files changed, 18 insertions(+), 98 deletions(-)
---
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/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<string> 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<FieldDetails> prop_list =
-              (Set<FieldDetails>) prop_value.get_object ();
+          var prop_list =
+              (Set<AbstractFieldDetails<string>>) prop_value.get_object ();
 
           foreach (var p in prop_list)
             {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]