Commit graph

1922 commits

Author SHA1 Message Date
Patrick Ohly
21f76cff07 command line: code clean-up around LUID escaping
Using std::string for both local IDs as respresented by the backend
and encoded as printed by the command line was confusing. It didn't
help that the m_luids member contained encoded strings, instead of
normal luids.

This patch introduces a dedicated class which holds an encoded luid,
and provides the necessary conversion functions. m_luids now really
contains plain luids, so its values can be passed to the backends
directly.
2010-09-01 15:48:29 +02:00
Patrick Ohly
2ab93b301f KCalExtended: fix for invalid memory access
Accessing pointer into temporary instance is only valid inside
the expression. Need to copy into result std::string right away.
2010-08-31 10:02:17 +02:00
Patrick Ohly
9e55780cdc QtContacts: more QtContacts API related fixes (BMC #5710)
First, "query-builder=fetch,save" is obsolete.

Second, the modification time stamp is not updated in
saved contacts. Instead it has to be fetched explicitly
in a second request. This behavior is currently under
debate because it is not quite consistent with some of
the API documentation.
2010-08-27 13:30:05 +02:00
Patrick Ohly
fa9c4c6bb9 phone templates: updated, copied from syncevolution.org Wiki (BMC #5727)
Merged all Nokia templates (S40, S60, Maemo) into one, because the
settings were the same anyway. The rationale is that it reduces the
number of options the user has to choose from.

Added Sony Ericsson, based on K750i.

Added names of working phones based on Wiki entries.
2010-08-27 13:30:05 +02:00
Patrick Ohly
614f0390b0 nightly testing: workaround for Evolution 2.30 storage shutdown (BMC #5864)
The D-Bus based Evolution Data Server calendar and contact daemons
(e-calendar-factory and e-contact-factory) shut down after 10 seconds of
inactivity.

Normally libecal/libebook detect that, but not when the client only uses the
synchronous API ("destroyed" signal not delivered, see e-cal.c). That affects
SyncEvolution.

This patch ensures that a EvolutionContactSource resp. EvolutionCalendarSource
remains open throughout the lifetime of the client-test app. This prevents
the storages from shutting down.

This instances are created on demand and deleted when the process quits.
This might be too late for ORBit based Evolution; there were error messages
after all tests succeeded and an assertion failure in ORBit, leading to
a nonzero return code.
2010-08-27 18:47:16 +08:00
Patrick Ohly
a00cabeafe D-Bus API: fixed type signature
a{s} needs to be a(s); broke compilation of GTK GUI.
2010-08-25 23:09:28 +02:00
Patrick Ohly
1b243b7b83 D-Bus API: added Server.ConfigChanged signal (BMC #3558)
Watching for configuration changes (e.g., for refreshing the list of
servers in the GUI) currently is a bit cumbersome. It requires
watching for SessionChanged, request GetConfigs, and look if
the configs have changed. This is not really a problem, but it
might be more convenient to get notifications about config
changes directly.

This patch introduces a Server.ConfigChanged signal which is at the
end of a session if and only if it modified (removed, updated, added)
a config. This includes the Session.SetConfig() as well as command
line operations executed inside the server.

Testing the signal can only proof that it is emitted. Checking that it
is not emitted would have to block waiting for something, and it is
uncertain what that should be. SessionChanged may be emitted before
the ConfigChange signal and thus isn't suitable.
2010-08-25 23:09:28 +02:00
Patrick Ohly
a9e7a49705 D-Bus API: added Session.GetConfigName() (BMC #3559)
This call is useful for clients which haven't started the session
and need to know what peer it relates to, and also fo clients which
use non-normalized config name and need to know the normalized name.
2010-08-25 23:09:22 +02:00
Patrick Ohly
e30ae98e57 D-Bus API: added suppression of libnotify notifications (BMC #3560)
Genesis is already providing feedback about running syncs and thus
wants to suppress the notifications generated by syncevo-dbus-server
for it. With this patch it is possible.

This patch removes the m_attachedClients member and moves the attach
count into the Client class. The reason is two-fold:
a) m_attachedClients was simply redundant
b) entries were not removed (bug in the control flow of clientGone:
   if the client was found, which is always the case for any attached
   client, it returned without calling detachClientRefs())

The other new entry in Client is the boolean setting whether that
client wants to suppress notifications. If any client disables them,
they are disabled globally.
2010-08-25 23:09:14 +02:00
Patrick Ohly
4fad1303ae command line: start D-Bus session with "no-sync" flag unless running a sync (BMC #3562)
The main goal of the new D-Bus API is to avoid unnecessary (and incorrect)
updates in Genesis when running non-sync sessions with the command line.
This patch sets the flag accordingly to achieve this.

Note that the modified command line now fails with
org.freedesktop.DBus.Error.UnknownMethod when running against an old
syncevo-dbus-server. There's no fallback to the older StartSession
method. This shouldn't be necessary because the command line is shipped
with the server.

Just in case an INFO message is printed when the method is found to
be missing.
2010-08-25 11:07:51 +02:00
Patrick Ohly
5e219fedef D-Bus API: added Server.StartSessionWithFlags() and Session.GetFlags()
Clients like Genesis would like to know for which purpose a session
was created. If it was for changing the configuration, they can ignore
the session.  If it was for sync, then progress and result should be
displayed.

Starting a session with the new "no-sync" flag in the new
StartSessionWithFlags() achieves that. Note that it is up to the
clients to provide that hint; currently none of the clients do that.
2010-08-25 10:37:58 +02:00
Patrick Ohly
502cdec73a gdbus C++: fixed cut-and-paste error
Found this one when adding a method with five parameters. The
boost::bind() call had the wrong number of parameters for that case
and thus compilation failed.
2010-08-25 10:26:49 +02:00
Patrick Ohly
a28eefa300 command line: do sanity version check when running as D-Bus client
One common mistake among developers is that they recompile SyncEvolution
and then run with the system's D-Bus server. This patch adds an INFO
message about such a version mismatch, but does not abort because such
a combination may be intentional.

It is implemented as part of the attach process: as soon as attaching
was successful, fire of another asynchronous method call to the new
Server.GetVersions() instead of returning from the main loop. Once
that completes, check the version and return.
2010-08-25 08:52:54 +02:00
Patrick Ohly
067397a9f2 D-Bus: added Server.GetCapabilities and Server.GetVersions (BMC #3563)
We are about to extend the D-Bus API. Clients need some way of determining
whether the new features are available. A strict numbering of the API is
inflexible, so let's use "capability" strings instead. Also add flexible
version querying, for debugging.
2010-08-25 08:52:54 +02:00
Zhu, Yongsheng
c8b1f3a07d client-test: avoid duplicate sources in m_localSource2Config
do checking to avoid duplicate before pushing back a source
into m_localSource2Config for TestEvolution.
Virtual sources may contain many sub-sources, which might duplicate
other sources.
2010-08-25 08:41:18 +02:00
Patrick Ohly
1b62240708 command line: allow creating contexts without peers
When configuring a context for local sync, no peer is needed
inside that context. Therefore "--configure" without "--template"
is valid, because the templates only differ in peer-specific
properties.

This patch uses the "SyncEvolution" template as automatic fallback
for context configs. A change to FileConfigTree ensures that the
"peers" directory is created, as expected by the code which checks
for new-style configs.
2010-08-24 09:36:15 +02:00
Patrick Ohly
abbfc49676 SyncConfig: do not mistake "foo" context for old-style "foo" client config
A existing context configuration could accidentially be access without
the @ sign and then was treated like an old-style config with default
context. During --configure, invalid properties from the @default
context were written into the other context.

The fix makes the check for old-style configs more strict: it assumes
that all new-style contexts have a "peers" sub directory and checks
for that.
2010-08-24 09:36:05 +02:00
Patrick Ohly
a3eaf3138b command line: fixed --delete-items/--import for KCalExtended
The --delete-items/--import options did not work with the KCalExtended
backend. The reason was that saving changes is only done in
KCalExtendedSource::endWrite(), which wasn't called because the command
line did not invoke endDataWrite().

That used to be intentional to avoid updating change tracking state in
other backends, but clearly was a hack. Because the sources are now
instantiated without change tracking, endDataWrite() is safe to call,
which fixes the issue with KCalExtended.
2010-08-23 18:20:01 +02:00
Patrick Ohly
bf36c6b7e6 KCalExtended: further adaptions to KCalExtended API change
Must use MemoryCalendar because ExtendedCalendar can no longer
hold incidences without a Notebook UID, which does not exist
without a storage.

Removed a redundant smart pointer copying.

Added return code checking of iCalendar 2.0 parser.
2010-08-23 18:17:24 +02:00
Patrick Ohly
b504bf9f1f KCalExtended: workaround for incomplete libmkcal.pc
libmkcal.pc did not depend on libkcalcoren and thus
include paths were not set for that when only checking
for libmkcal. Drawback now is the hard dependency on
the MeeGo version of libkcalcore.
2010-08-17 13:45:10 +08:00
Patrick Ohly
4e87e50463 EDS compatibility: added icalproperty_free()
Started to use this call recently, also need to wrap it.
2010-08-17 11:30:39 +08:00
Qiankun Miao
2265aaff0c EvolutionBackend: fix memory leak
Function "icalcomponent_remove_property(...)"  removes property instance from
properties list, but doesn't free the space it holds. So, after calling this
function, the property instance removed from properties list should be free
explicitly.
2010-08-16 16:38:19 +08:00
Patrick Ohly
957d5c6175 Merge branch 'meego-1.0'
Conflicts:
	configure-pre.in

Version conflict.
2010-08-15 21:29:08 +02:00
Patrick Ohly
2018114977 gdbus: ensure that header files are included in "make dist"
After commenting out the files, they were no longer considered
by automake.
2010-08-15 21:26:53 +02:00
Patrick Ohly
5b6f3ae3ca kcalextended: adapted to revised API
As part of splitting kcalextended into a modified kcalcore (shared
with KDE) and mkcal (MeeGo), the API was modifid. This patch gets
SyncEvolution to compile again. However, at least on my laptop
it then crashed at runtime inside Qt before even calling mkcal =>
change untested.
2010-08-15 21:24:14 +02:00
Patrick Ohly
438779d7ff SyncContext: added comment for getUsedSyncURL()
The function had been added without explanation. This comment
documents my understanding of its purpose...
2010-08-15 21:24:14 +02:00
Patrick Ohly
18dd70a275 Revert "compile fix for FC 13 (and possibly others): use private copy of gdbus (MBC #3556)"
This reverts commit ec7eb74366.

With the symbol prefix renamed from gdbus into bdbus, we can install
the lib into /usr/lib/syncevolution again, to get it shared between
the "syncevolution" and "syncevo-dbus-server" binaries.
2010-08-09 10:46:11 -04:00
Patrick Ohly
4ba42082fa gdbus: avoid name conflict with glib
The previous solution of linking Bluex gdbus statically was not
enough. On Fedora 14, compile errors due to the glib header files
being pulled in indirectly appeared.

This patch does a global search/replace which changes the
"gdbus" (GLib D-Bus) prefix into "bdbus" (Bluez D-Bus). For the
record:
perl -pi 's/g_dbus_/b_dbus_/g; s/GDBus/BDBus/g; s/GDBUS/BDBUS/g' ...
2010-08-09 10:46:03 -04:00
Patrick Ohly
dd5f4b94b0 gdbus: do not install header files
The library was already considered "private",
so no software should need the header files.
2010-08-09 10:45:55 -04:00
Jussi Kukkonen
5c2c115c87 canonize new device config names (MBC #1194)
Fixes the second half of bug 1194: only allow "-_[a-z][A-Z][0-9]"
characters in the name.
2010-07-16 16:57:09 +02:00
Jussi Kukkonen
181035f8ac prevent overwriting device configs by accident (MBC #3566,1194)
Currently the configuration name for a new config is the
fingerPrint and it overwrites any existing configuration.
This commit starts using deviceName as the base name and adds a
incremental number to the end if a configuration already exists
for that name.
2010-07-16 16:56:58 +02:00
Patrick Ohly
a92e987e81 ZYB.com: service goes away end of June 2010, template removed (MBC #3310)
ZYB.com will be replaced with Vodafone 360, which we don't support (yet).
This patch removes the obsolete template for ZYB.com. The sync-UI still
has some strings for it, just in case that someone has an old template
around or runs it against an old syncevo-dbus-server.
2010-07-16 16:56:44 +02:00
Patrick Ohly
34bb1b1066 syncevo-dbus-server: accept 'application/vnd.syncml+xml; charset=UTF-8' for starting an HTTP session (MBC #3554)
The redundant charset specification was set by the Funambol
Thunderbird client. Because of a literal comparison against
'application/vnd.syncml+xml' the messages were rejected.

This patch strips everything after a semicolon. None of the options
there should matter for SyncML.
2010-07-16 16:56:27 +02:00
Patrick Ohly
ec7eb74366 compile fix for FC 13 (and possibly others): use private copy of gdbus (MBC #3556)
SyncEvolution on FC 13 crashes because it conflicts with a different
system version of the gdbus library. Always linking statically fixes
this.

There never was an official upstream release of gdbus, so sharing the
implementation does not work.
2010-07-16 16:56:11 +02:00
Patrick Ohly
ca7c58b014 config fix: operations on non-peer configs failed (MBC #3157)
When running operations on a non-peer configuration (like --restore @default
addressbook), the operation fails with
[ERROR] <source name>: type 'select backend' not supported

The root cause is that the "type" property was read from a virtual, empty peer
node. MultiplexConfigNode already handled this by falling back to the non-peer
node.

The same special case also needs to be added to SyncSourceNodes::getNode().
2010-07-16 16:56:01 +02:00
Jussi Kukkonen
88ea231145 canonize new device config names (MBC #1194)
Fixes the second half of bug 1194: only allow "-_[a-z][A-Z][0-9]"
characters in the name.
2010-07-16 16:13:17 +02:00
Jussi Kukkonen
f616f35084 prevent overwriting device configs by accident (MBC #3566,1194)
Currently the configuration name for a new config is the
fingerPrint and it overwrites any existing configuration.
This commit starts using deviceName as the base name and adds a
incremental number to the end if a configuration already exists
for that name.
2010-07-16 16:12:42 +02:00
Patrick Ohly
5712425a56 QtContacts: fixed compile error with g++ in MeeGo
g++ in MeeGo Trunk is more picky about bit or of enums.
Fixed by adding explicit cast to enum.
2010-07-16 14:33:15 +02:00
Patrick Ohly
9e38a7cef9 QtContacts: find QtContacts properly
This configure changes removes the hard-coding of -lQtContacts -lQtVersit
and replaces it with proper qmake magic to find the libraries.
2010-07-15 15:57:36 +02:00
Zhu, Yongsheng
e38a479a6c client-test: ignore comments for KCalExtended and QtContacts
'isPropAssignment' checks each line and match whether it's
a property assignment according to match '<word> = value'.
Comments for 'KCalExtended' and 'QtContacts' match this pattern.
Obviously, they should be ignored like other backends comments.
2010-07-14 14:13:57 +08:00
Patrick Ohly
b7ef83d6ed documentation + command line: unified source of usage information (MBC #690)
This patch adds an utility script (readme2c.pl) which extracts the
SYNOPSIS and OPTIONS part of README.rst and puts it into C
strings. These are then used inside the SyncEvolution command line for
short help (just the synopsis) and --help (also all options).

This patch also cleans up README.rst so that the OPTIONS part really
documents most options in sufficient detail for --help to be useful.
The USAGE section remains part of the README and the man page where
the different operations are introduced in a more task-oriented way.

This separation is not always easy to make. The --restore operation
and related parameters are only described in the USAGE part because I
couldn't find a way to introduce them briefly and then add a thorough
explanation under OPTIONS.
2010-07-12 16:31:46 +02:00
Zhu, Yongsheng
99c9919b44 Testing: fix failure of evolution testing due to new backends
Some unit tests of CmdlineTest are failed due to new backends
which were newly implemented, including KCalExtended and QtContacts.
Change the reference data.
2010-07-08 13:51:26 +08:00
Patrick Ohly
1e608a8be5 KCalExtended: fixed test registration
The KCalExtended tests were accidentally enabled in an ifdef checking
the file backend, so they were on even when the backend was off.
2010-07-01 16:59:04 +02:00
Patrick Ohly
26416d0c09 QtContacts: fixed test registration
The QtContacts tests were accidentally enabled in an ifdef checking
the file backend, so they were on even when the backend was off.
2010-07-01 16:58:07 +02:00
Patrick Ohly
bec626d756 QtContacts: fixed compile error when not enabling QtContacts
-lQtContacst -lQtVersit was added unconditionally to the link
line, thus causing link errors when the backend was disabled.
2010-06-30 17:37:28 +02:00
Patrick Ohly
352610c157 ZYB.com: service goes away end of June 2010, template removed (MBC #3310)
ZYB.com will be replaced with Vodafone 360, which we don't support (yet).
This patch removes the obsolete template for ZYB.com. The sync-UI still
has some strings for it, just in case that someone has an old template
around or runs it against an old syncevo-dbus-server.
2010-06-30 11:59:45 +02:00
Patrick Ohly
77a8d87410 syncevo-dbus-server: accept 'application/vnd.syncml+xml; charset=UTF-8' for starting an HTTP session (MBC #3554)
The redundant charset specification was set by the Funambol
Thunderbird client. Because of a literal comparison against
'application/vnd.syncml+xml' the messages were rejected.

This patch strips everything after a semicolon. None of the options
there should matter for SyncML.
2010-06-30 11:35:11 +02:00
Patrick Ohly
56bda141dc compile fix for FC 13 (and possibly others): use private copy of gdbus (MBC #3556)
SyncEvolution on FC 13 crashes because it conflicts with a different
system version of the gdbus library. Always linking statically fixes
this.

There never was an official upstream release of gdbus, so sharing the
implementation does not work.
2010-06-30 10:38:12 +02:00
Patrick Ohly
75e54e8a8a QtContacts: added error checking
None of these functions typically fail, but if they do, then
throw an exception.
2010-06-30 10:38:12 +02:00
Patrick Ohly
7cb798205d QtContacts: enabled more efficient listing of all items
Tell QtContacts to only fill in the minimal amount of information
needed in listAllItems: local ID (always set?!) and modification
time stamps.

Whether this really reduces the amount of information returned to
us wasn't tested, but it also does no harm.
2010-06-30 10:38:12 +02:00