On Tue, 2 Nov 2010, Patrick Ohly wrote:
Attached is a patch, entirely untested. Should apply to the
SyncEvolution 1.1 source archive [1].
The bad news first:
The patch doesn't work.
If you look deeper into findLocalDataStoreByURI, which calls
findLocalDataStore (both in syncsession.cpp), you'll find a call into
sysync::TSyncDataStore::isDatastore (syncdatastore.cpp:146).
There is a comparison between the target and the name of the data store.
The target is "Contacts", but fName.c_str() gives "addressbook".
I currently don't know, where the fName comes from, it is not the uri
parameter from the configuration.
And now the good ones:
I finally synchronized the addressbook of my phone, but with a view
dirty hacks:
1. I extended the isDatastore function by:
if(!strcmp(fName.c_str(),"addressbook") && !strcmp(aDatastoreURI,"Contacts"))
return 1;
2. TSyncSession::initSync needed also the hack to find the datastore:
if (!fLocalSyncDatastoreP) {
fLocalSyncDatastoreP =
findLocalDataStoreByURI(SessionRelativeURI(aRemoteDatastoreURI),&cgiOptions);
}
I've attached a patch for showing you the changes, but it's not meant to
be used as part of a release.
During the gdb session I've read several times “value optimized out”,
therefore I tried to switch off the optimization of -O2 by resetting the
compilation flags by
SYNTHESIS_CFLAGS=-g CFLAGS=-g ./configure --prefix='/home/knipp/opt'
but instead it needed
CXXFLAGS=-g ./configure --prefix='/home/knipp/opt'
Is SYNTHESIS_CFLAGS used somewhere? The use of CXXFLAGS is clear for C++,
I just oversaw this variable during my first compilation runs.
Which tools/IDE do you use for SyncEvolution development?
Kind regards,
Franz
--
Franz Knipp, Dipl.-Ing.
---------------------------------------------------------------------
[email protected]
+43 660 4859550
https://www.xing.com/profile/Franz_Knipp
---------------------------------------------------------------------
m-otion GmbH
Favoritenstr 4-6/III, 1040 Wien
+43 1 205705 (Fax 99)
---------------------------------------------------------------------
www.m-otion.com
diff -u -r syncevolution-1.1/src/synthesis/src/sysync/syncdatastore.cpp syncevolution-1.1-c510/src/synthesis/src/sysync/syncdatastore.cpp
--- syncevolution-1.1/src/synthesis/src/sysync/syncdatastore.cpp 2010-10-19 15:03:03.000000000 +0200
+++ syncevolution-1.1-c510/src/synthesis/src/sysync/syncdatastore.cpp 2010-11-04 01:47:25.000000000 +0100
@@ -143,6 +143,8 @@
// therefore base identity check on more than simple name match
uInt16 TSyncDataStore::isDatastore(const char *aDatastoreURI)
{
+ if(!strcmp(fName.c_str(),"addressbook") && !strcmp(aDatastoreURI,"Contacts"))
+ return 1;
// base class only implements case insensitive name comparison
return strucmp(fName.c_str(),aDatastoreURI)==0 ? fName.size() : 0;
} // TSyncDataStore::isDatastore
diff -u -r syncevolution-1.1/src/synthesis/src/sysync/syncsession.cpp syncevolution-1.1-c510/src/synthesis/src/sysync/syncsession.cpp
--- syncevolution-1.1/src/synthesis/src/sysync/syncsession.cpp 2010-10-19 15:03:03.000000000 +0200
+++ syncevolution-1.1-c510/src/synthesis/src/sysync/syncsession.cpp 2010-11-04 02:02:17.000000000 +0100
@@ -3625,6 +3625,10 @@
// - search for datastore and obtain possible CGI
fLocalSyncDatastoreP = findLocalDataStoreByURI(SessionRelativeURI(aLocalDatastoreURI),&cgiOptions);
if (!fLocalSyncDatastoreP) {
+ // fallback for Sony Ericsson C510
+ fLocalSyncDatastoreP = findLocalDataStoreByURI(SessionRelativeURI(aRemoteDatastoreURI),&cgiOptions);
+ }
+ if (!fLocalSyncDatastoreP) {
// no such local datastore
return 404;
}
@@ -4790,7 +4794,7 @@
case 204:
case 205:
// Sync resume alert
- case 225:
+ case 225: {
// Synchronisation initialisation alerts
// - test if context is ok
if (fIncomingState!=psta_init && fIncomingState!=psta_initsync) {
@@ -4804,8 +4808,13 @@
return NULL; // no alert sent back
}
// find requested database by URI
+ string target = smlSrcTargLocURIToCharP(aItemP->target); // target as sent from remote
+ if (target.empty()) {
+ // fallback for Sony Ericsson C510
+ target = smlSrcTargLocURIToCharP(aItemP->source);
+ }
datastoreP = findLocalDataStoreByURI(
- smlSrcTargLocURIToCharP(aItemP->target), // target as sent from remote
+ target.c_str(),
&optionsCGI, // options, if any
&identifyingTargetURI // identifying part of URI (CGI removed)
);
@@ -4850,6 +4859,7 @@
aStatusCommand.addItem(itemP); // add it to status
}
break;
+ }
case 224 :
// Suspend alert
SuspendSession(514);
_______________________________________________
SyncEvolution mailing list
[email protected]
http://lists.syncevolution.org/listinfo/syncevolution