Commit graph

1997 commits

Author SHA1 Message Date
Zhu, Yongsheng
280e67bddc Testing: refine return code checkings(bug#6457)
when memory leaks occur, the return code should be '100'
but python on unix will re-encode it and put them in a high byte
in a 16-bit number.
2009-12-01 21:45:33 +01:00
Zhu, Yongsheng
426cc66371 valgrindcheck.sh: don't force --leak-check and --trace-children
These two options must be part of VALGRIND_ARGS is non-default
values are desired. Previously --leak-check=yes and --trace-children=no
were always set by the script, which is too inflexible.
2009-12-01 21:45:33 +01:00
Zhu, Yongsheng
3855f132c7 ZYB: add README.zyb and customize test cases(MB#2424)
Add README.zyb file for ZYB interoperability test and
customize specified test cases for ZYB.

Now ZYB only supports contacts(vcard2.1). Now all test
cases of contacts are passed.
2009-12-01 21:45:42 +01:00
Zhu, Yongsheng
7f17cc02e6 client-test+ZYB: set maxMsgSize and maxObjSize as default value (MB#2424)
For ZYB, the client-test sets different maxMsgsize and
maxObjSize in two times sync and this causes server
initializing a slow-sync mode.
See detail:
http://bugzilla.moblin.org/show_bug.cgi?id=2424#c13
2009-12-01 21:45:42 +01:00
Zhu, Yongsheng
64a828623d ZYB: Ignore some properties comparison(MB#2424)
Some properties in vcard21 are dismissed by ZYB server.
So we ignore them in synccompare:
CALURI, CATEGORIES, FBURL, NICKNAME, X-MOZILLA-HTML,
PHOTO, X-EVOLUTION-FILE-AS, X-ANNIVERSARY,
X-ASSISTANT, X-EVOLUTION-BLOG-URL, X-EVOLUTION-VIDEO-URL,
X-GROUPWISE, X-ICQ, X-MANAGER, X-SPOUSE, X-YAHOO, X-AIM
2009-12-01 21:45:42 +01:00
Zhu, Yongsheng
c0e51e311a syncclient config: disable anchors checking for ZYB(MB#8138)
ZYB may send mismatched anchors though
there is no mistake between two syncs. If client
checks anchor, then a slow sync will be initiated.

So, synthesis adds an element 'lenientmode' in
'remoterule' to provide capability of disabling
or enabling anchors checking. Disable this kind
of checking for ZYB.
2009-12-01 21:45:42 +01:00
Zhu, Yongsheng
46a3ed30ee Mobical: skip unit test testOneWayFromClient(MB#8121)
Mobical has a known server issue that it initiates a
slow sync when one client syncs with it in one-way-from-client
mode from the second time.

Because Mobical has no schedule on this, we skip this
test for Mobical interoperability test.
2009-12-01 21:42:41 +01:00
Patrick Ohly
4de3b440ce shared config + templates: must share global properties
The command line did not read the global defaultPeer property unless
it found an existing context. This is an unnecessary optimization,
reading from an non-existant context yields no properties except
perhaps for defaultPeer, so we can do that and get the correct
result with and without a context.

Jussi mentioned that he didn't get defaultPeer when reading a
template. Added TestMultipleConfigs.testSharedTemplate to verify
that, but it passes without issues.
2009-12-01 21:40:01 +01:00
Patrick Ohly
f4e530e421 defaultPeer: also shared when using legacy configs (MB #8334)
This patch allows a user to read and write the single "defaultPeer"
property in ~/.config/syncevolution/config.ini even when selecting
a peer which has a legacy config in ~/.config/syncevolution/<name>.
This is more convenient and ensures that the sync-UI works correctly
even in those cases where the legacy config cannot (or has not) been
migrated.

It works by adding multiplexing of properties to the HTTP_SERVER case
and then using a separate global config node.

Really, really old configs in .sync4j/evolution do not share the
defaultPeer property, but I think this is acceptable.
2009-12-01 21:40:01 +01:00
Patrick Ohly
869ca8d2f4 fixed reading templates from file (MB #8335)
Broke while adding support for shared configs. We didn't have a test
for it, therefore this went unnoticed. I have added a test for it
(CmdlineTest::printFileTemplates) and fixed the issue (using the wrong
file layout for templates).

The test depends on having access to installed templates in a known
location, which previously was a problem due to the hard-coded
TEMPLATE_DIR. Now SyncContext::createServerTemplate() checks an env
variable (SYNCEVOLUTION_TEMPLATE_DIR) which is set by most of the
command line tests to prevent reading from there unintentionally and
once to "./templates" to ensure reading from there.
2009-12-01 21:40:01 +01:00
Patrick Ohly
28cf8bbcf5 virtual backend help text: updated evolutionsource comment
Adding
to the comment of "type" tripped up the Cmdline test,
which scans for lines which look like default property
values.

Rephrased the comment to avoid that, by removing the
"evolutionsource" keyword and the assignment.
2009-12-01 21:40:01 +01:00
Patrick Ohly
c7e97c3dfd config templates: "sync" property expected to be set
Since introducing shared configs, the default value of "sync" is
"none", so that peers which happen to share a source not configured
for them do not accidentally use it.

The code which prepared templates had not been adapted, breaking the
Cmdline test. Now an unset sync property is set to "two-way" for all
four default data sources, just like it was set before.

File templates can still set a specific source to some other default,
like "sync = none".
2009-12-01 21:40:01 +01:00
Patrick Ohly
671fb4e099 Merge remote branch 'origin/syncevolution-0-9-branch' 2009-12-01 21:39:46 +01:00
Patrick Ohly
30651e19b8 SyncSource.cpp: g++ 4.4 compiler bug workaround
is_any_of(" ") triggered an error in stl algo.
is_from_range(' ', ' ') worked and should also be
more efficient.

See http://stackoverflow.com/questions/1168525/c-gcc4-4-warning-array-subscript-is-above-array-bounds/
2009-12-01 18:53:45 +01:00
Patrick Ohly
a29a2540f5 autotools: fixed installation of backends with recent libtool
More recent libtool versions contain a check that the
install dir doesn't deviate too much from the libdir
compiled into the libs. This check failed when the
chosen path ended with a slash, leading to:

libtool: install: error: cannot install `syncecal.la' to a directory not ending in ...

I consider this a bug in libtool and sent a bug report
together with a fix. In the meantime, let's avoid the
problem by not adding any redundant slash in our
path...
2009-12-01 17:31:37 +01:00
Patrick Ohly
5ccbf8e2a2 syncevolution --migrate: support migration into a certain context
This depends on peer/context awareness in the code which looks for
the old config and renames it. If the old config is not in the same
context as the new one, it is searched by peer name alone. This
works for all old-style configs as well as rewriting a peer inside
the same context.
2009-12-01 17:27:59 +01:00
Patrick Ohly
656cc60dc5 syncevolution --migrate: copy .synthesis directory (MB #8048)
Without copying this directory, using the migrated configuration will
lead to a slow sync.

SyncEvo::CmdlineTest::testMigrate was extended to cover this problem.
Manually testing shows that the slow sync is indeed avoided with
this change.
2009-12-01 17:27:58 +01:00
Patrick Ohly
545467f642 utility function: cp_r() for recursive copying
The goal of this function is to copy the .synthesis directory
from one config into another. Therefore it only supports directories
and plain files. It is not very intelligent (no copying of a file
into a directory).
2009-12-01 17:27:58 +01:00
Patrick Ohly
e16661f624 syncevo-dbus-server: incoming SyncML message not handled
After merging the "phone" branch, incoming SyncML messages
were no longer replied to properly. The code always ignored
the available message and replied with a SAN message. Now
the code checks for server mode *and* availability of incoming
data before generating a SAN.
2009-12-01 15:10:27 +01:00
Patrick Ohly
57659ed754 test-dbus.py: adapted to new org.syncevolution.SourceUnusable
Since merging Jussi's GUI branch, this exception is thrown instead
of a generic one. Test was still checking for the generic one.
2009-12-01 15:09:16 +01:00
Patrick Ohly
099a311d42 syncevo-dbus-server: GetConfig() and check for existing config
GetConfig(template=false) is meant to check for existance of the
corresponding config, except in one case: "@default" is excempt
from that check so that a GUI can read the "defaultPeer" property
in all cases, including one where only some other context exists.

The check for this was too liberal and also allowed reading
non-existant configs *inside* the default context, like
"no-such-config". Found by running test-dbus.py.
2009-12-01 15:06:32 +01:00
Patrick Ohly
aa13c8446a Merge remote branch 'origin/syncevolution-0-9-branch'
Conflicts:
	configure-pre.in
	src/syncevo/Makefile.am

Version conflict in configure and unrelated changes near
same line in Makefile.
2009-11-30 21:41:53 +01:00
Patrick Ohly
ec34471e97 syncevo-dbus-server: fixed size_t printing
On 32 bit, %lu is not a proper formatter for size_t. Casting
the value to (unsigned long) to avoid this kind of problem
without causing it on 64 bit (as %u would).
2009-11-30 21:23:36 +01:00
Patrick Ohly
11045f0295 syncevo-server.c: detach_cb unused compiler warning
Commented out detach_cb() with #ifdef 0 because the compiler
warns about that static function not being used. With -Werror
that breaks the build.
2009-11-30 21:22:10 +01:00
Patrick Ohly
03351afe03 Merge branch 'origin/jku' (early part)
Conflicts:
	src/dbus/interfaces/syncevo-server-full.xml

Conflict due to whitespace changes.
2009-11-30 19:46:12 +01:00
Patrick Ohly
123333d676 gdbus-cxx: header file must be distributed
"make distcheck" failed because it didn't include the new
C++ binding header files. Fixed by including them in the
files which need to be installed in /usr/include, just like
the rest of gdbus does it.
2009-11-30 19:41:00 +01:00
Jussi Kukkonen
d065b44f20 gtk-ui: remove unused function + variable 2009-11-30 14:33:00 +02:00
Jussi Kukkonen
5d31ea8557 dbus wrapper: take copy of source name for SyncevoSourceProgress 2009-11-30 14:30:56 +02:00
Jussi Kukkonen
52d783834f gtk-ui: remove window title in moblin version (MB#6806) 2009-11-30 12:52:01 +02:00
Chen Congwu
fe86b4b2d5 Server alerted Sync: fix the timeout and signal handling during SAN
move initSAN from sync() to doSync()
It was once designed to put initSAN as early as possible to reduce
unnecessary resource if client does not respond (automatic sync).
However it lost the signal handling. Let's move it to doSync() at
the moment and come out the other solution for automatic sync later.

Timeout handler was not registerd for the transport, fixed.
2009-11-30 11:44:39 +01:00
Chen Congwu
9712bde908 SyncContext: detect server or client session before instantiating the engine. 2009-11-30 11:44:39 +01:00
Chen Congwu
bcefe8bebe Revert "Server alerted sync: ensure only one SynthesisEngine is active"
This reverts commit 3c5d42caea.
As discussed, we can acutally use only one SynthesisEngine instance.
2009-11-30 11:44:38 +01:00
Chen Congwu
e5b641897a FileSyncSource: use x-vcalendar instead of x-calendar
"x-calendar" was a typo.. However, to be backward compatible  we will
accept both "x-vcalendar" and "x-calendar".
The configuration example is change to "x-vcalendar" to educate new users
to use "x-vcalendar".
2009-11-30 11:44:38 +01:00
Chen Congwu
74497e8486 Server alerted sync: fix a typo in SyncMode parsing 2009-11-30 11:44:38 +01:00
Chen Congwu
fe124636b3 ObexTransportAgent: fixing an obex event leak for SyncML server case
ObexEvent which wraps an underlying OBEX event source is expected to
be released during ObexTransportAgent class destructing or during
wait() where we copied it to the local stack.

The assumption was: wait() is called after each send(). This is not
correct for SyncML server case. Therefore later shutdown() sets up a
new ObexEvent and overwrites the old one without releasing the resource.
This may also occurs if user calls send(), send() without calling wait()
in between (Rarely, though).

The solution is to check explictly whether m_obexEvent already wraps a resource
before assigning a new value to it.
2009-11-30 11:44:38 +01:00
Chen Congwu
1f00c71eab Server alerted Sync: Throw error if no source is enabled during SAN generation.
If no source is enabled, the SAN generation should throw error and stop the
sync.
2009-11-30 11:44:38 +01:00
Chen Congwu
1b923115a0 Join/dejoin Mutiple SyncSources, MB#4611
As Nokia phone stores calendar and todos in one datastore, we need to utilize
synthesis superdatastore to handle this case. A virtual SyncSource is introduced
which has a backend type "virtual" and its local database path points to a list
of sub syncsources. The virtual syncsource is maintained by SyncSourceList and
used to generate appropriate synthesis superdatastore configuraitons.
unescapeJoinedString is introduced to parse a comma seperated list of sub
syncsources. At this time, the configuration is fixed to work with
"calendar+todo" case.
2009-11-30 11:44:38 +01:00
Chen Congwu
cd180397f4 Sever Alerted Sync: SAN generation
The "Server Identifier" field will use DeviceID if "remoteIdentifier" is not
set.
2009-11-30 11:44:38 +01:00
Chen Congwu
3e7aad6cbf Server Alerted Sync: SAN generation
ContentType in the 'Get' command during the SAN should be XML or WBXML instead
of SAN Notification.
2009-11-30 11:44:38 +01:00
Chen Congwu
6d679abae1 Server Alerted Sync: SAN generation
There is no server alerted slow sync, if user specifies fall back to
server alerted two-way sync.
2009-11-30 11:44:38 +01:00
Chen Congwu
97cead8f3b Server Alerted Sync: Set Content Type in SAN
Nokia phone (S40, 7710c) does not accept the null content type.
SyncSource::getPeerMimeType is added for this purpose, each backend
implementation can provide a MimeType used for sync by default. For
TrackingSyncSource based backend implementations it maps to getMimeType
directly.
2009-11-30 11:44:38 +01:00
Jussi Kukkonen
61320cd09b gtk-ui: change name 'Addressbook'->'Contacts' (MB#6514) 2009-11-30 12:35:28 +02:00
Jussi Kukkonen
0c39926686 gtk-ui: bring back the destuctive sync mode options
This is a temporary change (to not change strings) while we're
waiting for a proper UI for this.
2009-11-30 12:34:11 +02:00
Patrick Ohly
5c5718f05c SyncContext: set log file name to "syncevolution-log.html"
Previously, the log file name was hard-coded inside libsynthesis and
changed between libsynthesis release (sysynclib_linux.html ->
sysynclib_uni_linux.html) without SyncEvolution being able to notice
or control this.

Now the file name is set by SyncEvolution. This depends on an
up-to-date libsynthesis with the "filename" configuration option.
2009-11-30 11:23:06 +01:00
Jussi Kukkonen
9ad102243e gtk-ui: set sync-button sensitivity based on Presence 2009-11-30 11:20:52 +02:00
Patrick Ohly
779ffa2a27 configuration: updated to match server use cases (MB #7710)
remoteDevId must be user-visible, because it is necessary to configure
it in advance when the peer is an HTTP SyncML client.

Also updated several property documentation strings. We have to
explain how they apply when the local side acts as SyncML server
and/or OBEX is involved.
2009-11-27 19:47:47 +01:00
Patrick Ohly
34e3ba0fde D-Bus API: further explanations for Server.GetReports()
Added some parsing hints related to the escape mechanism
for - in the source name.
2009-11-27 18:07:43 +01:00
Zhu, Yongsheng
e78b931696 DBus server: change the behavior of GetReports(MB#8049)
Reports returned to dbus clients are not what we
expect. Many keys are not included.

Current keys in dictionaries are conforming to
those in SyncML.cpp. They are defined formally in
BNF to be more accurate.

For statistics related reports, if value is 0,
it won't be put in the dictonaries to save time
and space.

Also refresh the unit test of GetReports in
test-dbus.py to make it successful.
2009-11-27 18:04:34 +01:00
Patrick Ohly
87311e6c17 configure + NEWS: version bumped to 0.9.2, summarized changes 2009-11-27 17:47:24 +01:00
Patrick Ohly
047feee9a2 Evolution Address Book: avoid picking CouchDB by default (MB #7877)
Append CouchDB address books at the end of the list,
otherwise preserving the order of address books.

The reason is Moblin Bugzilla #7877 (aka CouchDB
feature request #479110): the initial release of
evolution-couchdb in Ubuntu 9.10 is unusable because
it does not support the REV property.

Reordering the entries ensures that the CouchDB
address book is not used as the default database by
SyncEvolution, as it happened in Ubuntu 9.10.
Users can still pick it intentionally via
"evolutionsource".
2009-11-27 16:57:53 +01:00