Commit graph

5428 commits

Author SHA1 Message Date
Patrick Ohly
a58a7b58f0 testing: fix linked items remove normal test
The hack for the EDS < 3.6 deficiency where EDS adds an EXDATE must not
be used when running a client-test executable compiled for old EDS with
an EDS backend for new EDS. This caused incorrect test failures with
new EDS.

Therefore replace the compile-time check with a runtime check.
2013-11-26 17:03:02 +01:00
Patrick Ohly
06e7d0946f compatibility hack: support libical.so.1
libical 1.0 changed the library name to libical.so.1, causing dependency
problems becaus syncevolution.org binaries required libical.so.0.

It turned out that the relevant parts of the API and ABI had not changed,
so simply allowing both versions of the library is sufficient.

In addition, a detection of libical.so.1 gets added, just in case.
2013-11-26 17:03:02 +01:00
Patrick Ohly
5e46710ea9 logging: hide glib warnings from users
Most glib warnings are too technical for normal users. Better restrict
their logging to "for developers", which keeps them out of stderr of normal
invocations.

Triggered by a new warning showing up with GNOME 3.8 which didn't seem
to cause any problems.
2013-11-26 17:03:02 +01:00
Patrick Ohly
9ad092745d CalDAV: remove dead code
The code wasn't used and incorrectly made it look like SyncEvolution used an
enum which changed its value between libical.so.0 and libical.so.1. Better
remove the code...
2013-11-26 17:03:02 +01:00
Patrick Ohly
47e89b1781 autotools: fix libsynthesis version dependency
Upstream Synthesis source code has increased the major version number.
2013-11-26 17:03:02 +01:00
Patrick Ohly
6a4ab50aee PBAP: add support for obexd 0.48
obexd 0.48 is almost the same as obexd 0.47, except that it dropped
the SetFilter and SetFormat methods in favor of passing a Bluex 5-style
filter parameter to PullAll.

