command line: allow temporary configs in import/export operations

Temporary source properties are needed when the config does not
exist. This patch sets them before creating source nodes and
documents this behavior.
This commit is contained in:
Patrick Ohly 2010-06-23 10:04:49 +02:00
parent 96e71bdbb5
commit 3db8fc1eac
2 changed files with 14 additions and 0 deletions

View File

@ -241,6 +241,15 @@ with additional options. <luid> here is the unique local identifier
assigned to each item in the source, transformed so that it contains
only alphanumeric characters, dash and underscore.
<config> and <source> must be given, but they do not have to refer to
existing configurations. In that case, the desired backend and must be
give via "--source-property type=<backend>", like this::
syncevolution --print-items --source-property type=evolution-contacts dummy-config dummy-source
The desired backend database can be chosen via "--source-property
evolutionsource".
--print-items shows all existing items using one line per item using
the format "<luid>[: <short description>]". Whether the description
is available depends on the backend and the kind of data that it

View File

@ -729,6 +729,11 @@ bool Cmdline::run() {
boost::shared_ptr<SyncContext> context;
context.reset(createSyncClient());
context->setOutput(&m_out);
// apply filters
context->setConfigFilter(true, "", m_syncProps);
context->setConfigFilter(false, "", m_sourceProps);
string sourceName = *m_sources.begin();
SyncSourceNodes sourceNodes = context->getSyncSourceNodesNoTracking(sourceName);
SyncSourceParams params(sourceName, sourceNodes);