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.
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.
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.
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.
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.
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.
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.
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
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.
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.
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.
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.
Matthijs Kooijman recently started using SyncEvolution and took notes
about unclear explanations and missing information (--daemon!). This
useful feedback allowed to improve the documentation.
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.
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.
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.
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.
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.
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.
"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.
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().
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.
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.
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.
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).
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.