Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[sociald] Support syncing Google contacts. Contributes to JB#4698
This commit ports the buteo-sync-plugin-google-simple plugin into the sociald infrastructure in order to support multiple accounts and to properly cleanup data on account removal. Contributes to JB#4698 and JB#8747 and JB#10453
- Loading branch information
Chris Adams
committed
Oct 8, 2013
1 parent
70e21fd
commit a49eb8a
Showing
13 changed files
with
1,577 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
INCLUDEPATH += . .. | ||
|
||
PKGCONFIG += qtcontacts-sqlite-qt5-extensions | ||
|
||
SOURCES += \ | ||
$$PWD/googledatatypesyncadaptor.cpp \ | ||
$$PWD/googlecontactsyncadaptor.cpp \ | ||
$$PWD/googlecontactstream.cpp \ | ||
$$PWD/googlecontactatom.cpp | ||
|
||
HEADERS += \ | ||
$$PWD/googledatatypesyncadaptor.h \ | ||
$$PWD/googlecontactsyncadaptor.h \ | ||
$$PWD/googlecontactstream.h \ | ||
$$PWD/googlecontactatom.h \ | ||
$$PWD/googlecontactatom_global.h | ||
|
||
OTHER_FILES += google_sync_profiles.files | ||
|
||
# google buteo sync profiles | ||
google_sync_profiles.path = /etc/buteo/profiles/sync | ||
google_sync_profiles.files = $$PWD/../xml/sync/google.Contacts.xml | ||
|
||
INSTALLS += google_sync_profiles |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,151 @@ | ||
/**************************************************************************** | ||
** | ||
** Copyright (C) 2013 Jolla Ltd. and/or its subsidiary(-ies). | ||
** Contact: Chris Adams <chris.adams@jollamobile.com> | ||
** | ||
** Contributors: Sateesh Kavuri <sateesh.kavuri@gmail.com> | ||
** Mani Chandrasekar <maninc@gmail.com> | ||
** Chris Adams <chris.adams@jollamobile.com> | ||
** | ||
****************************************************************************/ | ||
|
||
#include "googlecontactatom.h" | ||
#include <LogMacros.h> | ||
|
||
GoogleContactAtom::GoogleContactAtom() | ||
{ | ||
} | ||
|
||
void GoogleContactAtom::setAuthorEmail(const QString &authorEmail) | ||
{ | ||
mAuthorEmail = authorEmail; | ||
} | ||
|
||
QString GoogleContactAtom::authorEmail() const | ||
{ | ||
return mAuthorEmail; | ||
} | ||
|
||
void GoogleContactAtom::setAuthorName(const QString &authorName) | ||
{ | ||
mAuthorName = authorName; | ||
} | ||
|
||
QString GoogleContactAtom::authorName() const | ||
{ | ||
return mAuthorName; | ||
} | ||
|
||
void GoogleContactAtom::setId(const QString &id) | ||
{ | ||
mId = id; | ||
} | ||
|
||
QString GoogleContactAtom::id() const | ||
{ | ||
return mId; | ||
} | ||
|
||
void GoogleContactAtom::setUpdated(const QString &updated) | ||
{ | ||
mUpdated = updated; | ||
} | ||
|
||
QString GoogleContactAtom::updated() const | ||
{ | ||
return mUpdated; | ||
} | ||
|
||
void GoogleContactAtom::setCategory (const QString &schema, const QString &term) | ||
{ | ||
Q_UNUSED(schema) | ||
Q_UNUSED(term) | ||
} | ||
|
||
void GoogleContactAtom::setTitle(const QString &title) | ||
{ | ||
mTitle = title; | ||
} | ||
|
||
QString GoogleContactAtom::title() const | ||
{ | ||
return mTitle; | ||
} | ||
|
||
void GoogleContactAtom::setGenerator(const QString &name, const QString &version, const QString &uri) | ||
{ | ||
mGeneratorName = name; | ||
mGeneratorVersion = version; | ||
mGeneratorUri = uri; | ||
} | ||
|
||
void GoogleContactAtom::setContent (const QString ¬e, const QString &type) | ||
{ | ||
Q_UNUSED(note) | ||
Q_UNUSED(type) | ||
} | ||
|
||
QString GoogleContactAtom::generatorName() const | ||
{ | ||
return mGeneratorName; | ||
} | ||
|
||
QString GoogleContactAtom::generatorVersion() const | ||
{ | ||
return mGeneratorVersion; | ||
} | ||
|
||
QString GoogleContactAtom::generatorUri() const | ||
{ | ||
return mGeneratorUri; | ||
} | ||
|
||
void GoogleContactAtom::setTotalResults(int totalResults) | ||
{ | ||
mTotalResults = totalResults; | ||
} | ||
|
||
int GoogleContactAtom::totalResults() const | ||
{ | ||
return mTotalResults; | ||
} | ||
|
||
void GoogleContactAtom::setStartIndex(int startIndex) | ||
{ | ||
mStartIndex = startIndex; | ||
} | ||
|
||
int GoogleContactAtom::startIndex() const | ||
{ | ||
return mStartIndex; | ||
} | ||
|
||
void GoogleContactAtom::setItemsPerPage(int itemsPerPage) | ||
{ | ||
mItemsPerPage = itemsPerPage; | ||
} | ||
|
||
int GoogleContactAtom::itemsPerPage() const | ||
{ | ||
return mItemsPerPage; | ||
} | ||
|
||
void GoogleContactAtom::addEntryContact(const QContact &entryContact) | ||
{ | ||
mContactList.append(entryContact); | ||
} | ||
|
||
QList<QContact> GoogleContactAtom::entryContacts() const | ||
{ | ||
return mContactList; | ||
} | ||
|
||
void GoogleContactAtom::setNextEntriesUrl(const QString &nextUrl) | ||
{ | ||
mNextEntriesUrl = nextUrl; | ||
} | ||
|
||
QString GoogleContactAtom::nextEntriesUrl() const | ||
{ | ||
return mNextEntriesUrl; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
/**************************************************************************** | ||
** | ||
** Copyright (C) 2013 Jolla Ltd. and/or its subsidiary(-ies). | ||
** Contact: Chris Adams <chris.adams@jollamobile.com> | ||
** | ||
** Contributors: Sateesh Kavuri <sateesh.kavuri@gmail.com> | ||
** Chris Adams <chris.adams@jollamobile.com> | ||
** | ||
****************************************************************************/ | ||
|
||
#ifndef GOOGLECONTACTATOM_H | ||
#define GOOGLECONTACTATOM_H | ||
|
||
#include <QMetaEnum> | ||
#include <QMap> | ||
#include <QList> | ||
#include <QXmlStreamWriter> | ||
|
||
#include <QContact> | ||
|
||
USE_CONTACTS_NAMESPACE | ||
|
||
class GoogleContactAtom { | ||
public: | ||
GoogleContactAtom (); | ||
|
||
typedef enum | ||
{ | ||
text, | ||
html, | ||
xhtml | ||
} TYPE; | ||
|
||
void setAuthorName(const QString &authorName); | ||
QString authorName() const; | ||
|
||
void setAuthorEmail(const QString &authorEmail); | ||
QString authorEmail() const; | ||
|
||
void setId(const QString &id); | ||
QString id() const; | ||
|
||
void setUpdated(const QString &updated); | ||
QString updated() const; | ||
|
||
void setCategory (const QString &schema = QLatin1String("http://schemas.google.com/g/2005#kind"), | ||
const QString &term = QLatin1String("http://schemas.google.com/contact/2008#contact")); | ||
|
||
void setTitle(const QString &title); | ||
QString title() const; | ||
|
||
void setContent (const QString ¬e, const QString &type = QLatin1String("text")); | ||
|
||
void setGenerator(const QString &name = QLatin1String("Contacts"), | ||
const QString &version = QLatin1String("1.0"), | ||
const QString &uri = QLatin1String("http://sailfish.org")); | ||
QString generatorName() const; | ||
QString generatorVersion() const; | ||
QString generatorUri() const; | ||
|
||
void setTotalResults(int totalResults); | ||
int totalResults() const; | ||
|
||
void setStartIndex(int startIndex); | ||
int startIndex() const; | ||
|
||
void setItemsPerPage(int itemsPerPage); | ||
int itemsPerPage() const; | ||
|
||
void addEntryContact(const QContact &contact); | ||
QList<QContact> entryContacts() const; | ||
|
||
void setNextEntriesUrl (const QString &nextUrl); | ||
QString nextEntriesUrl() const; | ||
|
||
private: | ||
QString mAuthorEmail; | ||
QString mAuthorName; | ||
QString mCategory; | ||
QString mCategoryTerm; | ||
QString mSchema; | ||
QString mContributor; | ||
QString mGeneratorName; | ||
QString mGeneratorVersion; | ||
QString mGeneratorUri; | ||
QString mIcon; | ||
QString mId; | ||
QString mLink; | ||
QString mLogo; | ||
QString mRights; | ||
QString mSubtitle; | ||
QString mTitle; | ||
QString mUpdated; | ||
|
||
int mTotalResults; | ||
int mStartIndex; | ||
int mItemsPerPage; | ||
|
||
QList<QContact> mContactList; | ||
QString mNextEntriesUrl; | ||
}; | ||
|
||
#endif // GOOGLECONTACTATOM_H |
Oops, something went wrong.