Commit graph

2148 commits

Author SHA1 Message Date
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
Patrick Ohly
244bef12b9 file backend: clarified documenation (MB #8146)
The comments for "type" didn't make it clear that the directory
has to be specified as part of the "evolutionsource" property.
2009-12-09 13:24:42 +01:00
Patrick Ohly
ff145efc1c gdbus: fixed g_dbus_create_error_valist() error handling
Out-of-memory errors were not handled correctly:
- The code using realloc() might have leaked a string.
- A static pointer was used to avoid further memory
  allocation errors, but the caller then would have
  freed it => try strdup() and check result in caller
  instead.
2009-12-09 12:19:44 +01:00
Patrick Ohly
3fc19c58d1 exporting of local changes in gdbus
Importing was already possible, improved README about that.
Exporting is added in this commit.
2009-12-09 11:53:02 +01:00
Patrick Ohly
bb8f1ddde4 import-foreign-git.sh: fix when importing with same branch also in remote branches
"git show-ref" printed two hashes, one for the local branch and one
for the remote branch. This broke the rest of the script.  We want
only the local branch hash, which is what the "--heads" option is for.
2009-12-09 11:44:15 +01:00
Zhu, Yongsheng
768b3d9513 DBus Server+logging: getReports for multipeers (MB#8049)
When the config name is "" or "@xxx"(only with context the peer
name is empty), return all reports of different peers in the
specified logdir. They are sorted by their creation time,
which are encoded in their dir names.
Context info is not recorded in the logdir or directory name.
Normally different logdirs are used for different contexts to
distinguish them. If some contexts share the same logdir,
then all sessions are returned if only context is specified no
matter which context the sessions belong to.

The key 'peer' is also stored in every report dictionary sent to
dbus clients. To get it from the dir name, a new method
'getPeerNameFromLogdir' is added in the class 'LogDir'.

Also fix a bug of reports oder. Return reports in descending
order, which means the newest report at first.

Change the unit tests of test-dbus.py for ordering problem
and the peer name is empty. Add some new logging dirs to
test the ordering when the peer name is empty.
2009-12-08 20:49:44 +08:00
Patrick Ohly
bccdf48bcc README: mention libs needed by libsynthesis
Duplicating that information has the advantage that people using
just our configure still find all the necessary information on
one place.
2009-12-08 10:00:22 +01:00
Zhu, Yongsheng
40db68c937 DBus server: add specifiers for progress spinner (MB#2229)
Step information 'waiting' is appended into status for the
progress spinner. The spinner should be disabled unless 'waiting'
is explicitly appended in the status.
'waiting' means the dbus server is blocked and waiting for something,
typically IO events, such as sending data, waiting for response. Once
it is absent from status, the dbus server is done with waiting.

Change corresponding unit tests in the test-dbus.py for statuses
have been changed.
2009-12-08 16:27:28 +08:00
Patrick Ohly
950fa6857e gdbus: allow using private connection
This change was necessary because it turned out that using
g_dbus_setup_bus() and later dbus_g_bus_get() leads to problems
(assertion about watch data on Moblin 2.1, CRITICAL warning
and possibly other issues on Debian Lenny).

It seems that sharing a DBusConnection between different layers on top
of libdbus is either not supported or incorrectly implemented, at
least in glib-dbus.

The problem was found in SyncEvolution when using a libecal/ebook
which call D-Bus under the hood (Moblin Bugzilla #8460). SyncEvolution
has no control over those calls, therefore making the connection used
by the syncevo-dbus-server private was the easier alternative.
2009-12-04 12:47:47 +01:00
Patrick Ohly
ea8229923b command line: support creating new sources (MB #8424)
"syncevolution --configure" works by copying the config with modified
properties set as filters. This did not work for adding sources because
SyncContext::copy() only worked on *existing* sources.

Changed the semantic of the sourceFilter parameter in
SyncContext::copy() so that it specifies *exactly* which sources are
to be copied instead of acting as a filter.

If the given set is a subset of the existing sources, this does not
change anything (SyncContext.cpp dummy.copy(*this, &activeSources)).

If the given set is a superset, then now the additional sources will
be copied where they were ignored before (Cmdline.cpp). There are no
other calls to SyncConfig::copy(), so this change is safe.

Added a new CmdlineTest to cover this situation.
2009-12-03 16:18:45 +01:00
Chen Congwu
7a866c2445 SmartPtr: Fix the leak in assignment operator
in eptr assignment operator, it didn't release the resource it
already holds.
2009-12-03 17:25:16 +08:00
Chen Congwu
802c21f2e7 Revert "ObexTransportAgent: fixing an obex event leak for SyncML server case"
This reverts commit fe124636b3.
Fix the problem in the SmartPtr.
2009-12-03 17:25:16 +08:00
Chen Congwu
43de525ca5 EvolutionBackend: Also accept vcalendar for EvolutionCalendarSource
As phones typically only supports vcalendar 1.0
2009-12-03 17:25:16 +08:00
Patrick Ohly
176a9a1a0d autotools + GTK GUI: added sync-config-widget.c to PO files
sync-config-widget.c contains translations, but wasn't listed
as input file for translation. Found by distcheck.
2009-12-02 18:19:13 +01:00
Patrick Ohly
ca651228bb autotools + D-Bus API: must include the new .xml and .xsl files
Without that, the sync-ui cannot be built from distributed
sources.
2009-12-02 18:11:25 +01:00
Patrick Ohly
0bd22968ec NEWS + configure: SyncEvolution 1.0 alpha 1 snapshot
Also updated section on 0.9.2, needs to be backported.
2009-12-02 17:19:29 +01:00
Jussi Kukkonen
bb06e0ba01 gtk-ui: make sure we only sync once whe nasked
Two bugs fixed here:
1. status handler could potentially be called several times with "idle"
2. the StatusChanged handler did things differently from GetStatus
2009-12-02 17:18:00 +01:00
Patrick Ohly
b132b94402 CheckSource(): did not handle invalid or missing "type" property (MB #8317)
An invalid type (like inactive backend, or something the user
entered into the file manually) raises an exception when accessing
the source parameters. This exception must be caught and transformed
into the SourceUnusable exception expected by D-Bus clients.

An unset type leads to a NULL SyncSource pointer. This was checked,
but without raising an exception. CheckSource() thus incorrectly
reported success.
2009-12-02 15:08:13 +01:00
Jussi Kukkonen
a175f8e43c gtk-ui: use defaultPeer config value on startup
Also remove gconf dependency from client, this was the only yhing
it was used for
2009-12-02 13:57:12 +01:00
Patrick Ohly
3559c1a183 SoupTransportAgent + syncevo-dbus-server: avoid segfault when aborting (MB #8385)
Shutting down a sync session because of user-requested abort does not
cancel pending messages, because that would be allowed to block. Instead
the transport agent is destructed.

The SoupTransportAgent did not cancel the pending message and
therefore callbacks for a stale instance of it were invoked later on
*if* the main loop was activated again. This can only happen in the
syncevo-dbus-server, not the command line.
2009-12-02 11:52:24 +01:00
Patrick Ohly
086308e6ec SoupTransportAgent + syncevo-dbus-server: avoid segfault when aborting (MB #8385)
Shutting down a sync session because of user-requested abort does not
cancel pending messages, because that would be allowed to block. Instead
the transport agent is destructed.

The SoupTransportAgent did not cancel the pending message and
therefore callbacks for a stale instance of it were invoked later on
*if* the main loop was activated again. This can only happen in the
syncevo-dbus-server, not the command line.
2009-12-02 11:49:19 +01:00
Zhu, Yongsheng
108bcf3bf3 DBus server: apply temporary configs (MB#8116)
Apply temporary configs when calling other APIs
of sessions. This makes configs that users temporarily
set affect other APIs.

All sources filters in m_sourceFilters must be set
to config not only for existing sources in config but also
for non-existing sources. This could help users temporarily
do some operations without flushing any configs.

Currently affected APIs are Session.CheckSource,
Session.GetDatabases, Session.GetConfig, Session.Sync.

Also add 3 unit tests for CheckSource, GetDatabases
and GetConfig to test the temporary config is in
effect for them. They all are passed.
2009-12-02 15:42:50 +08:00
Zhu, Yongsheng
65d40441df SyncConfig: return sources in shared, peer and filters for getSyncSources
'getSyncSources' of SyncConfig only returns shared sources
in shared layout and peer sources in other layouts.
Peer sources must also be included in shared layout. Moreover,
new sources in sources filters should be taken into consideration.
It should return an union of:
1. contextpath/sources
2. peers/[one-peer]/sources
3. sources in sources filter
2009-12-02 15:39:56 +08:00
Zhu, Yongsheng
732bd2d586 DBus testing: add unit tests for status and progress
Implement 3 unit tests for status and 1 unit test for
progress. For status,
1) test a full status list when a sync is executed
This is checked in TestSessionAPIsReal.testSync
2) test status when session is aborted
3) test status when session is suspended
For progress, test progress number is increasing
when a sync is executed. Also combine this check in
TestSessionAPIsReal.testSync

It is necessary to specify own signal receivers in
subclasses of DBusUtil to let them add new operations.
Two methods "progressChanged" and "statusChanged" are
added in DBusUtil. They are called when handling
statusChanged and progressChanged signals in setUpListeners.
By checking progress in "progressChanged", we can
make sure that aborting or suspending takes place when
sync is running.
2009-12-02 15:17:22 +08:00
Zhu, Yongsheng
d7d67621a9 DBus server: only flush status when changed for SESSION_END
SESSION_END always flushes status no matter whether
there is any change of status. It will duplicate
status and send them to dbus clients.
Only send StatusChanged signal when there is a change
of status.

This problem was found by the unit test which will
check any two adjacent statuses should not be the same.
2009-12-02 15:17:15 +08:00
Zhu, Yongsheng
bb2b35b4c1 DBus server: set 'running' status in Session.run
The status 'SYNC_RUNNING' should be set firstly
in Session.run instead of setting it when
SESSION_START event is reported. This could mislead
dbus clients.
2009-12-02 14:42:52 +08:00
Zhu, Yongsheng
2cfd2fa52d DBus testing: remove one obsolete unit test for GetReports
One unit test for GetReports is dependent on a real
sync. Since a new full test by reference directory tree
is enabled, this unit test is removed.
2009-12-02 14:42:52 +08:00
Patrick Ohly
5b72993ad0 autotools + deb: removed dependency on doc_pak
That was left over from before the introduction of our
docdir usage inside "make install". doc_pak is gone now.
2009-12-01 22:03:07 +01:00
Patrick Ohly
210a2656f7 nightly testing: git fetch fixes
Instead of fetching a specific repo, use just "git fetch" to
pull updates into an existing repo. Specifying the repo
should have worked, but apparently is not done correctly (not
yet?) by the git in Debian Stable.

Using "git fetch" assumes that the URL of the repo does not
change between updates. That should be the case for us.
2009-12-01 21:45:34 +01:00
tester
2d0da511f0 test/runtest.py: git checkout debugging
Added both 'set -x' and 'git show-ref' to get more information
because it seems that sometimes the latest source is not checked
out.
2009-12-01 21:45:34 +01:00
Chen Congwu
d24433e06d Testing: result check
Do not grep 'valgrind' because 'valgrind' is not guranteed to run
2009-12-01 21:45:34 +01:00
Chen Congwu
ed099f8413 Testing: A special case set has slightly differnt case name 2009-12-01 21:45:34 +01:00
Chen Congwu
40470e6ec6 Testing Result Check: check "okay" instead of "fail" because of possible crash
Now the check criteria is:
"sourcename::casename: okay \*\*\*"
if the string is not present, the test result will be failed.
2009-12-01 21:45:34 +01:00
Chen Congwu
9391fcdca9 Testing result checker: change the result checker grep criteria
The grep criteria to check the test result did not work for tests with
 combined source.
2009-12-01 21:45:34 +01:00
Patrick Ohly
70329670bf runtests.py: run setup command twice, just to be sure
In a setup where it was run inside schroot we got error
messages from schroot because gconfd got stuck and prevented
a clean unmount of /tmp. Even "kill -9" wouldn't get rid of
such a hanging gconfd.

As a workaround, running the setup command twice seems to
succeed, including getting rid of the handing gconfd.
2009-12-01 21:45:34 +01:00
Chen Congwu
41d312c6f2 Testing: fix some issues for prebuilt test
1) use string.partiton instead of split
2) change to a proper dir if srcdir is not existed
2009-12-01 21:45:34 +01:00
Zhu, Yongsheng
ca5a4d76f4 Testing: clean log/test files before a new testing
Previously do cleanup operation after implementing
a syncevolution setup. But if this setup raises
exceptions, we might get incorrect test results.
so clean all these files before doing any other
preparations
2009-12-01 21:45:34 +01:00
Chen Congwu
f76c20fa78 Testing: show evolution-prebuilt in html output(bug#7160)
Generate <source> tests for evolution and evolution-prebuilt;
Do not generate client test template until a <sync> tests is existed.
2009-12-01 21:45:33 +01:00
Zhu, Yongsheng
7b79d80ebd Testing: show evolution-prebuilt in html output(bug#7160)
move 'evolution-prebuilt' summary from interoperability test
to client::source. Write xml and xsl codes to generate
html output to show its testing results.
2009-12-01 21:45:33 +01:00
Patrick Ohly
653c1986b9 runtest.py: fixed checking out branch from git
Checking out a branch which only exists remotely requires
a bit more work. Checking out tags might also have failed
due to an unnecessary "git pull". Now "git tag" and "git branch"
are used to check what the requested revision is and do the
necessary opertions.
2009-12-01 21:45:33 +01:00
Patrick Ohly
8e6bfc24e5 runtest.py: point prebuilt binaries to correct location of backends
The "prebuilt" test ran, but because it used the build directory
of the current platform it didn't find any backends, or the wrong
ones. Fixed by only using the backend setting from the previous
testing if the directory really exists and falling back to the
relative "backends" directory otherwise.

It might be possible to always use "backends". In order to not
change the running testing this wasn't done.
2009-12-01 21:45:33 +01:00