Commit graph

2969 commits

Author SHA1 Message Date
Patrick Ohly
727e3f8d53 NEWS: fixed bug numbers, added BMC #7091
Global search/replace of MBC with BMC (common typo). Added
2010-10-01 14:30:35 +02:00
Patrick Ohly
bf6c9ddad8 autotools: fixed QtContacts compilation
QtGUI is needed for QtContacts. Without it, the code didn't compile.
2010-10-01 14:29:44 +02:00
Patrick Ohly
d869534923 autotools: added missing quotation marks
if test $enable_dbus_timeout_hack = "yes"
triggered a shell error when the variable wasn't set at all.
Need quotation marks here.
2010-10-01 14:28:44 +02:00
Patrick Ohly
3bdf05d910 version bump to 1.0.99.7 2010-09-30 17:25:00 +02:00
Patrick Ohly
a56fa43d33 command line: split properly at empty line during --import (BMC #7664)
The --import operation was specified as splitting at a blank line and
was meant to work for vCard 3.0 and iCalendar 2.0 files. However, if
the blank line between items used DOS line ends (\r\n) like the items
themselves, then splitting them didn't work because of the literal
match with "\n\n".

This patch introduces a special semantic for the "\n\n" delimiter:
it also matches "\n\r\n" when splitting. This is implemented by
the custom FindDelimiter class.
2010-09-30 17:20:15 +02:00
Patrick Ohly
e6af21a1cb syncevo-dbus-server: keep sessions around after completion (BMC #7766)
Clients like Genesis which display information about sessions started by other
clients have a problem: they see that the session is created, but before they
can get the relevant information (config name, session flags), then session may
already have terminated.

Because the session is removed immediately after termination, the client's
attempt to call methods on that session will fail.

This patch introduces a new state for sessions:
- session completed and no longer active
- not listed anymore by Server.GetSessions()
- read-only methods can still be called for at least a minute

"At least" is intentionally a bit fuzzy. The way how it is implemented
it may happen that it remains accessible longer, but clients cannot
count on it.

The main idea behind the patch is that Client::detach() detects when
removing a session from a client's resources would delete the
session. At that point it triggers the normal cleanup for the session
(new Session::done(), same as previous Session::~Session()) and
creates a Timeout callback which holds a reference to the Session,
thus preventing deletion of it until the timeout fires once and then
gets removed together with the session.

If a client becomes the sole owner of a session before detaching, then
this will repeat. This is considered acceptable and covered by the new
semantic ("at least a minute").

The patch is slightly larger than it needs to be because some code was
moved around. The Client class now needs access to DBusServer and thus
its implementation can no longer be defined inline.

TestDBusSession.testAttachOldSession covers that such a completed
session can be attached to again. It failed before the delayed
deletion was implemented, now it passes. It also verifies that
Attach() keeps the session around. TestDBusSession.testExpireSession
verifies that the session is really removed after a minute.
2010-09-30 14:52:42 +02:00
Patrick Ohly
0594f5aba1 syncevo-dbus-server: introduced timeout utility class
The new Timeout class wraps g_timeout_add_seconds() and
g_source_remove() in a C++ interface. Users of the class no longer
have to worry about callbacks with stale data pointers, because the
Timeout class will automatically remove the timeout when it gets
deleted. Additional parameters for the callback can be tied to the
class via boost::bind(), using either copy semantic, pointers or
references (boost::ref()).

DBusServer extends upon the Timeout class by handling the ownership.
The Timeout class is deleted once the callback indicates that it no
longer wants to be called.

Most of the existing g_timeout_add_seconds() usage should be replaced
with this new class. The main point however is the BMC #7766, delayed
deletion of expired sessions.
2010-09-30 14:51:48 +02:00
Patrick Ohly
320e23e31d D-Bus API: added missing Session.Attach() (BMC #7761)
It was always part of the design that multiple clients can use any session.
Somehow we forgot to implement Session.Attach(), the call that allows a client
which hasn't started a session to register it's interest in the session. In
particular, that session won't go away unless the client exits or detaches.

This patch adds that missing call, a corresponding capability
("SessionAttach") and a unit test. The unit test covers recursive
attach/detach, it does not actually verify that the session remains
around.
2010-09-30 10:32:13 +02:00
Patrick Ohly
cb67e29e0a command line: fixed configuring of context (BMC #7181)
A context holds a set of source settings, without any peer-specific
properties like "sync mode". The code for configuring such a context
tried to set the sync mode and thus failed.

This patch unifies the check for "configuring context" in one place.

It also slightly modifies the set of sources which are configured:
traditionally, all sources were configured, but only the listed ones
were enabled. This makes sense because users then can enable the source
selectively, either during --run or with --configure without access to
the original template.

For a context, there is no concept of a "disabled" source. Adding
those makes no sense and thus is not done anymore.

Configuring a single source in a new context, adding a second source
and adding a peer is now tested in CmdlineTest::testConfigureSources.
Note that this contains a hack to reflect the broken behavior in BMC
fixed.
2010-09-29 15:07:35 +02:00
Patrick Ohly
545c71be68 KCalExtended, QtContacts: fixed initialization of QCoreApplication
As noticed in BMC #7401, a Q[Core]Application is needed before
Qt can be used. There is a global qApp pointer, which we should
use to find the global singleton. Creating a QCoreApplication
instead of a QApplication is good enough for us.
2010-09-29 14:38:11 +02:00
Patrick Ohly
15f3a898f7 KCalExtended: extended error messages
These error messages might be useful to track down BMC #6061.
2010-09-29 14:26:36 +02:00
Patrick Ohly
29717c59de KCalExtended: fixed UTF-8 handling (BMC #7401)
QString("foobar") only works for ASCII strings. const char pointers
which are in UTF-8 must use fromUtf8() explicitly. Same for conversion
back to UTF-8. Previously the code used toLocal8Bit(), which may or
may not be UTF-8 depending on the locale.

On a related note, test code which does not instantiate a QApplication
or QCoreApplication is incorrect and leads to different results than
code with such an instance. Our backends instantiate a QApplication if
necessary (but the exact way of doing it needs some tweaking), so the
result is deterministic.
2010-09-29 14:22:41 +02:00
Patrick Ohly
0859a8ce3d HACKING: added commit guidelines
This summarizes and documents established practices in
SyncEvolution, no new guidelines are added.
2010-09-25 08:09:29 -07:00
Patrick Ohly
bff517156c sync-ui: wrong direction of data transfer when talking to device (BMC #7091)
The settings for a device sync shows two checkboxes, one to "Send
changes to MYPHONE" the other to "Receive changes from MYPHONE". The
meaning of these two buttons are interchanged.

The settings are the same as in a web service. They were not mapped
correctly for a device because "refresh/one-way-from-server/client"
implies different data transfer directions depending on whether the
peer is a client or a server.

The solution for this issue is to switch the sync mode depending on
whether the config refers to a client ("PeerIsClient"). Added
an utility function and adapted:
- displaying existing configs
- changing configs
- refresh syncs in the emergency dialog
2010-09-24 17:51:27 -07:00
Patrick Ohly
512f175e6f autotools: fix libnotify problem on FC13
Recent libnotify releases require the app to pick gtk.
2010-09-16 14:44:07 +02:00
Patrick Ohly
5285051e3a sync-gtk.desktop.in: fixed syntax in non-MeeGo desktop file
Syntax error introduced in latest release: trailing ; missing.
2010-09-16 13:24:52 +02:00
Patrick Ohly
aded2028f4 documentation: improved explanation of "type"
The trailing exclamation mark for forcing a specific format
wasn't mentioned.
2010-09-13 08:05:26 +02:00
Patrick Ohly
3c7dca90e8 version bump: 1.0.99.6 2010-09-09 11:38:27 +02:00
Patrick Ohly
5a8574b7b1 nightly testing: adapted Cmdline test to string changes 2010-09-09 11:38:05 +02:00
Patrick Ohly
a62e0d0a9d NEWS: updated for 1.1 pre-release 2010-09-08 14:13:33 +02:00
Patrick Ohly
9db07a66a7 Nokia phones: avoid data loss in two-way sync due to X-EVOLUTION-UI-SLOT (MBC #2566)
Sending the X-EVOLUTION-UI-SLOT parameter to a Nokia phone when
updating an existing contact confuses the phone such that it drops the
phone number or email that had the parameter; the initial import was
okay. Reported for Nokia N81, E72, root-caused on a N97 mini.

Sending the X-EVOLUTION-UI-SLOT has very little value except when
talking to another SyncEvolution instance. All other SyncML peers
are expected to simply ignore the parameter, so there is no point
in sending it in the first place.

This is the solution implemented in this patch. A "rule" parameter
of the <parameter> element that defines X-EVOLUTION-UI-SLOT declares
that the parameter is to be ignored when parsing or generating vCards,
except when the peer is known to be SyncEvolution.

A remote peer is detected by the new 00_syncevolution.xml remote rule.
Locally, the parameter needs to be enabled when talking to Evolution
(evolution.xml) or to files which can also store the parameter
(all.xml). The later case is important for a SyncEvolution HTTP server
with file storage.

Running "./client-test Client::Sync::vcard30::testItems" against such
a SyncEvolution server confirmed that without all.xml, the
X-EVOLUTION-UI-SLOT got lost, which also confirms that the rule
mechanism works.
2010-09-08 13:44:55 +02:00
Patrick Ohly
4e72438e8f sync-ui (GTK version): updated .desktop file
As commented by Pietro Battiston, the generic "Sync (GTK)" name, "Up
to date" comment and "Internet" category inherited from Moblin/MeeGo
are not quite suitable for a general purpose Linux desktop.

This patch changes the non-Moblin/MeeGo .desktop file. The MeeGo
installation is not modified.

We did not have a good idea for a generic name and thus kept the GTK
part to distinguish this SyncEvolution GUI from future other ones.
Category and comment were easier: "Synchronize PIM data" and
"Office;PDA;GTK", with GTK likely to be ignored.
2010-09-08 13:44:33 +02:00
Patrick Ohly
ac3f4656b2 nightly testing: suppress leak in libebook
This is a single string which leaks in e_contact_new_from_vcard().
We definitely free the contact, so I'm fairly sure that it is not
our code leaking the memory => suppressing the report.
2010-09-08 15:52:16 +08:00
Patrick Ohly
ce198f75f3 syncevo-dbus-server: fixed compile issue with libsoup disabled (MBC #6367)
Having libsoup disabled is not recommended when initiating HTTP
SyncML sessions in syncevo-dbus-server, although it may work
with libcurl when ignoring that the D-Bus server is unresponsive
while doing HTTP.

Compiling without libsoup and without libcurl is useful when
using syncevo-dbus-server as HTTP server.
2010-09-07 17:03:34 +02:00
Patrick Ohly
3062c42935 documentation: extended description of "sync" property (MBC #6373)
The role of the "sync" property depends on the way how the sync
is started. Added some comments about HTTP server and SAN initiated
syncs.
2010-09-07 17:03:34 +02:00
Patrick Ohly
fd42ff95cb nightly testing: improved valgrind suppressions
Included some more stack wild cards because actual reports
in e_book_new_* did not quite match the patterns.

Added one suppressions for libical.
2010-09-07 22:04:55 +08:00
Patrick Ohly
e5c4bcace7 README: several improvements
Matthijs Kooijman recently started using SyncEvolution and took notes
about unclear explanations and missing information (--daemon!). This
useful feedback allowed to improve the documentation.
2010-09-06 18:08:19 +02:00
Patrick Ohly
abd74b72f2 EDS: revised workaround for D-Bus method timeouts (BMC #4026)
Using INT_MAX (= unlimited) as default D-Bus timeout seems
to trigger some untested code paths in system libs (use
of uninitialized memory in poll, increased leaks). Use
a large but finite timeout instead.
2010-09-06 23:48:38 +08:00
Patrick Ohly
9286d914c0 EDS: workaround for D-Bus method timeouts (BMC #4026)
libecal/ebook implementation based on D-Bus (Evolution >= 2.30)
inevitably will run into D-Bus timeouts as the amount of data
increases.

This patch moves an earlier hack written for Maemo into the core
code and enables it by default, if the EDS backends are active.
It works by intercepting dbus_connection_send_with_reply()
and substituting timeout_milliseconds==-1 ("default timeout
of 25 seconds") with timeout_milliseconds=INT_MAX ("no timeout").

Setting SYNCEVOLUTION_DBUS_TIMEOUT to number of milliseconds
allows controlling the final timeout value.
2010-09-03 15:40:05 +02:00
Patrick Ohly
a5e6f4840b evo.supp: updated suppressions for libical (BMC #6275)
valgrind suppressions for upstream libical. Similar to what we
had there already. Still need to investigate and report this upstream.
2010-09-03 11:27:50 +02:00
Patrick Ohly
9a9a2574eb nightly testing: adapted synccompare to mkcal
mkcal showed a difference in Client::Source::ical20::testImport
which can be ignored:
- CLASS=PUBLIC is the default, doesn't have to be there
2010-09-02 14:38:12 +02:00
Patrick Ohly
44ef5a385b nightly testing: log report generation functions
Instead of calling os.system() directly, use "runCommand()". That logs
the command to stdout and checks the result.
2010-09-02 13:49:24 +02:00
Patrick Ohly
b715ba1601 nightly testing: reorder columns so that valgrind and overall result come first
The tables got fairly large, requiring scrolling to see the real information
(overall success and valgrind errors). This patch moves these columns to the left
where they are visible by default.
2010-09-02 13:49:24 +02:00
Patrick Ohly
5a4c91382c nightly testing: added a column for "network failure"
This column is useful to determine at a glance whether tests
failed because of something outside of our control. The value
is also shown for each single test.
2010-09-02 13:48:46 +02:00
Patrick Ohly
97426b498e nightly testing: disable testDeleteAllRefresh for Google
The test depends on "refresh from client" semantic, something that
Google doesn't support.
2010-09-02 13:48:22 +02:00
Patrick Ohly
d20cbf9428 nightly testing: only include services in report which actually were active
The code added all services to the list which it encountered, including
those which were disabled and thus got skipped during testing. This
artificially increased the size of the report; not even sure whether
this was intentional. Now only active services are added.
2010-09-02 13:48:05 +02:00
Patrick Ohly
856e291844 Nokia phones: alarm times in UTC, sending PHOTO (BMC #1657, #5860)
Introduced a new remote rule for all devices made by Nokia. In that
rule, we set certain defaults which turned out to be useful for
a variety of existing phones:
- send alarm times in UTC (BMC #1657)
- ignore the incorrect 256 bytes size limit for PHOTOs
  and other properties (BMC #5860)

Should a specific model require different values, then a rule for
it after the initial 00_nokia.xml can override the defaults.
2010-09-01 18:44:02 +02:00
Patrick Ohly
b7d9f26f69 nightly testing: fixed caching of Evolution sources (BMC #5864)
"text" stands for Evolution memos and depends on
EvolutionCalendarSource. Added.

The name lookup differs for local and for sync indices, must do
the name lookup before calling checkEvolutionSource(). Fixed.
2010-09-01 18:05:27 +02:00
Patrick Ohly
19f703588f nightly testing: avoid shutdown issues due to caching Evolution sources (BMC #5864)
Destroying ORBit based Evolution backends at the very end of the
process life time caused assertions in ORBit. Added explicit cleanup
code which is called before triggering the normal library shutdown by
leaving main().
2010-09-01 18:01:19 +02:00
Patrick Ohly
b6e11b7652 KCalExtended: use "mkcal" as generic type name
Follow the KCalExtended -> mkcal rename. KCalExtended is
still accepted as an alias.
2010-09-01 16:06:16 +02:00
Patrick Ohly
815ca3fa98 KCalExtended: adapted "update" code patch to new API
The code had not been updated yet. To get it to compile,
a work around for BMC #6181 (upcasting to IncidenceBase)
was needed.
2010-09-01 16:03:47 +02:00
Patrick Ohly
7071f941cd command line: use % as escape character for luids
The command line, like a lot of other code, used the escape/unescape
code in SafeConfigNode. For historic reasons, that code used ! as
escape character, which is awkward for the command line, because
that is a special character.

Instead of further overloading the SafeConfigNode, this patch moves
the escape/unescape code into its own utility class. This is the
cleaner approach anyway. It also adds unit testing for the code.

All other users of the old code are updated. Care must be taken here
to not accidentally switch to a different escape mechanism, because
the mechanism must remain compatible with the old implementation.
2010-09-01 15:59:48 +02:00
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
8b6302badc Merge branch 'master', remote branch 'origin' 2010-08-31 10:09:44 +02:00
Patrick Ohly
96722196ef nightly testing: allow enabling valgrind for "prebuilt" test (BMC #1007)
--enable evolution=foo parameters are used for --enable prebuilt-bar,
but without also enabling native Evolution tests.
2010-08-31 15:52:47 +08: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
4db5fc14b6 testing: fixed "make dist" issue
The new templates had not been included in file list...
2010-08-30 16:29:36 +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
bd32d1faa9 syncevo-phone-config: set consumerReady in output (BMC #3803)
None of the config templates added to the wiki contain the "consumerReady"
flag. Therefore they don't show up in the sync-ui once a user follows the
instructions for downloading them.

The tool now adds the flag automatically, because a user who downloads
the template does so in order to use it, regardless whether it is
ready or not (which we haven't defined anyway for phones).
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