SyncEvolution now supports 4, in words, four different obexd
APIs. Sigh.
2013-11-26 17:03:02 +01:00
Patrick Ohly
05e5911e05 testing: ignore g_socket_accept + cancel leak 2013-10-30 05:13:34 -07:00
Patrick Ohly
02dbb246bf testing: ignore GIO thread leak, variant 2 2013-10-30 05:13:10 -07:00
Patrick Ohly
da4987a1aa NEWS, autotools: SyncEvolution 1.3.99.6 preparations 2013-10-30 11:55:18 +01:00
Patrick Ohly
a102e5c224 testing: ignore getaddrinfo valgrind warning
Found on current Debian Testing.
2013-10-29 13:18:13 +01:00
Patrick Ohly
28a1483b7e PIM: fix compiler warning
Recent gcc complains about redundant local typedef.
2013-10-29 13:18:13 +01:00
Patrick Ohly
700ddd7b41 PIM testing: check behavior with broken pim-manager.ini (FDO #70772)
The PIM Manager should be able to start normally and the default sort
order should be used instead of the invalid one from the config.

Invalid address books are also tested, without checking for any
specific value from GetActiveAddressBooks().
2013-10-29 13:18:13 +01:00
Patrick Ohly
1f8f2d14ea PIM: ignore broken sort order in config (FDO #70772)
Failure to set the sort order from pim-manager.ini should not
prevent the startup of the PIM Manager because the client
cannot really diagnose and fix the problem. It is better
to try again with the default sort order.
2013-10-29 13:18:13 +01:00
Patrick Ohly
0d7ed20931 PIM testing: cover pim-manager.ini handling during SetPeer() (FDO #70772)
The content of pim-manager.ini should be monitored to find issues
like the one reported in FDO #70772. For that particular problem
to appear we also need to use SetActiveAddressBooks().
2013-10-29 13:18:13 +01:00
Patrick Ohly
b1ca48ca0a PIM: fix incorrect write into pim-manager.ini (FDO #70772)
Removing a peer accidentally wrote the updated list of active address
books into the "sort" property of pim-manager.ini, which then
prevented starting the PIM Manager (a different problem which will
be addressed separately).
2013-10-29 13:18:13 +01:00
Patrick Ohly
04879b6026 PIM: explicitly re-calculate pre-computed data on locale change
The normalization of phone numbers depends on the locale. This commit
adds a test for that and code which works without relying on EDS to
re-calculate those normalized numbers.

This is not the normal mode of operation and thus this can't be the
final solution. The right solution would be for EDS to notice the
locale change, re-check all precomputed phone numbers
(X-EVOLUTION-E164 parameter) and emit change notifications. Those then
would get picked up by folks and from there, update the PIM views.

The tests rely on running dbus-session.sh with
DBUS_SESSION_SH_SYSTEM_BUS set.
2013-10-29 13:18:13 +01:00
Patrick Ohly
bbc8816b30 D-Bus testing: allow creating a private system bus
If started with DBUS_SESSION_SH_SYSTEM_BUS non-empty, dbus-session.sh
will create two private buses and use one as the system bus, the other
as session bus.

The purpose is to allow fake daemons on the system bus without having
to modify the clients. At the moment, those clients still need to be
told to contact a fake daemon on the session bus.
2013-10-29 13:18:13 +01:00
Patrick Ohly
08f44ab6bf D-Bus testing: avoid error message when /usr/bin/gnome-keyring-daemon is missing
dbus-session.sh should not try to start /usr/bin/gnome-keyring-daemon
when it is missing or not executable.
2013-10-29 13:18:13 +01:00
Patrick Ohly
73d72502b8 PIM: adapt to locale changes at runtime (FDO #66618)
Listen to signals from localed D-Bus system service and update all
internal state which depends on the current locale. This state includes:
- pre-computed data in all loaded contacts
- filtering (for example, case sensitivity is locale dependent)
- the sort order

In the current implementation, the entire LocaleFactory gets replaced
when the environment changes. The new instance gets installed in
FullView, then the sort comparison gets created anew and the existing
setSortOrder() updates the main view, which includes re-computing all
pre-computed data.

As a last step, the search filter is re-recreated and filtering gets
updated in all active filter views.

There is a minor risk that unnecessary changes get emitted because
first filtered views react to modified contacts and/or reshuffling
them, then later their filter gets replaced.
2013-10-29 13:18:13 +01:00
Patrick Ohly
6285597579 D-Bus server: LocaledListener must not fail without system bus
The listening functionality is meant to be optional, which includes
running inside an environment which doesn't even have a system D-Bus,
like the nightly testing.
2013-10-29 13:08:18 +01:00
Patrick Ohly
76d7af91ce D-Bus server: utility class for localed D-Bus interface
This is the client side for the org.freedesktop.locale1 "Locale"
property. It ensures that new values of that property are made
available locally.

Optionally it can also update the current process' environment and
send a simpler "locale environment changed" if it made some changes.
This needs to be enabled by connecting the setLocale() method to the
m_localeValues signal.
2013-10-29 13:08:04 +01:00
Patrick Ohly
44b31eac29 EDS: disable asynchronous creation of ESourceRegistry
After testing more with EDS 3.8 on Debian Testing, random hangs
were observed inside the glib main loop while waiting for the
registry creation callback. It's uncertain why that happens,
and due to lack of time at the moment it is easier to switch
back to the synchronous method. Needs to be investigated later.
2013-10-29 13:04:44 +01:00
Patrick Ohly
1043dbf9eb PIM: accent-insensitive and transliterated search (FDO #56524)
Accent-insensitive search ignores accents, using the same code as in
EDS.  Transliterated search ignores foreign scripts by transliterating
search term and contact properties to Latin first. That one is using
ICU directly in the same way as EDS, but doesn't use the EDS
ETransliterator class to avoid extra string copying.

This commit changes the default behavior such that searching is by
default most permissive (case- and accent-insensitive, does
transliteration).  Flags exist to restore more restrictive matching.
2013-10-29 13:04:32 +01:00
Patrick Ohly
771ed318eb D-Bus: configure option for overriding default logging
By default, syncevo-dbus-server logs to syslog. This can be changed
with the new parameter of --enable-dbus-service. For example, this
changes the logging to DLT (must be available, or course):
  configure "--enable-dbus-server=--dlt --no-syslog"
2013-10-25 21:07:35 +01:00
Patrick Ohly
e7a8f1b456 logging: support DLT (FDO #66769)
Diagnostic Log and Trace (DLT) manages a sequence of log messages,
with remote controllable level of detail. SyncEvolution optionally
(can be chosen at compile time and again at runtime) uses DLT instead
of its own syncevolution-log.html files.
2013-10-25 21:07:27 +01:00
Patrick Ohly
6e47a118da testing: allow building without client-test
The nightly testing always built client-test. When compiling
for EDS 3.6, we don't actually run any tests on the build platform,
so in that case it was not immediately possible to build client-test
(no cppunit installed). We could build it now, but there's simply
no need for it, so save the time and skip it.
2013-10-25 21:07:26 +01:00
Patrick Ohly
db5f24e10d autotools: fix make error
Adding link flags to the libsyncevlution.la dependencies only works
for .la file. This started to break on Debian Testing (?) because
a -L<something> flag became a dependency.

A proper fix would be to set libs and dependencies separately,
but for now it is easier to rely on GNU make and filter for the
desired .la files.
2013-10-25 21:07:26 +01:00
Patrick Ohly
0a8c8ddb71 autotools: fix packaging of extra backends
They need to be part of the "make install" result for the nightly
testing, and to keep "make distcheck" working we also need to uninstall
them.
2013-10-25 21:07:26 +01:00
Patrick Ohly
317246c352 D-Bus: fix compiler warning
We unintentionally and unnecessarily included boost/signals.hpp instead of
boost/signals2.hpp, which started to trigger warnings with later versions of
boost.
2013-10-25 21:07:26 +01:00
Patrick Ohly
abeefa3a4e EDS: remove redundant libebook-contacts dependency
This fixes compilation with EDS 3.6. libebook-contacts was needed
for a while when configuring address books directly. It is not needed
anymore because now we simply clone the system database.
2013-10-25 21:07:26 +01:00
Patrick Ohly
6c8dc7b194 ActiveSync: don't build Qt UI
The Qt UI no longer works with EDS >= 3.6. We don't need it, so
don't bother with it.
2013-10-25 21:07:26 +01:00
Patrick Ohly
34b0399cd5 autotools: cppunit is optional
The rewrite for non-recursive make made the cppunit utility mandatory.
This is too strict, it really isn't needed when both integration and
unit tests are disabled.

We still want the make variables set, though, if cppunit was found,
because then "make src/client-test" still works.
2013-10-25 21:07:26 +01:00
Patrick Ohly
b3b0f3c7e1 EDS: support dual-install of ebook/ecal backends for EDS < 3.6 and EDS >= 3.6
The backends must be compiled differently for EDS < 3.6 (using the old
API before EBookClient, ECalClient and ESource, ideally in
compatibility mode) and for EDS >= 3.6 (using the new API, with hard
linking against libebook-1.2.so.14, libecal-1.2.so.15,
libedataserver-1.2.so.17).

With these changes, a SyncEvolution binary compiled for the older EDS
API will be able to load and use backends compiled against the current
one. Both backends can be installed in the same
lib/syncevolution/backends dir under different names. The newer ones
must have an additional -<version> appendix before the .so suffix.

Then loading will attempt to use those backends first and if
successful, skip the older ones. This is necessary because loading
both into the same process will fail due to symbol clashes. If
unsuccessful (as on systems with only the older EDS), the dynamic
linker will fail and SyncEvolution proceeds with the backends for the
old API.

Packaging of binaries as .dev/.rpm/.tar.gz includes these additional
backends if given in the EXTRA_BACKENDS variable when invoking "make
deb rpm distbin".
2013-10-25 21:07:26 +01:00
Patrick Ohly
4c962b3c49 EDS: improve EDS compatibility mode
The EDS backends for >= 3.6 failed to work property in SyncEvolution
binaries compiled for EDS < 3.6, because the EDS compatibility
layer reported "EDS not found" to the backend.

A backend that gets compiled without compatibility hacks doesn't
need the runtime check, because merely loading already guarantees
that the necessary libs were found. Therefore make the check
a compile-time define when compatibility mode is disabled.

A backend compiled with compatibility mode enabled then fails to load
in a binary compiled without because libsyncevolution.so does not
export the necessary symbols. That's actually desirable, because the
backend would not work anyway.
2013-10-25 21:07:18 +01:00
Patrick Ohly
7e655089e3 EDS: SYNCEVOLUTION_EBOOK_QUERY env variable
Setting the SYNCEVOLUTION_EBOOK_QUERY env variable to a valid EBook
query string limits the results to contacts matching that
query. Useful only in combination with --print-items or --export. Only
implemented for EDS >= 3.6.
2013-10-24 13:19:31 +01:00
Patrick Ohly
ed1f1f4aa2 PIM: relax phone number matching
Previously, the current default country was used to turn phone numbers
without an explicit country code into full E164 numbers, which then
had to match the search term when doing a caller ID lookup.

This was inconsistent with EDS, where a weaker
EQUALS_NATIONAL_PHONE_NUMBER was done. The difference is that a
comparison between a number with country code matches one without if
the national number of the same, regardless of the current default
country. This is better because it reduces the influence of the hard
to guess default country on matching.

SyncEvolution also differed from EDS by doing a prefix comparison,
which in theory might have also ignored differences caused by
extensions. It is uncertain whether that was useful, so for the sake
of consistency, a full number comparison of the national number is now
done.

Another advantage of this change is the lower memory consumption and
faster comparison, because strings are now stored in 4 + 8 byte
numbers instead of strings of varying length.
2013-10-24 13:19:31 +01:00
Patrick Ohly
c472fd0af6 testing: ignore fontconfig issue
Started to appear on Debian Testing after the Wheezy release.
2013-10-24 13:19:31 +01:00
Patrick Ohly
1260a702f4 glib: prevent accidental usage of PlainGStrArray []
The array operator happens to work on some platforms, but not others
(see previous commit). Make it private without an implementation to
catch the undesired usage of it on platforms whether the code would
happen to work otherwise.
2013-10-18 09:58:28 +02:00
Patrick Ohly
dd61308c67 EDS: fix compile problem with boost and EDS > 3.36
This fixes the following problem, seen with Boost 1.53.0 on altlinux
when compiling for EDS >= 3.6:

/usr/include/boost/smart_ptr/shared_ptr.hpp: In instantiation of 'typename boost::detail::sp_array_access<T>::type boost::shared_ptr<T>::operator[](std::ptrdiff_t) const [with T = char*; typename boost::detail::sp_array_access<T>::type = void; std::ptrdiff_t = long int]':
src/backends/evolution/EvolutionSyncSource.cpp:163:38: required from here
/usr/include/boost/smart_ptr/shared_ptr.hpp:663:22: error: return-statement with a value, in function returning 'void' [-fpermissive]
make[2]: *** [src/backends/evolution/src_backends_evolution_syncecal_la-EvolutionSyncSource.lo]

The "void" type above is wrong, so it looks like a missing type trait
for the pointer type used in the smart_ptr. PlainGStrArray already had
an at() method to work around such issues, so use it. Not sure why this
one usage of [] slipped through.
2013-10-18 09:58:28 +02:00
Patrick Ohly
10de41f262 NEWS: typo fix 2013-10-18 09:58:28 +02:00
Patrick Ohly
5267926a04 autotools, NEWS: SyncEvolution 1.3.99.5 2013-10-01 12:09:18 +02:00
Patrick Ohly
9d1b079750 GTK/GTK3 UI: fix crash on 64 bit
While running a sync with a binary compiled with -fPIE -pie, a crash
in strlen() occured because a 64 bit string pointer coming from D-Bus
was incorrectly passed through a 32 bit unsigned variable.

These special compile flags merely caused the problem to occur
reliably, it may also have crashed under other circumstances.

Kudos to Tino Keitel for reporting the problem and identifying the
relation to the compile flags.
2013-10-01 09:28:39 +02:00
Patrick Ohly
5a0f5a9793 GTK/GTK3 UI: fix crash when a sync runs while no service is selected
Running a sync while the UI had no service selected caused a crash in
find_updated_source_progress() because the code dereferences the NULL
prog_data->data->current_service pointer. Affected both the GTK2 and
GTK3 UI.

Fix it by checking for NULL and not doing anything if NULL.
2013-10-01 09:28:39 +02:00
Patrick Ohly
f9f6eda294 autotools: compile client-test with -g by default
When compiling source files of client-test, use -g as default CXXFLAGS
instead of the "-g -O2" that autotools normally picks.  That speeds up
compilation significantly (on some platforms, gcc can't deal with the
many templates in ClientTest.cpp well) and leads to more useful
executables (suitable for interactive debugging) even when the rest of
the code gets optimized.

Explicitly specifying CXXFLAGS still overrides this per-target
default.

This feature depends on GNU make. A configure check is in place
to disable it when not using GNU make.
2013-10-01 09:28:39 +02:00
Patrick Ohly
9edf97bd2b GNOME: work around GNOME keyring communication problem
It seems that sometimes setting up a session with GNOME keyring fails such
that all further communication leads to decoding problem.

There is an internal method to reset the session, but it cannot be called
directly. As a workaround, fake the death of the GNOME keyring daemon
and thus trigger a reconnect when retrying the GNOME keyring access.
2013-10-01 09:28:39 +02:00
Patrick Ohly
02bd2f3a2d GNOME: clean up keyring access
This drops the support for libgnome-keyring < 2.20, because older
versions did not have the error->text conversion method which is now
used in revised error and log messages.

This code also adds a retry loop around reading/writing passwords.
This was meant to work around these intermittent Gkr errors:

Gkr: received an invalid, unencryptable, or non-utf8 secret
Gkr: call to daemon returned an invalid response: (null).(null)()

These lead to an "Error communicating with gnome-keyring-daemon" status
code from libgnome-keyring.

However, once the error occurred in a process, it persists for at least
two seconds, possibly forever. Therefore the retry loop is not enabled.
2013-10-01 09:28:39 +02:00
Patrick Ohly
5e530e9c54 testing: cover owndrive.com = OwnCloud
This enables interoperability testing with owndrive.com, a hosted OwnCloud
provider. owndrive.com was chosen because a user picked it and support was
able to help with some problems. It's also a bit simpler than running OwnCloud
ourselves. But it may also be slower, so perhaps ultimately a local
installation will be needed.
2013-10-01 09:28:39 +02:00
Patrick Ohly
046d4c31a9 testing: cover Google CardDAV
This adds testing of Google Contacts syncing via CardDAV. It passes
only thanks to the simplified EDS contacts test cases, with one exception:
removing extensions is known to fail because the server keeps them even
when receiving an update without them.
2013-10-01 09:28:39 +02:00
Patrick Ohly
ed19df3c6f WebDAV: support Google CardDAV, break Yahoo
Google CardDAV has one peculiarity: it renames new contacts during PUT without
returning the new path to the client. See also
http://lists.calconnect.org/pipermail/caldeveloper-l/2013-July/000524.html

SyncEvolution already had a workaround for that (PROPGET on old path, extract
new path from response) which happened to work. This workaround was originally
added for Yahoo, which sometimes merges contacts into existing ones. In
contrast to Yahoo, Google really seems to create new items.

Without some server specific hacks, the client cannot tell what happened.
Because Google is currently supported and Yahoo is not, let's change the
hard-coded behavior to "renamed items are new".
2013-10-01 09:28:39 +02:00
Patrick Ohly
bdb0cd195a testing: ignore URL encoding issue in Google CardDAV
Google unnecessarily escapes the colon with a backslash, which
breaks the URL during a full rountrip sync.
2013-10-01 09:28:39 +02:00