Commit graph

2138 commits

Author SHA1 Message Date
Zhu, Yongsheng
5a49d6dd24 DBus server: implement info request for password (MB#6376)
Send info request when dbus server can't get password and have to
dbus clients' assistant.
2009-12-25 13:08:12 +08:00
Zhu, Yongsheng
6e9b26a212 DBus server: implement InfoRequest and InfoResponse (MB#6376)
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.
2009-12-25 13:08:12 +08:00
Zhu, Yongsheng
1d309f51af DBus server: add source status and progress for restore (MB#8144)
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.
2009-12-25 09:42:06 +08:00
Zhu, Yongsheng
419199562f Testing: change an issue of restore tests (MB#8144)
"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".
2009-12-25 09:42:06 +08:00
Chen Congwu
25a525adb1 ObexTransportAgent: fix typos 2009-12-24 12:10:22 +08:00
Chen Congwu
93fbb09b49 ObexTransportAgent: signal handling bug fixed.
Fixed some signal handling problems:
1) Save the underlying resource before calling cancel() avoiding a segfault.
2) Abort directly without sending the Disconnect cmd.
2009-12-24 10:58:39 +08:00
Chen Congwu
53a92ac50b ObexTransport: Do not fail directly if SIGINT is caught by underlying select.
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.
2009-12-24 10:58:39 +08:00
Chen Congwu
19d32c41c4 AutoConf: Bluetooth transport build option
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.
2009-12-24 10:58:38 +08:00
Chen Congwu
f5ea99d2f1 ObexTransportAgent: block while waiting for mainloop events 2009-12-24 10:58:38 +08:00
Jussi Kukkonen
3b73cb1c6d gtk-ui: init sync time to -1 ("not known") 2009-12-22 10:35:52 +02:00
Zhu, Yongsheng
4cf3d3256d Testing: add 2 test cases for Session.Restore(MB#8144)
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.
2009-12-22 10:55:58 +08:00
Zhu, Yongsheng
26c9d79700 DBus server: add 'Session.Restore' (MB#8144)
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.
2009-12-22 10:55:58 +08:00
Zhu, Yongsheng
155edfdaf8 DBus server: add 'dir' key in the reports (MB#8144)
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.
2009-12-22 10:55:58 +08:00
Zhu, Yongsheng
02f9ca171e DBus server: add 'peer' in BNF for GetReports(MB#8049)
For MB#8049, an additional key 'peer' is added in the dict.
Add it in the BNF in the dbus api document.
2009-12-22 10:55:58 +08:00
Chen Congwu
37a3176c7f ClientTest: set config.uri to "" instead of null.
Will crash client-test in gcc 4.3
2009-12-22 09:51:42 +08:00
Chen Congwu
116cba1c37 Revert "Synthesis Configuration: add remote rule for Nokia 7210c"
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
2009-12-21 14:56:59 +08:00
Chen Congwu
10748e3b47 Testing+Nokia_7210c: fix a typo 2009-12-21 13:15:19 +08:00
Patrick Ohly
3ec722e185 ClientTest::getTestData(): avoid dangling pointer to "ical20_utc"
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.
2009-12-18 10:47:29 +01:00
Patrick Ohly
4f48f025e7 SyncReport: record initial error (MB #7708)
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.
2009-12-18 10:46:30 +01:00
Patrick Ohly
5b498331ad SyncContext::sync(): fixed potential incorrect memory access
"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.
2009-12-18 10:46:30 +01:00
Chen Congwu
115f5b21b8 Force slowsync in synthesis engine
Server alerted sync does not respect "slowsync" in the spec, however we can
still implement this by forcing the engine switch to "slowsync".
2009-12-17 10:18:25 +08:00
Chen Congwu
426526e496 ClientTest: enabling the test with virtual syncsource
Virtual syncsource should be viewed as a single source by the synccontext while
as a list of sub datasources for the LocalTest.
2009-12-17 10:18:18 +08:00
Chen Congwu
36b76a6edd Super datastore consolidation: only expose the super datasource to user
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.
2009-12-17 09:46:36 +08:00
Chen Congwu
59dd0e2393 SAN generation: always use basetype unless being forced (MB#8496)
As phones typically only support basetype and may fail to respond if using the
advanced types.
2009-12-17 09:46:36 +08:00
Chen Congwu
17a6cc4f3c SyncCompare+Nokia 7210c readme 2009-12-17 09:46:36 +08:00
Chen Congwu
8c135180fe ClientTest: Add a new test config for phones do not support UTC time.
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.
2009-12-17 09:46:36 +08:00
Chen Congwu
a4be5577b0 ClientTest+doVarSize: use slow sync instead of refresh sync
If refresh sync is not supported by peer, we can still make the test via
slowsync.
2009-12-17 09:46:36 +08:00
Chen Congwu
e1ab662c32 SyncSourceAdmin: do not flush mapping table if never loaded
For local test scenarios, it is possible the mapping table is never loaded but
flushed during endSession, this will empty the mapping file uncontentionaly.
2009-12-17 09:46:35 +08:00
Chen Congwu
ecfc190c15 Synthesis Configuration: add remote rule for Nokia 7210c
It handles UTC time but does not claim in the devInfo.
Some fileld has limited lengh but does not claim.
2009-12-17 09:46:35 +08:00
Chen Congwu
c91ad3f107 synthesis config: add "STATUS" property to "VEVENT" profile.
This is stated by the spec (both vcalendar and icalendar).
2009-12-17 09:46:35 +08:00
Chen Congwu
26dd2851fd ClientTest: Fix a typo in testTwinning
Should be a slowsync not two-way sync
2009-12-17 09:46:35 +08:00
Chen Congwu
db7c36e8b6 ClientTest: "CLENT_TEST_NOCHECK_SYNCSTATS" disable checking sync statictics.
At this time, synthesis server could not dispatch the signal so that sync
statistics for server can not be gathered.
2009-12-17 09:46:35 +08:00
Chen Congwu
fac80c4041 ClientTest: enabling super datastore testing
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.
2009-12-16 14:55:27 +08:00
Chen Congwu
40ff364402 ClientTest: server mode adptions
Add CLIENT_TEST_MODE=server for a server test scenario.
2009-12-16 14:47:45 +08:00
Jussi Kukkonen
6825fea099 gtk-ui: do not localize empty ("") name (MB#8618)
When new service is created, do not localize the empty name string
2009-12-15 18:21:41 +01:00
Jussi Kukkonen
618379247f gtk-ui: recognise "peer" report item 2009-12-15 18:21:41 +01:00
Jussi Kukkonen
4c9db1da9a gtk-ui: use template name for configurations (MB#8350)
configuration names have become lowercase: use a matching template
name in the UI if we have one, for better visual appearance.
2009-12-15 18:21:41 +01:00
Jussi Kukkonen
1d8faa22e7 gtk-ui: set new service name before updating ui 2009-12-15 18:21:41 +01:00
Jussi Kukkonen
9f635a4318 dbus wrapper: fix bug in source hashtable names
also add a helper function for mode handling
2009-12-15 18:21:40 +01:00
Jussi Kukkonen
961217fb8d gtk-ui: close settings ui when new service is selected 2009-12-15 18:21:40 +01:00
Jussi Kukkonen
51d8344ac9 gtk-ui: remove unused functions 2009-12-15 18:21:40 +01:00
Jussi Kukkonen
8bed4f519a gtk-ui: improve report handling
Errors are now shown, and the report data is parsed correctly.
There are still things to do here, but that'll wait for server fixes...
2009-12-15 18:21:40 +01:00
Franz Knipp
44fd818721 XMLRPC backend
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.
2009-12-15 15:12:13 +01:00
Zhu, Yongsheng
1dd1323f39 DBus server: implement keyring support in dbus server (MB#3602)
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.
2009-12-14 15:18:24 +08:00
Patrick Ohly
f73c895b65 README.funambol: added comment about TRIGGER start times (MB #7656, #7806)
A relative TRIGGER time in a VALARM is replaced by a fixed time on
the Funambol server.
2009-12-10 13:47:21 +01:00
Zhu, Yongsheng
6b29ee538d ZYB: list in sync UI (MB#2424)
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.
2009-12-10 13:05:02 +01:00
Chen Congwu
a7dc264445 SyncSource luid-guid mapping: luid is not unique, can not be used as key.
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).
2009-12-10 17:15:18 +08:00
Patrick Ohly
92bb59e138 Merge branch 'syncevolution-0-9-branch'
Conflicts:
	src/backends/file/FileSyncSourceRegister.cpp

Conflict because of the "text/x-vcalendar" renaming on
master.
2009-12-09 16:53:51 +01:00
Patrick Ohly
598a304b37 EDS Calendar: set pointer to NULL to protect against ecal bug (MB #8005)
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...".
2009-12-09 16:46:07 +01:00
Patrick Ohly
8f1dd1ba95 autotools: cleaned up checking for GNOME/EDS libs (MB #8338)
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.
2009-12-09 16:24:08 +01:00