Implement the info exchange mechanism when the dbus server wants
any information that only dbus clients can provide.
The dbus server uses the class 'InfoReq' to handle the requested
information from it and get response from dbus clients. The main
processing logic is referred to dbus api document.
To allow multiple info requests, the DBusServer uses a map to manage
all pending info requests and dispatches responses to the corresponding
info request. Also DBusServer.createInfoReq() is provided to create
info requests.
For InfoRequest callers, A series of methods in 'InfoReq' are provided:
check - check whether the required response is gotten
cancel - cancel the info request
wait - wait until timeout, abort or suspend
getResponse - get the response result provided by dbus clients.
All methods here are asynchronous except 'wait', which waits for
response explicitly.
Generate and send source statuses and progress to dbus clients.
For source modes in statuses, 'restore-from-backup' is sent once
a source is restored. For progress, the granularity is source level.
Thus, the progress is simply calculated based on the number of
sources and how many of them that have been completed.
To report source status and progress, SyncContext::restore
should have a mechanism to give out events to dbus server.
Here 'displaySourceProgress' is re-used. Some synthesis events are
simulated in restore. To follow up the way of 'displaySourceProgress',
a pseudo mode 'SYNC_RESTORE_FROM_BACKUP' is defined for source sync
mode. This is treated as a special sync mode only for restore from
backup.
Also add test code in testRestoreByRef to check source
status and progress.
"setupFiles" should be called firstly before others, for
it will clean up xdg_root directory. Thus 'setupConfigs'
won't take effect for its flushed results will be wiped
out by "setupFiles".
Fixed some signal handling problems:
1) Save the underlying resource before calling cancel() avoiding a segfault.
2) Abort directly without sending the Disconnect cmd.
The underlying openobex library will fail directly during select() if SIGINT is
delivered. Since we already handle SIGINT in application layer, do not fail in
the transport layer.
Checking SoupTransportAgent and CurlTransportAgent both have same mechanism
built in the library layer.
Added --enable-bluetooth let the user explictly enable bluetooth, in this case
the configure process will fail if the dependent library is not installed.
If the option is not set, bluetooth is enabled by default anyway; however if
user don't have necessary library installed it will not attemt to built with
bluetooth support.
Added a summary to display whether the bluetooth support is enabled.
2 test cases are added to test Session.Restore.
1) testRestoreByRef: test restore with the data before
and after a given session
2) testSecondRestore: test restore with an inactive
session. The right error should be thrown.
Restore is an API to let dbus clients to restore to a specified
state from before or after the selected synchronization.
Session.Restore is an asynchronized API and status signal
'done' is to show that an actual restore process is completed.
The real restore operation is running scheduled by dbus server
after the Session.Restore calling.
Session.run is reused to handle 'Sync' and 'Restore'. To
distinguish them, an enum value is selected.
Progress related info has not been available yet.
The 'dir' key is stored in each report for GetReports.
It will save the full directory and be transferred to
dbus clients.
The root cause is to give an ID to dbus clients and the
ID is used to identify the report, in the Session.Restore.
This reverts commit ecfc190c15.
The added propery 'TZ' depends on remote rule 'N7210c' only in server
mode, in client mode this will make syntheis parser unhappy.
see MB#7712
const char * type = (string (type) + "_noutc").c_str()
keeps a pointer to a temporary std::string instance. That
memory might be deallocted when the pointer is used later.
We could have used
type = "ical20_noutc";
but I preferred to adapt the "if" clauses instead. That way we
might also introduce a "itodo20_noutc" later on.
The current use of recording the initial error ever printed during a
sync session is that it can be repeated at the end of the
"syncevolution" command line output or when printing sessions.
Initially the error is set to "synchronization process died prematurely".
Seeing that error in a session status.ini means that the report
wasn't updated because SyncContext::sync() never completed properly -
or is still running.
This patch also adds reseting of m_status in SyncReport::clear(),
which seemed to be missing.
"SyncReport buffer" was used as storage for later printing of the
report at the end of sync(). However, its scope ended earlier than
that. If the struct hadn't been entirely on the stack, we would have
had a problem.
With everything allocated on the stack, this wasn't a problem until I
added a std::string (next commit). Then it accessed a deconstructed
string => segfault.
sub datasources referenced by a super datastore will not be visible to user for
sync. The 'sync' and 'URI' properties is not set and will use the value set
in the super datastore.
The 'type' propery will be checked for consistency (values in sub datasoruce and
super datsource should be the same), if failed a warning will be generated and
continue the sync with the type specified by the super datasource.
Phones may not fully support UTC time. As the case for Nokia 7210c, it can
understand the UTC time sent by server but will not convert it back to UTC time
when sending back to server.
Use 'CLIENT_TEST_NOUTC' to use this special test configuration.
For local test scenarios, it is possible the mapping table is never loaded but
flushed during endSession, this will empty the mapping file uncontentionaly.
Enabling only the super datastore to SyncContext.
Avoid changing the databaseid automatically for super source as it has special
meaning.
There are a later commit fixing the LocalTest problem for super datastore.
The XMLRPC backend allows to connect to a webmail or PIM application by
means of XMLRPC, to use the application as data store for syncevolution.
It depends on the xmlrpc-c library.
The unit test part is not finished and left as copied from the file
backend for later completion.
The copyright is waived as documented in the files.
Use gnome-keyring to store and retrieve passwords in dbus server
by default when dbus server is compiled with gnome-keyring library.
For storing passwords, if failed in gnome-keyring, an error will
be thrown, which aborts flushing properties.
For retrieving passwords, firstly find them in the gnome-keyring.
If it is not found, dbus server then send InfoRequest signal to
dbus clients to ask for passwords. See MB#6376.
Set the "consumerReady" flag for the ZYB service, so now
it is going to be listed in the sync UI. Also set 'calendar'
as 'disabled' for offical announcement says it won't be
supported.
According to synthesis, mapentries have type (TMapEntryType), for a server side
implementation, it is possible to have multiple mapentries with the same localid
and differeciated by entry type (such as tempidmap and pendingmap).
e_cal_get_object() seems to run into situations where it neither sets
the "comp" pointer nor returns an error. SyncEvolution was using an
uninitialized pointer in that case. Set the "comp" pointer to NULL
to detect this kind of failure => "ERROR retrieving item...".
The EDS backend was asking for glib support even when it was not
active. In combination with not linking against the right libs
in that case there was a link failure because g_thread_init()
and g_type_init() were not found.
When the EDS backend was active, this wasn't a problem because
the necessary libs were linked indirectly.
This patch reduces the number of libs that are checked and used
when not enabling the EDS backend. This is done by resetting
the ECAL/EBOOK flags when inactive and only asking for glib
when active.
It also fixes the checking and linking against gobject and gthread
in the case that glib support is requested.