Commit graph

168 commits

Author SHA1 Message Date
Patrick Ohly b1f7f781e8 command line: fixed error handling for invalid property assignments
xyz=1 triggered an error message with (null) inside instead of a
property name. The name is prominently given in the assignment
parameter, so just drop the explicit property name.

=1 triggered an error message with two single quotes instead of
one (because args are already passed with quotation marks) and then
crashed because of a missing return.

Also added unit tests...
2012-04-11 12:54:43 +02:00
Patrick Ohly 7f3dfc4241 command line: cleaned up output
The user-visible part of this change is that command line output now
uses the same [ERROR/INFO] prefixes like the rest of SyncEvolution,
instead of "Error:". Several messages were split into [ERROR] and
[INFO] parts on seperate lines. Multi-line messages with such a prefix
now have the prefix at the start of each line. Full sentences start
with captital letters.

All usage errors related to the synopsis of the command line now
include the synopsis, without the detailed documentation of all
options. Some of those errors dumped the full documentation, which was
way too much information and pushed the actual synopsis off the
screen. Some other errors did not include usage information at all.

All output still goes to stdout, stderr is not used at all. Should be
changed in a seperate patch, because currently error messages during
operations like "--export -" get mixed with the result of the
operation.

Technically the output handling was simplified. All output is printed
via the logging system, instead of using a mixture of logging and
streaming into std::cout. The advantage is that it will be easier to
redirect all regular output inside the syncevo-dbus-helper to the
parent. In particular, the following code could be removed:
- the somewhat hacky std::streambuf->logging bridge code (CmdlineStreamBuf)
- SyncContext set/getOutput()
- ostream constructor parameters for Cmdline and derived classes

The new code uses SE_LOG_SHOW() to produce output without prefix. Each
call ends at the next line, regardless whether the string ends in a
newline or not. The LoggerStdout was adapted to behave according to
that expectation, and it inserts the line prefix at the start of each
line - probably didn't matter before, because hardly any (no?!)
message had line breaks.

Because of this implicit newline in the logging code, some newlines
become redundant; SE_LOG_SHOW("") is used to insert an empty line
where needed. Calls to the logging system are minimized if possible by
assembling output in buffers first, to reduce overhead and to adhere
to the "one call per message" guideline.

Testing was adapted accordingly. It's a bit stricter now, too, because
it checks the entire error output instead of just the last line. The
previous use of Cmdline ostreams to capture output from the class was
replaced with loggers which hook into the logging system while the
test runs and store the output. Same with SyncContext testing.

Conflicts:

	src/dbus/server/cmdline-wrapper.h
2012-04-11 12:54:28 +02:00
Patrick Ohly bd2eb7387f SyncContext + ConfigUserInterface: code refactoring
All user-facing functions (password handling, reading from
stdin) are now in a dedicated "UserInterface" class, instead of
spreading that between ConfigUserInterface and SyncContext.

SyncContext no longer has the misleading "is a" [Config]UserInterface]
relationship. Instead it "has a" UserInterface instance, which is set
at runtime. Long term the plan is remove the need to subclass
SyncContext. In the local sync that was already possible
(LocalTransportContext->LocalTransportUI).

The guarantee that there always is a usable instance that can be used
without checking for NULL is provided by the getUserInterfaceNonNull()
method, which falls back to a dummy instance if necessary.

Reading data and password from stdin is moved out of the core
libsyncevolution into the syncevolution binary. That way the D-Bus
server and client-test do not accidentally attempt to read from stdin
(has happened when setting up testing incorrectly).
2012-03-09 07:25:11 +00:00
Patrick Ohly 12334eb676 SyncSource: remove special RegisterSyncSource::InactiveSource pointer
The special semantic of the former RegisterSyncSource::InactiveSource
(invalid pointer of value 1) caused bugs, like using it in
--print-databases (=> segfault) or not being able to store the result
of a createSource() directly in a smart pointer (=> potential leak in
SyncSource::createSource()).

