I'm syncing Palm with Evolution. While palm_sync is processing an object
to be synced, it searches the category list of the currently open
database. However, this is not always correct database for the object.
For example: if I have a changed address and multisync is set to sync
all three databases then ToDo database ends up being the last database
open while converting address objects. Hence, palm_sync searches the
ToDo categories instead of Address categories.

I have attached a patch to open the correct database for the object
before converting the object.

Index: palm_sync.c
===================================================================
RCS file: /cvsroot/multisync/multisync/plugins/palm_sync/src/palm_sync.c,v
retrieving revision 1.24.2.3
diff -u -r1.24.2.3 palm_sync.c
--- palm_sync.c	15 Apr 2004 15:46:35 -0000	1.24.2.3
+++ palm_sync.c	29 Aug 2004 14:54:14 -0000
@@ -701,18 +701,6 @@
 	strcpy(database, detectDB(conn, comp));
 	palm_debug(conn, 2, "Detected vcard to belong to %s", database);
 
-	//Convert the vcard to our palm entry
-	if (!strcmp(database, "AddressDB")) {
-		vcard2address(conn, &entry, comp);
-		l = pack_Address(&entry.address, buffer, sizeof(buffer));
-	} else if (!strcmp(database, "DatebookDB")) {
-		vevent2calendar(conn, &entry, comp);
-		l = pack_Appointment(&entry.appointment, buffer, sizeof(buffer));
-	} else {
-		vcal2todo(conn, &entry, comp);
-		l = pack_ToDo(&(entry.todo), buffer, sizeof(buffer));
-	}
-
 	//open the DB
 	ret = openDB(conn, database);
 	if (ret == -2) {
@@ -737,6 +725,18 @@
 		palm_debug(conn, 2, "Created Calendar.");
 	}
 
+	//Convert the vcard to our palm entry
+	if (!strcmp(database, "AddressDB")) {
+		vcard2address(conn, &entry, comp);
+		l = pack_Address(&entry.address, buffer, sizeof(buffer));
+	} else if (!strcmp(database, "DatebookDB")) {
+		vevent2calendar(conn, &entry, comp);
+		l = pack_Appointment(&entry.appointment, buffer, sizeof(buffer));
+	} else {
+		vcal2todo(conn, &entry, comp);
+		l = pack_ToDo(&(entry.todo), buffer, sizeof(buffer));
+	}
+
 	if (uid) {
 		int ret = 0;
 		//Modify a entry

Reply via email to