On Mo, 2011-06-20 at 20:20 +0100, Patrick Ohly wrote:
> Verified with debugging output. I've not looked into setfieldoptions()
> for the exact logic which enables the field.
> 
> This has the effect that my X-FOOBAR-EXTENSION and X-TEST extensions
> (stored locally in XPROPS) are not getting preserved when importing the
> updated contact from Google.
> 
> What would be a proper fix for this?

I've come to the conclusion that wildcard properties should not be
marked as "available" by default. With the following commit I get what I
need, is this the right approach?


commit 92d2f367e72eccedb2cd1e103ec7770b6a426ef2
Author: Patrick Ohly <patrick.o...@intel.com>
Date:   Tue Jun 21 09:35:49 2011 +0200

    engine: updated implementation of "unprocessed" wildcard properties
    
    The 3529d3cb commit which introduced support for "unprocessed" wildcard
    properties added the logic that such properties are always considered
    "available" regardless of the actual CtCap of the peer.
    
    This has the undesirable effect that the content of these properties
    are removed when receiving an update from a peer which doesn't
    support them.
    
    Therefore this commit reverts that part of 3529d3cb: setfieldoptions()
    with NULL as first parameter now only enables mandatory properties,
    as it did before the introduction of "unprocessed" properties.
    
    "unprocessed" properties need to be listed explicitly in the CtCap
    like any other property. This is currently untested.

diff --git a/src/sysync/mimedirprofile.cpp b/src/sysync/mimedirprofile.cpp
index 27b1abb..4105d03 100644
--- a/src/sysync/mimedirprofile.cpp
+++ b/src/sysync/mimedirprofile.cpp
@@ -5139,7 +5139,7 @@ bool 
TMimeDirProfileHandler::analyzeCTCap(SmlDevInfCTCapPtr_t aCTCapP, TSyncItem
       for (sInt16 i=0; i<itemTypeP->fFieldDefinitionsP->numFields(); i++) {
         itemTypeP->getFieldOptions(i)->available=false;
       }
-      // force mandatory+unprocessed properties to be always "available"
+      // force mandatory properties to be always "available"
       setfieldoptions(NULL,fProfileDefinitionP,itemTypeP);
     }
     // now we have received fields
@@ -5174,9 +5174,9 @@ bool TMimeDirProfileHandler::setLevelOptions(const char 
*aLevelName, bool aEnabl
 
 
 // enable fields related to aPropP property in profiles recursively
-// or (if aPropP is NULL), enable fields of all mandatory (or wildcard) 
properties
+// or (if aPropP is NULL), enable fields of all mandatory properties
 void TMimeDirProfileHandler::setfieldoptions(
-  const SmlDevInfCTDataPtr_t aPropP, // property to enable fields for, NULL if 
all mandatory+unprocessed properties 
+  const SmlDevInfCTDataPtr_t aPropP, // property to enable fields for, NULL if 
all mandatory properties should be en
   const TProfileDefinition *aProfileP,
   TMimeDirItemType *aItemTypeP
 )
@@ -5233,7 +5233,7 @@ void TMimeDirProfileHandler::setfieldoptions(
   while (propdefP) {
     // compare
     if (
-      (propname==NULL && (propdefP->mandatory || propdefP->unprocessed)) ||
+      (propname==NULL && propdefP->mandatory) ||
       (propname && (strucmp(propname,TCFG_CSTR(propdefP->propname))==0))
     ) {
       // match (or enabling mandatory) -> enable all fields that are related 
to this property

-- 
Best Regards

Patrick Ohly
Senior Software Engineer

Intel GmbH
Open Source Technology Center               
Pützstr. 5                              Phone: +49-228-2493652
53129 Bonn
Germany


_______________________________________________
os-libsynthesis mailing list
os-libsynthesis@synthesis.ch
http://lists.synthesis.ch/mailman/listinfo/os-libsynthesis

Reply via email to