Obviously a bad idea to start with. Replaced with a
RegisterSyncSource::InactiveSource() method which creates a real,
inactive SyncSource instance which can and must be deleted by the
caller.

This is a SyncSource API change for backend developers.
Instead of RegisterSyncSource::InactiveSource, return
RegisterSyncSource::InactiveSource().

Comparisons against RegisterSyncSource::InactiveSource needs
to be replaced with a call to the new SyncSource::isInactive().

User visible fixes:
* --print-databases: no longer crashes when EDS or KDE backends
  are not usable. Instead it prints "not enabled during compilation or
  not usable in the current environment".
* --print-databases: continues with other backends even if
  one backend throws an exception, as the KDE backend does
  when it cannot find Akonadi. Error messages are printed.
2012-03-09 07:25:11 +00:00
Patrick Ohly eafc49cb35 KDE + GNOME: moved keyring/kwallet and KDE init into modules
The platform specific code which is of no value unless you run a
specific desktop now gets compiled as part of shared libraries, just
like the storage backends. The advantage is that the rest of
SyncEvolution keeps running even if one of these shared libraries
cannot be loaded due to missing depdendencies. syncevolution.org
packages will not declared these dependencies, to allow installing
each package without forcing the installation of unwanted libraries.
Distros can package the platform code separately.

Another advantage is reduced code duplication (password load/store
was duplicated in command line and D-Bus server).

Technically this uses almost the same mechnism as loadable sync
sources. The code resides in src/backends/[kde|gnome], where the
autotool magic finds the *Register.cpp files automatically and
includes them into executables. These files contain global singletons
which, when initialized, connect platform specific code to new signals
in the core (init, password load/save).

The actual code is in the backend libraries. Because
SE_ARG_ENABLE_BACKEND() is not used (in favor of the traditional
enable macros), linking against these libs must be set up by adding
them to the (now slightly misnamed) SYNCSOURCES variable in the
configure fragments.
2012-03-09 07:24:59 +00:00
Patrick Ohly b5410acbd9 SyncSource: rewrote callback handling for operations
A few operations had a callback registration mechanism, but not
all. For testing multi-cycle syncing and injecting concurrent changes
while a sync runs it is necessary to add code for several more
operations (begin data read, add/modify/delete item).

Instead of adding more custom code, this commit replaces the
home-grown callback lists with a boost::function wrapper which
contains pre- and post-signals based on boost::signals2.

Also simplifies the Synthesis DB Plugin implementation by moving the
common code (null check, exception handling) into the wrapper.

This removed the LOCERR_OK return code from some plugin
implementations (end data read, start data write). Implementations
returning LOCERR_OK must be provided by the SyncSource. Done by
SyncSourceSession (used by TrackingSyncSource) automatically.
2012-03-06 14:03:22 +01:00
Patrick Ohly cd7cc5e7bc testing: added activesyncd compilation + coverage
activesyncd gets compiled completely (which should always succeed) and
then only the required pieces are installed (without the things which
are hard-coded for /usr, because installing those will fail).

Testing is done by running a similar set of client-test tests as for remove
CalDAV/CardDAV servers.

activesyncd is started anew each time client-test is run, done in
the new wrappercheck.sh script. Can be combined with valgrindcheck.sh:
wrappercheck.sh valgrindcheck.sh activesyncd -- valgrindcheck.sh client-test ...

