Commit graph

18 commits

Author SHA1 Message Date
Patrick Ohly
e3266d04e8 autotools: fixed UI translation
The old ui.glade was still being referenced by the list of translatable
files. The corresponding files from the GTK3 version were missing.

automake doesn't seem to handle conditional _DATA files correctly. In contrast
to source files, they end up not being distributed when disabled. To solve
this, src/gtk*-ui/gtk-ui.am must be included unconditionally in src.am and
contain unconditional EXTRA_DIST entries for the two ui.xml files.
2012-03-30 07:31:59 +00:00
Jussi Kukkonen
f1454948b8 gtk-ui: fork gtk3-version of the ui
We want to support both GTK+-2.0 and GTK+-3.0 for the time being
(even if the former is just maintenance). This is not possible in
the same codebase without large amounts of ifdefs so we fork the UI.
2012-03-27 15:30:20 +02:00
Patrick Ohly
eafc49cb35 KDE + GNOME: moved keyring/kwallet and KDE init into modules
The platform specific code which is of no value unless you run a
specific desktop now gets compiled as part of shared libraries, just
like the storage backends. The advantage is that the rest of
SyncEvolution keeps running even if one of these shared libraries
cannot be loaded due to missing depdendencies. syncevolution.org
packages will not declared these dependencies, to allow installing
each package without forcing the installation of unwanted libraries.
Distros can package the platform code separately.

Another advantage is reduced code duplication (password load/store
was duplicated in command line and D-Bus server).

Technically this uses almost the same mechnism as loadable sync
sources. The code resides in src/backends/[kde|gnome], where the
autotool magic finds the *Register.cpp files automatically and
includes them into executables. These files contain global singletons
which, when initialized, connect platform specific code to new signals
in the core (init, password load/save).

The actual code is in the backend libraries. Because
SE_ARG_ENABLE_BACKEND() is not used (in favor of the traditional
enable macros), linking against these libs must be set up by adding
them to the (now slightly misnamed) SYNCSOURCES variable in the
configure fragments.
2012-03-09 07:24:59 +00:00
Patrick Ohly
8602d3d216 autotools: compile GDBus before libsyncevolution
libsyncevolution depends on GDBus, which therefore must be dealt
with first.

Mostly the dependencies take care of the right compilation order.
Installing the results is different, items of the same kind are
installed in the order in which they are added to their variables,
which in turn is defined by the order in which .am files are
included.

That broke when making libgdbussyncevo a normal lib like
libsyncevolution (see next commit).
2012-02-15 14:22:59 +00:00
Patrick Ohly
4928d51eca Akonadi: fixed compile and runtime issues
Due to bitrot the Akonadi backend and KWallet support code no longer
worked. Moved the common code for KApplication initialization into
libsyncevolution's SyncContext::initMain() and fixed autotools rules.

The old code always tried to contact an X server (default constructor
of KApplication). That doesn't seem to be necessary and is avoided now.
Even better might be to skip KApplication entirely and instead use
QCoreApplication and KComponentData, as suggested by
http://api.kde.org/4.x-api/kdelibs-apidocs/kdeui/html/classKApplication.html

KAboutData was incorrectly passed the address of a string pointer, not
the pointer itself.

Testing the Akonadi backend in client-test failed because client-test
always overwrites the "backend" value with
"Test_kde_[contact/event/..]._[1/2]". Now this special case is
detected. The backend then uses the first resp. second resource that
it finds.
2012-02-01 15:28:00 +00:00
Patrick Ohly
55bd5f73db local sync: execute 'syncevo-local-sync' on child side, communicate via D-Bus
Instead of forking and continuing to sync in the forked process
without an explicit exec(), exec() the 'syncevo-local-sync' helper in
the forked process. The syncevo-local-sync helper binary gets
installed into libexec. SYNCEVOLUTION_LIBEXEC_DIR must be set if that
helper is not installed yet, not in the PATH, or an old version would
be found without that env variable ("make" without "make install"
during development!).

Main advantage is the cleaner environment for running the child side
of local sync. Required for getting ActiveSync to work again (GDBus
GIO as used by recent activesyncd client libraries did not work in the
forked process without the exec()).

Full D-Bus communication gets established between parent and child.
The downside is the hard dependency of local sync on the D-Bus
libraries (not the daemon!).

D-Bus communication allowed implementing interactive password requests
from the child side through the parent to the UI using the parent,
something that wasn't implemented before.

The child asks its parent for the password, which in turn
passes the request to its SyncContext. This happens to work
when that SyncContext is a normal instance (reads from stdin,
the "syncevolution --daemon" case) and the syncevo-dbus-server
(sends out an Info Request signal and waits for a response).

The info request and response are handled in the blocking
askPassword() by polling the running mail loop, so the parent should
remain responsive. Overall it is still a pretty difficult setup; it
would be better if askPassword() was asynchronous.

Describing the required password also is sub-optimal: the sync-ui just
asks for a password in its current config (even though that might not
be the config which currently gets synced) and crashes if no config is
currently selected. The command line uses the description derived from
the property and config name, which is a bit technical, but at least
correct.

Syncing uses the child's error string as "first error" in the parent,
too, by logging it anew on the parent side. That puts it into the
parent's sync report ahead of any additional error that it might
encounter while the child shuts down. Also use the child's status when
available instead of a misleading TransportError.

