Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[sociald] Add Google Signon sync adaptor. Contributes to JB#16337
This commit adds a sync adapter which periodically forces a refresh of the Google account credentials, to avoid the situation where user interaction (via webview) is required to be able to continue to use the account. Contributes to JB#16337
- Loading branch information
Chris Adams
committed
Apr 16, 2014
1 parent
4edb44a
commit f5b8da1
Showing
10 changed files
with
485 additions
and
1 deletion.
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,4 @@ | ||
SOURCES += $$PWD/googlesignonsyncadaptor.cpp | ||
HEADERS += $$PWD/googlesignonsyncadaptor.h | ||
INCLUDEPATH += $$PWD | ||
|
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,27 @@ | ||
TEMPLATE = lib | ||
|
||
TARGET = google-signon-client | ||
VERSION = 0.0.1 | ||
CONFIG += plugin | ||
|
||
include($$PWD/../../common.pri) | ||
include($$PWD/../google-common.pri) | ||
include($$PWD/google-signon.pri) | ||
|
||
target.path += /usr/lib/buteo-plugins-qt5 | ||
google_signon_sync_profile.path = /etc/buteo/profiles/sync | ||
google_signon_sync_profile.files = $$PWD/google.Signon.xml | ||
google_signon_client_plugin_xml.path = /etc/buteo/profiles/client | ||
google_signon_client_plugin_xml.files = $$PWD/google-signon.xml | ||
|
||
HEADERS += googlesignonplugin.h | ||
SOURCES += googlesignonplugin.cpp | ||
|
||
OTHER_FILES += \ | ||
google_signon_sync_profile.files \ | ||
google_signon_client_plugin_xml.files | ||
|
||
INSTALLS += \ | ||
target \ | ||
google_signon_sync_profile \ | ||
google_signon_client_plugin_xml |
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,4 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<profile name="google-signon" type="client" > | ||
<field name="Sync Direction" /> | ||
</profile> |
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,15 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<profile name="google.Signon" type="sync" > | ||
<key name="category" value="signon" /> | ||
<key name="enabled" value="true" /> | ||
<key name="use_accounts" value="false" /> | ||
<key name="destinationtype" value="online" /> | ||
<key name="hidden" value="true" /> | ||
<key name="displayname" value="Google Signon"/> | ||
|
||
<schedule enabled="false" interval="90" days="1,2,3,4,5,6,7" syncconfiguredtime="" time="" /> | ||
|
||
<profile name="google-signon" type="client" > | ||
<key name="Sync Direction" value="from-remote" /> | ||
</profile> | ||
</profile> |
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,40 @@ | ||
/**************************************************************************** | ||
** | ||
** Copyright (C) 2014 Jolla Ltd. | ||
** Contact: Chris Adams <chris.adams@jolla.com> | ||
** | ||
****************************************************************************/ | ||
|
||
#include "googlesignonplugin.h" | ||
#include "googlesignonsyncadaptor.h" | ||
#include "socialnetworksyncadaptor.h" | ||
|
||
extern "C" GoogleSignonPlugin* createPlugin(const QString& pluginName, | ||
const Buteo::SyncProfile& profile, | ||
Buteo::PluginCbInterface *callbackInterface) | ||
{ | ||
return new GoogleSignonPlugin(pluginName, profile, callbackInterface); | ||
} | ||
|
||
extern "C" void destroyPlugin(GoogleSignonPlugin* plugin) | ||
{ | ||
delete plugin; | ||
} | ||
|
||
GoogleSignonPlugin::GoogleSignonPlugin(const QString& pluginName, | ||
const Buteo::SyncProfile& profile, | ||
Buteo::PluginCbInterface *callbackInterface) | ||
: SocialdButeoPlugin(pluginName, profile, callbackInterface, | ||
QStringLiteral("google"), | ||
SocialNetworkSyncAdaptor::dataTypeName(SocialNetworkSyncAdaptor::Signon)) | ||
{ | ||
} | ||
|
||
GoogleSignonPlugin::~GoogleSignonPlugin() | ||
{ | ||
} | ||
|
||
SocialNetworkSyncAdaptor *GoogleSignonPlugin::createSocialNetworkSyncAdaptor() | ||
{ | ||
return new GoogleSignonSyncAdaptor(this); | ||
} |
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,34 @@ | ||
/**************************************************************************** | ||
** | ||
** Copyright (C) 2014 Jolla Ltd. | ||
** Contact: Chris Adams <chris.adams@jolla.com> | ||
** | ||
****************************************************************************/ | ||
|
||
#ifndef GOOGLESIGNONPLUGIN_H | ||
#define GOOGLESIGNONPLUGIN_H | ||
|
||
#include "socialdbuteoplugin.h" | ||
#include <ClientPlugin.h> | ||
|
||
class GoogleSignonPlugin : public SocialdButeoPlugin | ||
{ | ||
Q_OBJECT | ||
|
||
public: | ||
GoogleSignonPlugin(const QString& pluginName, | ||
const Buteo::SyncProfile& profile, | ||
Buteo::PluginCbInterface *cbInterface); | ||
~GoogleSignonPlugin(); | ||
|
||
protected: | ||
SocialNetworkSyncAdaptor *createSocialNetworkSyncAdaptor(); | ||
}; | ||
|
||
extern "C" GoogleSignonPlugin* createPlugin(const QString& pluginName, | ||
const Buteo::SyncProfile& profile, | ||
Buteo::PluginCbInterface *cbInterface); | ||
|
||
extern "C" void destroyPlugin(GoogleSignonPlugin* client); | ||
|
||
#endif // GOOGLESIGNONPLUGIN_H |
Oops, something went wrong.