The return code of wrappercheck.sh is the return code of the real command
or the daemon, if the real command succeeded. This way the special 100 return
code from valgrindcheck.sh is returned if the only problems were memory
issues.
2011-12-08 13:59:32 +00:00
Patrick Ohly 0f1bed33fe command line: config and source names are optional (BMC #23783)
The need to add "foo" and "bar" pseudo config and source names to the
command line even when all parameters for the operation where
explicitly specified on the command line was confusing.

Now it is possible to invoke item operations without the config and
source name. Names which refer to non-existent configs are still
accepted, as in previous releases. Typos are handled better by
producing a detailed error report which includes (as applicable):
- config doesn't exist
- source doesn't exist or not selected
- backend property not set

This error report is created only if SyncSource was unable to create a
SyncSource, which is detected by catching the status exception with
the right error code. Trying to anticipate the error at the Cmdline
level would duplicate code found in the SyncSource and/or impose
limitations which might not hold in all cases.

Because luids used to be positional arguments after <config> and
<source>, a new --luids keyword is necessary to indicate that the
following parameters are luids and not <config> and <source>.

Added a CmdlineTest::testItemOperations for this new command line
syntax. It uses the file backend to run some real operations (missing
earlier).

Error reporting in the command line uses the same mix of writing error
messages and returning early (Cmdline) and throwing exceptions (rest
of SyncEvolution). Perhaps the Cmdline class should also use
exceptions - but not now.
2011-11-28 10:18:19 +01:00
Patrick Ohly 00de4dfa87 config: return value + "was set" for each config property
At the property level, the isDefault retval exposed whether the
property value was set explicitly in the config or taken from the
property default. That information got lost at the
SyncConfig/SyncSourceConfig level although there are cases where that
is relevant (like providing better error messages, BMC #23783).

Now that level uses the new InitState classes instead of plain
int/bool/std::string return values. Code which assigns these return
values to local variables doesn't need to be adapted. Directly using
the return value in an expression might need some work (typically
adding a get() if the compiler cannot infer the desired
type). Overriding the virtual methods always needs to be adapted.
2011-11-28 10:18:19 +01:00
Patrick Ohly 4fc6c3e2c4 Merge remote-tracking branch 'origin/syncevolution-1-2-branch'
Conflicts:
	configure.ac
	src/syncevo-dbus-server.cpp
	src/syncevo/Cmdline.cpp
	test/ClientTest.cpp
	test/ClientTest.h
	test/generate-html.xsl
	test/runtests.py

Conflicts caused by backporting + merging back slightly modified
backports.
2011-11-28 10:16:57 +01:00
Patrick Ohly 220d60caae GTK UI + config: fix "custom server" setup (BMC #13511)
When the "default" config template (= ScheduleWorld) was downgraded to
"not consumer ready" in SyncEvolution 1.1.0.99.1, setting up a custom
SyncML service in the GTK UI stopped working because the UI wouldn't
show the "not consumer ready" config.

Fixed by changing the "default" config:
- always has ConsumerReady = 1
- PeerName empty
- based on SyncEvolution server template (not essential,
  but has saner, minimal settings for all sources and
  will make it easier to remove the ScheduleWorld template)

It is uncertain why the initial bug report says that the failure is
random and why Jussi was unable to reproduce the problem. The problem
describe above is deterministic. So perhaps there is also another,
related issue.
2011-11-18 15:15:36 +00:00
Patrick Ohly 5c27f81d5f testing: adapted Cmdline tests to revised config descriptions
Formatting was changed and a new warning was inserte for "sync".
(cherry picked from commit bb222f236a)
2011-11-18 15:15:35 +00:00
Patrick Ohly 8c89db5b0f sync modes: added refresh/one-way-from-local/remote (BMC #23537)
The -from-client/server sync modes are confusing because the direction
of the data exchange depends on which side acts as SyncML server or
client.

This patch introduces new modes which use -from-local/remote
instead. The statistics and messages also use these variants now. The
old modes are still understood, but are declared as "not recommended"
in the documentation.
2011-11-04 11:05:20 +01:00
Patrick Ohly bb222f236a testing: adapted Cmdline tests to revised config descriptions
Formatting was changed and a new warning was inserte for "sync".
2011-10-26 07:13:16 +00:00
Patrick Ohly 850243fc1a testing: fixed memory access problem in --print-database tests
The boost::tokenizer uses iterators into the std::string. That string
must exist as long as the tokenizer is in use.
2011-10-25 15:25:09 +00:00
Patrick Ohly 4db59035f3 Merge branch 'syncevolution-1-2-branch'
Conflicts:
	Makefile.am

Conflict due to $(AM_V_GEN) introduced as part of non-recursive
Automake.
2011-10-24 20:11:08 +02:00
Patrick Ohly 13b89e2224 documentation: added glossary and command line conventions sections, improved listing of properties
The README.rst now introduces some terms in a glossary directly after
the synopsis. The way how config, sources and properties are used on
the command line are also defined first in their own section, instead
of introducing that further down as part of the options.

The output of "--sync/source-property ?" was changed:
- now it includes information about aliases, default values
  and sharing state (useful by itself)
- follows reStructured Text format and thus can be embedded
  directly inside the README.rst

The Makefile rules for that will be committed in the next patch
(must be done differently on syncevolution-1-2 and master branch,
whereas this commit applies cleanly to both).
2011-10-24 20:04:36 +02:00
Patrick Ohly bf6bab8f03 command line: introduced --print-databases
Listing databases is now a dedicated operation, instead of being done
whenever syncevolution was invoked without parameters.

Advantages:
- can be combined with property assignments for backends
  which do not work without that additional information
- can be done for configured sources
2011-10-17 13:17:41 +02:00
Patrick Ohly a7f7c8eacf Merge remote branch 'origin/syncevolution-1-2-branch'
Conflicts:
	configure.ac
	test/ClientTest.cpp
	test/testcases/eds_event.ics.funambol.tem.patch

Conflicts because of version number and updated test cases resp. local
delete optimization.

ActiveSync backend had to be adapted to modified InsertItemResult: now
it requests a merge when it detects duplicates, like the CalDAV backend
already did on the 1.2 branch.
2011-10-17 13:16:33 +02:00
Patrick Ohly 0b8a15362f command line: also check password for --import/export/delete-items and the source (BMC #21311, #22937)
The previous commit 7411f7e had the password check in the code branch
for --print-items. --import/export/delete-items still had the same
problem. Moved the code.

Source passwords must also be checked, in case that "backendPassword"
is set. Added.
2011-09-14 15:07:31 +02:00
Chris Kühl 966b29ff26 syncevo: Clean up namespace pollution.
Removed all the "using namespace std;" statements from the header
files and made corrosponding changes. Where needed added "using
namespace std;" statement to the implementation files.
2011-08-26 12:52:15 +02:00
Patrick Ohly a8effb21b8 config migration: avoid name conflicts and auto syncing of old configs (BMC #22691)
When (auto-)migrating a config, it was possible that a name for the
peer, say foo.old, was chosen for the renamed config although there
was already such a config, for example foo.old in ~/.sync4j. Besides
being confusing for users, this also led to a bug in the code where it
copied from the older config with the foo.old name.

Found when adding unit testing of migrating configs with auto syncing,
because then the content of the migrated config mattered.

The main problem fixed in this commit is the disabling of auto syncing
in the old config. Done similar to ConsumerRead, by reading/writing
the .ini (resp. .txt) file directly.
2011-08-19 16:19:12 +02:00
Salvatore Iovene 7411f7e8e3 Fixes BMC#21311 - item operations: authentication problem for WebDAV when using keyring
Use checkPassword() before trying to --print-items. This will either
prompt for the password at command line, or ask it from the keyring
if --keyring is specified (or if using the dbus server).
2011-08-05 14:37:41 +02:00
Salvatore Iovene 10418e133a Cmdline.cpp: we don't need *both* gnome-keyring and kwallet to store the pwd. 2011-08-05 14:37:41 +02:00
Patrick Ohly 84eb04d291 config templates: added IconURI to all templates (BMC #20750)
Most of the selected theme icons don't exist, so adding these values
only provides the possibility to add icons later on.

For Google Contacts, the existing gmail icon is used as a short-term
solution until the theme gets a proper google-contacts icon.
2011-07-12 18:30:02 +02:00
Patrick Ohly 3d20ede9a6 templates: added generic WebDAV template
In contrast to the Yahoo template, this one doesn't mention
a specific service and enables both contact and calendar sync.
To be used with a service that supports auto-discovery.
2011-07-06 19:47:07 +02:00
Patrick Ohly 8032247a5a local sync: renamed "source-config" to "target-config"
As discussed on the mailing list, "source-config" is ambiguous because
the "addressbook/calendar/..." configs are also called "source
configs".

Now the naming is "sync" config (for the config with syncURL=local://,
because it is used for syncing) and "target" config (because it is
used as target in a sync config's syncURL).

Rejected:
"local" config - because the databases are not necessarily local
"source" config - see above
"client" or "server" config - because both sides might use local data
                              and/or client/server could refer to the role
                              of the peer or the SyncML client/server model
                              used internally
2011-06-28 18:42:43 -07:00
Patrick Ohly 34e6667e14 templates: Add PeerName field, part II
The Funambol template hadn't been updated and the command line
tests failed because the didn't expect the PeerName to be set.

The normalization of "= F" to "= 0" broke the "= Funambol" peer name.
Doesn't seem to server any useful purpose anymore, so removed.
2011-06-28 18:38:38 -07:00
Patrick Ohly 528f8ef5a8 WebDAV templates: avoid complete data dump
Each sync involving WebDAV did a complete data dump (dumpData) and
showed differences (printChanges) for the WebDAV side of the sync.
This could be used to restore the WebDAV server after a sync, but it
seems a bit excessive and not useful for most users because the same
is also done on the local side of the sync.

Therefore this patch sets these two options to off in the
configuration templates.
2011-06-24 17:09:18 +02:00
Patrick Ohly aa7321e6b4 Google template: fixed Cmdline test
Adding the IconURI broke the SyncEvo::CmdlineTest::testPrintFileTemplates test.
Test had to be adapted to the modified template content.
2011-06-24 17:09:17 +02:00
Patrick Ohly 10109fd208 WebDAV + command line: simplify creation of source-config@yahoo|google-calendar
This patch teaches the command line how to infer the right template
for a source-config@<something> config creation:
   syncevolution --configure source-config@google-calendar

For this particular example, "google-calendar" must match the "Google
Calendar" fingerprint in the template. Spaces, hyphen and underscores
are now all considered equal in TemplateConfig::fingerprintMatch().

Also added CmdlineTest::testWebDAV unit test. The test can only run if
WebDAV support is enabled, because otherwise the
backend=CardDAV/CalDAV would be rejected.
2011-06-08 12:19:51 +02:00
Patrick Ohly 33f0c9c3f6 WebDAV: added templates for Yahoo and Google
This patch introduces the new "peerType" property which marks
templates and configs as something that can be used for the
'source-config@<target>' configs necessary for local sync.

Only "WebDAV" is used. If peerType is not set, the template or config
is traditional SyncML.

This patch also adds two templates, one for Google Calendar and one
for Yahoo CardDAV and CalDAV. Because Yahoo CardDAV is unreliable,
it is not enabled.
2011-06-08 12:19:51 +02:00
Patrick Ohly bfb7a85f84 configuration: removed builtin templates
The code for builtin templates had side effects, like always adding
all four standard sources to a template, even if the template itself
didn't have all of them defined. It also hid the problem that listing
templates didn't work for templates on disk.

Another benefit is that template files can be packaged separately. By
choosing the packages which are to be installed, a distributor of
SyncEvolution (like MeeGo) can choose which services to offer by
default.

Therefore this patch removes the "builtin templates" feature, which
was only useful in unusual use cases anyway (for example, single-binary
distribution).

Because there are no more default values for source properties, all
templates must specify the "backend" explicitly. syncevo-phone-config
was adapted accordingly, and also updated to use the current names of
the properties in the process.

As part of moving the templates into separate files, some of them
were cleaned up:
- Mobical: now points to Everdroid, its new name
- Google, Ovi: SSL verification is always enabled in the templates;
               the workaround for old libsoup should no longer be
               necessary for most users
- Google: renamed to "Google_Contacts", with "Google" as alias,
          because there will be two Google templates soon
- Scheduleworld: use "server no longer in operation" instead of
                 an invalid URL

The finger print match had a special case for "default". The exact
intention of that is unknown. Perhaps it was meant to give that
template a boost when it wouldn't match the string that is getting
searched for at all.

But it had the effect that an exact match when searching for the
"default" template was not found and thus that template couldn't be
used in the command line after moving it from builtin to external.

Removed the complete check.
2011-06-08 12:19:51 +02:00
Patrick Ohly c72ca29f5c Cmdline: better error reporting when unit tests fail
Better check error message before return code. That way
a non-zero error is visible in the output instead of
only the failed run check.

Calling doit() would be shorter, but hide the actual location
of the failure.
2011-06-08 12:19:51 +02:00
Patrick Ohly f04988de68 Cmdline: cleaned up unit testing
Moved removal and creation of the test directory (= "CmdlineTest")
into the test setup method. That way all tests are guaranteed to
start in a clean state, without having to duplicate that all over
the place.

Motivated by the observation that at least one test didn't have the
necessary cleanup, which caused a failure when creating more
templates.
2011-06-08 12:19:51 +02:00
Patrick Ohly fa237c72cd templates: listing templates only showed builtin templates
"syncevolution --templates ?" only showed builtin templates
because the scanning for template on disk was called without
any match definition => empty results, only builtin templates
used as fallback.
2011-05-18 10:04:49 +02:00
Patrick Ohly b6861ed768 nightly testing: renamed ical20/itodo20/vcard30/text, removed vcard21 from Evolution backend (BMC #14972)
The distinction between vcard21 and vcard30 became mute in the Evolution
backend a while ago. Both tests ended up using the vCard 3.0 Evolution
tests data and the default uri for each server. This patch removes
the vCard 2.1 special case.

It also renames the tests and test data to reflect that they always
were Evolution specific. The new naming convention, also applied
to file, QtContacts, KCalExtended, XMLRPC, Maemo and Akonadi backends, is
now <backend>_contact/event/task/memo, with eds/file/qt/kcal/maemo/kde
as backend names.

The reasoning is:
- results in unique string (in particular no overlap with
  backend type names), easier to search for
- underscore already used before (in contrast to hyphen)
- no plural-s to keep the name shorter

The Akonadi backend should be using its own test data instead of
the Evolution ones.
2011-05-05 20:15:55 +08:00
Patrick Ohly d2e70d93e5 command line: an invalid --template parameter did not always trigger an error
Specifying an invalid template name continued with an empty template
if enough properties were specified. That's not correct and leads
to unexpected results:
- peerIsClient might have been part of the desired template.
- Set of sources to be created is defined by template.

Now an error is printed for this case.
2011-04-20 22:11:36 +02:00
Patrick Ohly 98c98fa29a command line: avoid spaces in the handles of template names
The device templates contained spaces ("Nokia N900", for example),
which was hard to use on the command line and in scripts. Now
an underscore is used instead of spaces.
2011-04-20 18:15:07 +02:00
Patrick Ohly 118662a301 WebDAV: always register our special property
This is a better fix for the webDAVCredentialsOkay property
registration: always do it, regardless whether the backend is enabled,
because then the config migration code will always know about it.

Also fixed automated testing to include that property.
2011-04-20 18:13:16 +02:00
Patrick Ohly 87b4a063a3 command line: better error message when checking sources, avoid "list"
The command line instantiated sources with the name "list" (cut-and-paste
error?) instead of using the proper name. As a result, error messages
created by these sources didn't refer back to the configuration. Now
the real name is used.
2011-04-19 13:48:13 +02:00
Patrick Ohly bb5c1ac39b SyncSource config: grant sources read/write access to context
The intention always was that backends may add their own
properties. For sync properties this seemed less relevant,
so sources only got read access to it.

But the WebDAV backends run with their own "source-config" context
and now need read/write access to store information that is
shared between all sources.

Therefore this patch removes the "const" qualifier from SyncConfig.
2011-04-15 13:26:55 +02:00
Patrick Ohly 31e286059b eGroupware: added template (BMC #15992)
The problem with eGroupware is that it doesn't have one fixed syncURL.
Users of the template must remember to change it. To make this more
obvious, it is set to http://set.your.domain.here/rpc.php

The failure to fix the URL is leading to fairly obvious network
errors.

Various people have reported success with eGroupware, the latest
one here: http://www.ruinelli.ch/how-to-sync-egroupware-with-a-tablet-n900-with-syncevolution
Therefore it makes sense to also mark this template as "consumerReady"
and have it shown in the sync UI.
2011-04-15 08:15:19 +02:00
Dinesh ab25aef728 command line + syncevo-dbus-server: added support for KWallet
Currently not enabled in compilation by default. If KWallet support is
enabled, it will check whether KDE is running and otherwise fall back
to GNOME keyring.
2011-04-13 10:34:13 +02:00
Patrick Ohly 21dd62cd71 command line: relaxed checking of config creation (BMC #14805)
SyncEvolution used to insist on having a template when creating a
config from scratch. This was meant to address typos like "--configure
sheduleworld".  But when the command line contains enough information,
no template is needed.

The same logic was applied to configuring a source: if a source was not
among those defined by the template, configuring it was rejected as a
typo.

With this patch, there are two ways around these checks:
- --template none and/or
- specifying required properties on the command line

This patch also removes the special cases for "your SyncML server
account name/password". Username/password aren't always needed
(previous patch), nor are they always for a SyncML server anymore.
2011-03-23 12:14:31 +01:00
Patrick Ohly 21084cb470 command line: fix issue with configuring a peer multiple times
This patch fixes a problem that occured if:
* a peer was configured with a ifferently named template (--configure --template foo bar)
* and there was a config foo@xyz.

Then the nonsense error message "ERROR: template foo must not specify a context."
was printed (nonsense because "foo" does not specify a context) and the operation
failed.

The root cause was that SyncConfig::normalizeConfigString() expanded
the "foo" string to "foo@xyz" (desired when "foo" is a shorthand for
an existing config). This behavior now can be turned off with a
flag. The patch does that by replacing the bool parameter with a bit
field.
2011-03-02 11:20:27 +01:00
Patrick Ohly da7f503bee Memotoo: use vCard 3.0
When SyncEvolution prefers vCard 3.0, additional properties like
NICKNAME work with Memotoo. This patch a) makes that the default
syncFormat in the Memotoo template and b) automatically sets it
in the "addressbook" source of all migrated configs which sync
with Memotoo (detected based on the syncURL).

The automatic config rewriting is possible because users upgrading
from the previous stable SyncEvolution release need to migrate their
configs anyway. Normally SyncEvolution does not modify configs like
this.
2011-03-02 11:05:18 +01:00
Patrick Ohly ed64a3f067 config migration: handle inconsistent old config (type mismatch!)
If the context "type" was wrong and only the peer "type" was right,
the old config was usable for syncing. It seems that the "Memotoo"
template created such broken configs. After migration, the wrong
backend was selected based on the context's broken "type", thus
breaking syncing.

This patch fixes that problem by overriding the context "type" with
the corresponding values from one peer which has the source enabled.
The rationale is that this peer used to work and should be kept
working.

There's still a chance that different peers had different backends
configured, which is neither checked nor detected at the moment.
2011-02-14 14:39:58 +01:00
Patrick Ohly 720a194e66 command line: fixed printing of sources (BMC #13301)
After the removal of the "type" property, listing of sources broke
because the command kind code kept setting that to select a backend.
Fixed by parsing the type and setting "backend" and "databaseFormat"
instead.
2011-02-08 09:46:58 +01:00
Patrick Ohly cf23b4e912 command line: --sync/source-property keyword optional
Just saying "foo = bar" is enough now. --sync-property and
--source-property are still accepted, in case that "foo" ever becomes
ambiguous (not the case right now).
2011-02-03 14:05:16 +01:00