[Commits] dbus-contact.h 1.1 1.2 server-object.c 1.3 1.4

miras at claws-mail.org miras at claws-mail.org
Tue Nov 29 08:53:29 CET 2011


Update of /home/claws-mail/contacts/src/dbus
In directory claws-mail:/tmp/cvs-serv18713/src/dbus

Modified Files:
	dbus-contact.h server-object.c 
Log Message:
2011-11-29 [mir]	0.6.0cvs31

	* src/utils.c
	* src/dbus/dbus-contact.h
	* src/dbus/server-object.c
	    Upgrade dbus part to handle attrib_def structure. 

Index: server-object.c
===================================================================
RCS file: /home/claws-mail/contacts/src/dbus/server-object.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- server-object.c	4 Oct 2011 20:21:40 -0000	1.3
+++ server-object.c	29 Nov 2011 07:53:27 -0000	1.4
@@ -227,8 +227,8 @@
     array = g_ptr_array_new();
     
     if (contact->data) {
-        firstname = g_hash_table_lookup(contact->data, "first-name");
-        lastname = g_hash_table_lookup(contact->data, "last-name");
+        extract_data(contact->data, "first-name", (gpointer) &firstname);
+        extract_data(contact->data, "last-name", (gpointer) &lastname);
     }
     
     for (cur= contact->emails; cur; cur = g_slist_next(cur)) {
@@ -332,14 +332,21 @@
 }
 
 static void contact_data_save(DBusContact* dbus_contact, Contact* contact) {
+    GHashTableIter iter;
+    gpointer key, value;
+    
     if (! dbus_contact || ! contact)
         return;
         
 	if (dbus_contact->emails) {
         g_ptr_array_foreach(dbus_contact->emails, email_ptr_foreach, contact);
     }
-    if (dbus_contact->data)
-        contact->data = hash_table_copy(dbus_contact->data);
+    if (dbus_contact->data) {
+        g_hash_table_iter_init (&iter, dbus_contact->data);
+        while (g_hash_table_iter_next (&iter, &key, &value)) {
+            swap_data(contact->data, key, value);
+        }        
+    }
 }
 
 /**
@@ -594,7 +601,8 @@
     gboolean found_book = FALSE;
     gchar** reply;
     
-    g_message("Receive 'search' request\nToken: %s\nBook: %s", token, book);
+    g_message("Receive 'search' request\nToken: %s\nBook: %s\n",
+        token, (book) ? book : "Non selected");
 
     if (!token) {
         if (error) {

Index: dbus-contact.h
===================================================================
RCS file: /home/claws-mail/contacts/src/dbus/dbus-contact.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- dbus-contact.h	7 Sep 2011 17:35:29 -0000	1.1
+++ dbus-contact.h	29 Nov 2011 07:53:27 -0000	1.2
@@ -42,6 +42,8 @@
 	
 G_BEGIN_DECLS
 
+#include "plugin.h"
+
 typedef struct {
 	GHashTable* data;
 	GPtrArray*	emails; /* array of struct Email */



More information about the Commits mailing list