Fixed some more attributes to be stored in GContactEntry, such as
additional name, locality etc. Dropped the idea of serializing a
QContact in GContactEntry and instead created a GWriteStream class that
handles serialization of a QContact to Google contact (in XML format).
Handled as many attributes as possible.

Signed-off-by: Sateesh Kavuri <sateesh@mobilitas.co>
Fixed issues with saving contacts to google in the various encoding
methods in GWriteStream. Created multiple methods to encode given
QContact or QContactLocalId to Google contact feed XML stream. Tested
with unit tests as well as with Google OAuth2 playground for saving
single as well as batch contacts

Signed-off-by: Sateesh Kavuri <sateesh@mobilitas.co>
A tedious effort to carefully implement 2-way sync mechanism. Finally
coding is done and the flow needs to be tested. Added a new GConfig
class to hold config parameters. Implemented the storing and retrieving
from server in batches of MAX_RESULTS (default=10). This will ensure
that there is no pressure on memory if there are large number of
contacts to be sync'd. Added support for slow and fast sync. In fast
sync, added support for conflict resolution (as per the policy set in
the profile XML). Had to fine tune the data structures used to hold the
content and their processing. Used the "link" attribute in the atom feed
to check if there are more entries to retrieve

Signed-off-by: Sateesh Kavuri <sateesh@mobilitas.co>
Fixed unit testcases as per the changes in the last patch.

Signed-off-by: Sateesh Kavuri <sateesh@mobilitas.co>
Removed the unused constructors in GTransport and also modified setting
the headers, url and query parameters in the request() method. This
helps in re-using the mTransport object in GContactClient. Moved
setting the "GData-Version: 3.0" header to the constructor, else, the
data is not being retrieved as per version 3.0. A startIndex counter is
used to keep track of number of requested entries. Using the url in
<link> throws a HTTP 403 error. Modified the signature of parse ()
method to take the xml buffer and return the GAtom object. Moved the
network configuration parameters to GConfig

Signed-off-by: Sateesh Kavuri <sateesh@mobilitas.co>
Fixed bugs in GWriteStream related to encoding of etag, anniversary and online
account

Signed-off-by: Sateesh Kavuri <sateesh@mobilitas.co>
Found two very weird bugs, one confirmed in Google and the other
possibly in Qt or Google. If a header key/value pair has a newline char,
then Google throws a "411" HTTP errors. This silly error literally took 2 days
of digging and finally figured that the auth token had a newline char
because of which POST requests were failing with a 411 error
(content-length required). Another Google bug (#3397) is that if
GDataVersion:3.0 is not the first header in the GET request, then the
data is not returned in 3.0 format.
While debugging these two issues, modified the GTransport mode, where
the transport object is created everytime, rather than being reused. In
the next commit, will go back to the reuse model of GTransport, instead
of re-creating it everytime.

Signed-off-by: Sateesh Kavuri <sateesh@mobilitas.co>
Added methods to handle error replies from the POST requests. Google
returns error messages in the <batch> tag for each error in creation of
an entry. These replies are not documented anywhere, so just checking
for the string "Error" in the title of the entry feed. With this patch,
slow sync between device and server works fine. Next step is to check
the fast sync scenarios

Signed-off-by: Sateesh Kavuri <sateesh@mobilitas.co>
Moved back to having a single instance of GTransport object rather than
to create one everytime of usage.

Signed-off-by: Sateesh Kavuri <sateesh@mobilitas.co>
Support for parsing photo url from a contact entry. Needs more work to
fetch the photos and also to upload photos.

Signed-off-by: Sateesh Kavuri <sateesh@mobilitas.co>
Added error codes and also status checks. Based on the status code and
error codes, emit a syncFinished to ensure that the plugin gets unloaded
properly.

Signed-off-by: Sateesh Kavuri <sateesh@mobilitas.co>
Fixed issues with timestamps in qtcontacts-tracker by a working of
adding 5secs to the sync result. Added method to store the local id to
google, so that the mapping between localId and guid can be done. With
this patch, 2-way fast sync works. qtcontacts-tracker does not support
the retrieval of deleted contacts(QDateTime) and so contacts deleted
locally cannot be deleted in remote server. Need to check this in
qtcontacts-sqlite

Signed-off-by: Sateesh Kavuri <sateesh@mobilitas.co>
Added support for storing avatars to server. First the contacts have to
be stored to the server and from the response, the id has to be used to
store the avatars. Currently, once the local data is modified with the
ids coming from the server, the extra data is erased (including the
avatar url). This needs to be fixed

Signed-off-by: Sateesh Kavuri <sateesh@mobilitas.co>
Moved from using qtcontacts-tracker to qtcontacts-sqlite backend.
Because of this move, following features will not be available:
1) Custom details are not supported by sqlite backend. Because of this,
any google specific fields will not be supported. Also etag which was
being stored as a custom field cannot be stored. Because of this
updates/deletes to server will not be supported. Added a DEFINES to
remove support for custom details as of now
2) sqlite backend does not support EventAdded, EventModified and also
does not update QContactTimestamp incase of updates. Because of this
slow-sync cannot be supported
3) Support for avatars is missing
Tested 2-way slow sync and it works fine.

Signed-off-by: Sateesh Kavuri <sateesh@mobilitas.co>
Added an rpm spec

Signed-off-by: Sateesh Kavuri <sateesh@mobilitas.co>
Merge branch 'master' of github.com:kavuri/buteo-sync-plugins-google into kavuri-master
Update packaging, update project files