diff options
author | Patrick Ohly <patrick.ohly@intel.com> | 2011-04-20 12:20:06 +0200 |
---|---|---|
committer | Patrick Ohly <patrick.ohly@intel.com> | 2011-04-20 12:20:06 +0200 |
commit | 878fc9221232e8ce2efa09fb0543c377e4787c0e (patch) | |
tree | 09415af9371ccd835269ab3ba7b299b4c1ed0704 | |
parent | 398dbd1a4f1712dcea12f90fc6a9737fdf8845c2 (diff) |
MAKE/PARSETEXTWITHPROFILE(): support recursive <include rule>libsynthesis_3.4.0.16+syncevolution-1-1-99-4
The code added in commit e8b3e088fdc894cade81472412817c01c7cef57f
only acticated sub-rules directly included by the rule specified
as parameter of MAKE/PARSETEXTWITHPROFILE().
With this patch, TMimeDirProfileHandler::activateRemoteRule()
activates sub-rules recursively. As before the settings of
a rule are activated before activating sub-rules, so they
may overwrite their parent's settings again.
Because setRemoteRule/activateRemoteRule() are only used
by scripts, syncing is not affected by this change. I haven't
checked whether recursive inclusion is handled there.
-rw-r--r-- | src/sysync/mimedirprofile.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/sysync/mimedirprofile.cpp b/src/sysync/mimedirprofile.cpp index 2c92532..27b1abb 100644 --- a/src/sysync/mimedirprofile.cpp +++ b/src/sysync/mimedirprofile.cpp @@ -5381,10 +5381,6 @@ void TMimeDirProfileHandler::setRemoteRule(const string &aRemoteRuleName) // only this rule and all rules included by it rule must be active fActiveRemoteRules.clear(); activateRemoteRule(*pos); - TRemoteRulesList::iterator spos; - for(spos=(*pos)->fSubRulesList.begin();spos!=(*pos)->fSubRulesList.end();spos++) { - activateRemoteRule(*spos); - } break; } } @@ -5422,6 +5418,12 @@ void TMimeDirProfileHandler::activateRemoteRule(TRemoteRuleConfig *aRuleP) // Note: this is not a single option because we had this before rule options were tristates. //if (aRuleP->fForceUTC>0) fRemoteCanHandleUTC=true; //if (aRuleP->fForceLocaltime>0) fRemoteCanHandleUTC=false; + + // now recursively activate included rules + TRemoteRulesList::iterator pos; + for(pos=aRuleP->fSubRulesList.begin();pos!=aRuleP->fSubRulesList.end();pos++) { + activateRemoteRule(*pos); + } } // check if given rule (by name, or if aRuleName=NULL by rule pointer) is active |