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.
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.
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.
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.
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.
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.
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.