Merge tag 'syncevolution-1-3-99-2'

This commit is contained in:
Patrick Ohly 2013-02-26 12:02:16 +01:00
commit 505b2cd63d
5 changed files with 20 additions and 82 deletions

27
NEWS
View file

@ -169,33 +169,6 @@ Details:
are timed separately, with duration printed to stdout. In addition,
tools like "perf" can be started for the duration of one phase.
* SyncML: workarounds for broken peers
Some peers have problems with meta data (CtCap, old Nokia phones) and
the sync mode extensions required for advertising the restart
capability (Oracle Beehive).
Because the problem occurs when SyncEvolution contacts the peers
before it gets the device information from the peer, dynamic rules
based on the peer identifiers cannot be used. Instead the local config
must already disable these extra features in advance.
The "SyncMLVersion" property gets extended for this. Instead of just
"SyncMLVersion = 1.0" (as before) it now becomes possible to say
"SyncMLVersion = 1.0, noctcap, norestart".
"noctcap" disables sending CtCap. "norestart" disables the sync mode
extensions and thus doing multiple sync cycles in the same session
(used between SyncEvolution instances in some cases to get client and
server into sync in one session).
Both keywords are case-insensitive. There's no error checking for
typos, so beware!
The "SyncMLVersion" property was chosen because it was already in use
for configuring SyncML compatibility aspects and adding a new property
would have been harder.
* EDS: fix creating databases
--create-database was broken in combination with the final code in EDS

View file

@ -8,7 +8,7 @@ dnl Invoke autogen.sh to produce a configure script.
#
# Starting with the 1.1 release cycle, the rpm-style
# .99 pseudo-version number is used to mark a pre-release.
AC_INIT([syncevolution], [m4_esyscmd([build/gen-git-version.sh 1.3.99.1])])
AC_INIT([syncevolution], [m4_esyscmd([build/gen-git-version.sh 1.3.99.2])])
# STABLE_VERSION=1.0.1+
AC_SUBST(STABLE_VERSION)

View file

@ -1349,27 +1349,20 @@ static SafeConfigProperty syncPropPeerName("PeerName",
"An arbitrary name for the peer referenced by this config.\n"
"Might be used by a GUI. The command line tool always uses the\n"
"the configuration name.");
static ConfigProperty syncPropSyncMLVersion("SyncMLVersion",
static StringConfigProperty syncPropSyncMLVersion("SyncMLVersion",
"On a client, the latest commonly supported SyncML version \n"
"is used when contacting a server. One of '1.0/1.1/1.2' can\n"
"is used when contacting a server. one of '1.0/1.1/1.2' can\n"
"be used to pick a specific version explicitly.\n"
"\n"
"On a server, this option controls what kind of Server Alerted \n"
"Notification is sent to the client to start a synchronization.\n"
"By default, first the format from 1.2 is tried, then in case \n"
"of failure, the older one from 1.1. 1.2/1.1 can be set\n"
"explicitly, which disables the automatism.\n"
"\n"
"Instead or in adddition to the version, several keywords can\n"
"be set in this property (separated by spaces or commas):\n"
"\n"
"- NOCTCAP = avoid sending CtCap meta information\n"
"- NORESTART = disable the sync mode extension that SyncEvolution\n"
" client and server use to negotiate whether both sides support\n"
" running multiple sync iterations in the same session\n"
"\n"
"Setting these flags should only be necessary as workaround for\n"
"broken peers.\n"
"of failure, the older one from 1.1. 1.2/1.1 can be choosen \n"
"explictely which disables the automatism\n",
"",
"",
Values() +
Aliases("") + Aliases("1.0") + Aliases ("1.1") + Aliases ("1.2")
);
static ConfigProperty syncPropRemoteIdentifier("remoteIdentifier",
@ -1958,29 +1951,8 @@ void SyncConfig::setRemoteIdentifier (const string &value, bool temporarily) { r
InitState<bool> SyncConfig::getPeerIsClient() const { return syncPropPeerIsClient.getPropertyValue(*getNode(syncPropPeerIsClient)); }
void SyncConfig::setPeerIsClient(bool value, bool temporarily) { syncPropPeerIsClient.setProperty(*getNode(syncPropPeerIsClient), value, temporarily); }
InitStateString SyncConfig::getSyncMLVersion() const {
InitState< std::set<std::string> > flags = getSyncMLFlags();
static const char * const versions[] = { "1.2", "1.1", "1.0" };
BOOST_FOREACH (const char *version, versions) {
if (flags.find(version) != flags.end()) {
return InitStateString(version, flags.wasSet());
}
}
return InitStateString("", flags.wasSet());
}
InitState< std::set<std::string> > SyncConfig::getSyncMLFlags() const {
InitStateString value = syncPropSyncMLVersion.getProperty(*getNode(syncPropSyncMLVersion));
std::list<std::string> keywords;
// Work around g++ 4.4 + "array out of bounds" when using is_any_of() on plain string.
static const std::string delim(" ,");
boost::split(keywords, value, boost::is_any_of(delim));
std::set<std::string> flags;
BOOST_FOREACH (std::string &keyword, keywords) {
boost::to_lower(keyword);
flags.insert(keyword);
}
return InitState< std::set<std::string> >(flags, value.wasSet());
}
InitStateString SyncConfig::getSyncMLVersion() const { return syncPropSyncMLVersion.getProperty(*getNode(syncPropSyncMLVersion)); }
void SyncConfig::setSyncMLVersion(const string &value, bool temporarily) { syncPropSyncMLVersion.setProperty(*getNode(syncPropSyncMLVersion), value, temporarily); }
InitStateString SyncConfig::getUserPeerName() const { return syncPropPeerName.getProperty(*getNode(syncPropPeerName)); }
void SyncConfig::setUserPeerName(const InitStateString &name) { syncPropPeerName.setProperty(*getNode(syncPropPeerName), name); }

View file

@ -1507,12 +1507,8 @@ class SyncConfig {
virtual void setRemoteIdentifier (const std::string &value, bool temporaritly = false);
virtual InitState<bool> getPeerIsClient () const;
virtual void setPeerIsClient (bool value, bool temporarily = false);
/** the 1.0/1.1/1.2 part of the SyncMLVersion property */
virtual InitStateString getSyncMLVersion() const;
/** all flags that are set in the SyncMLVersion property, including the 1.0/1.1/1.2 versions */
virtual InitState< std::set<std::string> > getSyncMLFlags() const;
virtual void setSyncMLVersion (const std::string &value, bool temporarily = false);
/**
* An arbitrary name assigned to the peer configuration,

View file

@ -2340,9 +2340,7 @@ void SyncContext::getConfigXML(string &xml, string &configname)
unsigned long hash = 0;
std::set<std::string> flags = getSyncMLFlags();
bool noctcap = flags.find("noctcap") != flags.end();
bool norestart = flags.find("norestart") != flags.end();
const char *noctcap = getenv("SYNCEVOLUTION_NOCTCAP");
const char *sessioninitscript =
" <sessioninitscript><![CDATA[\n"
" // these variables are possibly modified by rule scripts\n"
@ -2402,7 +2400,6 @@ void SyncContext::getConfigXML(string &xml, string &configname)
<<syncMLVersion.c_str()<<"</defaultsyncmlversion>\n";
}
clientorserver << " <syncmodeextensions>" << (norestart ? "no" : "yes" ) << "</syncmodeextensions>\n";
if (noctcap) {
clientorserver << " <showctcapproperties>no</showctcapproperties>\n"
"\n";