In addition, suppress as many of these errors as possible when we know
already that the child reported an error in its sync report. Not all
"transport errors" are currently avoided that way, but this is at
least a first step.
2012-01-20 13:38:49 +01:00
Patrick Ohly
fba96c550a autotools: cleaned up choice between gdbus and gdbusxx
src/src.am still used its local variables instead of the top-level
ones. In addition, it got the paths slightly wrong, causing build
errors in the nighty testing.
2012-01-20 10:21:23 +00:00
Patrick Ohly
023b060f65 autotools: fixed combination of unit tests + shared linking
test/dbus-client-server failed to link in shared mode because
some of the unit testing flags were missing.
2012-01-20 10:51:42 +01:00
Patrick Ohly
f1bffbc1a4 Merge commit 'syncevolution-1-2-2'
Conflicts:
	Makefile.am
	configure-post.in
	configure.ac
	src/Makefile-gen.am
	src/dbus/qt/Makefile.am
	src/syncevo-dbus-server.cpp
	test/test-dbus.py

Conflicts caused by renaming of files on master. Manually applied the
relevant changes to the renamed files.
2012-01-16 11:47:10 +01:00
Patrick Ohly
996a237b18 autotools: added missing dependency syncevolution -> libgdbussyncevo
Rebuilding the library did not trigger a relinking of syncevolution.
Adding .la files for LDADD is not enough, they also need to go into
DEPENDS.
2011-12-19 17:59:42 +01:00
Patrick Ohly
cb7ea565d3 autotools: added rule for libsynthesis.la
When compiling libsynthesis as part of the normal make invocation,
libsyncevolution.la had a dependency on libsynthesis.la, but no rule
to generate it. That worked for "make all" (because it entered the
subdir first), but not for "make <something>" where <something>
dependended on libsynthesis.

This commit adds such a rule. It is enough for initial builds, but not
complete yet because the outer make doesn't know the dependencies of
libsynthesis.la and thus won't trigger rebuilds. Add the complete file
list?
2011-12-19 17:59:42 +01:00
Chris Kühl
103dfe4f73 build: Enable configure switch to build with GIO GDBus
syncEvolution has used an in-tree copy of Bluez's gdbus dbus
implentation.

With this patch there is now a configure switch which enables the use
of the GLib's GDBus dbus implmentation if the --with-gio-gdbus
configure flag is use or, if no flag is used, an adequate glib version
(2.26) is found.

This commit does *not* actually implement the use of GIO's GDBus. The
implmentation is coming soon. Thus only --without-gio-gdbus will
currently result in a working build.
2011-11-29 16:38:38 +00:00
Patrick Ohly
a88ba0a091 autotools: use pcre for regular expressions
Added the necessary autotools rules to use pcre in the src binaries
and libsyncevolution. It's unconditionally required now, which makes
it possible to add code depending on it without having to worry about
the case without pcre.

The alternative to pcre with its C++ binding would have been
boost::Xpressive. pcre was chosen because it has UTF-8 support and is
more common.

boost::regex introduces an undesirable library dependency. The C POSIX
regex code has no C++ binding and does not support easy replacement.

README was updated accordingly.
2011-11-28 10:18:19 +01:00
Patrick Ohly
08752e9468 testing: fixed "make testclean"
Did not remove the recently introduced .log.html.
2011-11-10 14:50:38 +01:00
Patrick Ohly
37f360d33d testing: generate HTML version of .log files and ClientTest.cpp
The HTML version of the .log files links to ClientTest.cpp.html,
colorizes important parts and links to the sync session
directories.

Because it is much more useful than the plain text version, the
nightly.html now links to these .html files.

ClientTest.cpp.html is built with Python pygments if installed,
otherwise some builtin fallback code is used.
2011-11-09 10:37:05 +00:00
Patrick Ohly
14416b8deb testing: improved logging + CLIENT_TEST_SOURCE_DELAY
Exceptions reported by CppUnit only contained one file+line pair. If
that location was called multiple times inside a larger test, then it
was impossible to tell where it was called. The new assertion macros
and in particular CT_ASSERT_NO_THROW() solve this problem by catching
exceptions, adding the current file+line information and then
rethrowing an extended exception. When CppUnit finally logs the
problem, it will contain a complete call stack.

For this to work, every single line which might throw an exception
must be wrapped in a macro. Entering and leaving the line is logged
together with the wrapped expression as part of the test .log file.

doSync() is handled as a special case and gets the file+line info of
its caller via parameters.

New logging macros are introduced and used in LocalTests::testChanges:
instead of writing comments, call the logging macros and the string
will appear also in the .log file of the test.

Further areas for improvements:
- use CLIENT_TEST_LOG() everywhere
- reduce file names to just the base name is logged
- convert .log file into HTML with links into session logs and
  ClientTest.cpp source file
2011-11-09 10:37:05 +00:00
Patrick Ohly
64942372d6 autotools: fixed "make dist[check]" in non-recursive Automake
The bundled libsynthesis source needs to go into "src/synthesis".

None of the XML config files and templates were installed when using
out-of-tree compilation in a clean build directory, because then the
$(wildcard) macro didn't actually match any files. Now it checks the
source directory and the extra directory prefix is removed before
using the resulting file list.
2011-09-02 09:20:23 +00:00
Krzesimir Nowak
a7ad98fabc Port build system to non-recursive Automake.
All but toplevel Makefile.am are replaced with their non-recursive
counterparts. The generation of configure.in was removed (and thus
configure-{pre,post}.in are also removed) in favor of configure.ac
and m4 macros adding backend specific configure parts.

Version number is generated like in old build system.

There are still many things to improve, but for now there are no
immediate regressions. AUTOTOOLS-TODO contains a list of possible
improvements and fixes. AUTOTOOLS-TESTING contains what was tested
with current build system (configure flags, make options).
2011-08-30 16:38:34 +02:00