[ fixes bug #53994 ]
authorChris Toshok <toshok@ximian.com>
Sat, 21 Feb 2004 01:20:46 +0000 (01:20 +0000)
committerChris Toshok <toshok@src.gnome.org>
Sat, 21 Feb 2004 01:20:46 +0000 (01:20 +0000)
2004-02-20  Chris Toshok  <toshok@ximian.com>

[ fixes bug #53994 ]

* libebook/e-book-query.c (e_book_query_get_type): new function,
supply e_book_query_copy as the CopyFunc, and e_book_query_unref
as the FreeFunc.
(e_book_query_copy): new function, just convert @q to a string and
reparse it, ala the EVCard copy function.

* libebook/e-book-query.h: add prototypes for
e_book_query_get_type and e_book_query_copy.  also add
E_TYPE_BOOK_QUERY.

* libebook/e-contact.h: add
E_TYPE_CONTACT_{DATE,NAME,PHOTO,CERT,ADDRESS}.

addressbook/ChangeLog
addressbook/libebook/e-book-query.c
addressbook/libebook/e-book-query.h
addressbook/libebook/e-contact.h

index 128c1a0..f3dfe64 100644 (file)
@@ -1,3 +1,20 @@
+2004-02-20  Chris Toshok  <toshok@ximian.com>
+
+       [ fixes bug #53994 ]
+       
+       * libebook/e-book-query.c (e_book_query_get_type): new function,
+       supply e_book_query_copy as the CopyFunc, and e_book_query_unref
+       as the FreeFunc.
+       (e_book_query_copy): new function, just convert @q to a string and
+       reparse it, ala the EVCard copy function.
+
+       * libebook/e-book-query.h: add prototypes for
+       e_book_query_get_type and e_book_query_copy.  also add
+       E_TYPE_BOOK_QUERY.
+
+       * libebook/e-contact.h: add
+       E_TYPE_CONTACT_{DATE,NAME,PHOTO,CERT,ADDRESS}.
+
 2004-02-12  Chris Toshok  <toshok@ximian.com>
 
        * libebook/e-book-listener.c
index c6a6bd4..24ff6b8 100644 (file)
@@ -626,3 +626,25 @@ e_book_query_to_string    (EBookQuery *q)
 
        return g_string_free (str, FALSE);
 }
+
+GType
+e_book_query_get_type (void)
+{
+       static GType type_id = 0;
+
+       if (!type_id)
+               type_id = g_boxed_type_register_static ("EBookQuery",
+                                                       (GBoxedCopyFunc) e_book_query_copy,
+                                                       (GBoxedFreeFunc) e_book_query_unref);
+       return type_id;
+}
+
+EBookQuery*
+e_book_query_copy (EBookQuery *q)
+{
+       char *str = e_book_query_to_string (q);
+       EBookQuery *nq = e_book_query_from_string (str);
+
+       g_free (str);
+       return nq;
+}
index ff3bf2b..3110e52 100644 (file)
@@ -6,6 +6,8 @@
 
 G_BEGIN_DECLS
 
+#define E_TYPE_BOOK_QUERY (e_book_query_get_type ())
+
 typedef struct EBookQuery EBookQuery;
 
 typedef enum {
@@ -44,6 +46,9 @@ EBookQuery* e_book_query_field_test   (EContactField   field,
 /* a special any field contains query */
 EBookQuery* e_book_query_any_field_contains (const char  *value);
 
+GType       e_book_query_get_type (void);
+EBookQuery* e_book_query_copy     (EBookQuery *q);
+
 G_END_DECLS
 
 #endif /* __E_BOOK_QUERY_H__ */
index fc8d26c..0af14b4 100644 (file)
 #define E_IS_CONTACT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), E_TYPE_CONTACT))
 #define E_CONTACT_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), E_TYPE_CONTACT, EContactClass))
 
+#define E_TYPE_CONTACT_DATE       (e_contact_date_get_type ())
+#define E_TYPE_CONTACT_NAME       (e_contact_name_get_type ())
+#define E_TYPE_CONTACT_PHOTO      (e_contact_photo_get_type ())
+#define E_TYPE_CONTACT_CERT       (e_contact_cert_get_type ())
+#define E_TYPE_CONTACT_ADDRESS    (e_contact_address_get_type ())
+
 typedef struct _EContact EContact;
 typedef struct _EContactClass EContactClass;
 typedef struct _EContactPrivate EContactPrivate;