Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[sociald] Add VK images sync adaptor. Contributes to JB#19274
This commit adds a sync adapter to retrieve photo metadata from VK for the user. This data is added to the libsocialcache vk images database, to be displayed in the gallery application. Contributes to JB#19274
- Loading branch information
Chris Adams
authored and
Antti Seppälä
committed
Oct 12, 2015
1 parent
83cd9f2
commit 291e6ca
Showing
11 changed files
with
748 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
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/vkimagesyncadaptor.cpp | ||
HEADERS += $$PWD/vkimagesyncadaptor.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,25 @@ | ||
TARGET = vk-images-client | ||
VERSION = 0.0.1 | ||
|
||
DEFINES += "CLASSNAME=VKImagesPlugin" | ||
DEFINES += CLASSNAME_H=\\\"vkimagesplugin.h\\\" | ||
include($$PWD/../../common.pri) | ||
include($$PWD/../vk-common.pri) | ||
include($$PWD/vk-images.pri) | ||
|
||
vk_images_sync_profile.path = /etc/buteo/profiles/sync | ||
vk_images_sync_profile.files = $$PWD/vk.Images.xml | ||
vk_images_client_plugin_xml.path = /etc/buteo/profiles/client | ||
vk_images_client_plugin_xml.files = $$PWD/vk-images.xml | ||
|
||
HEADERS += vkimagesplugin.h | ||
SOURCES += vkimagesplugin.cpp | ||
|
||
OTHER_FILES += \ | ||
vk_images_sync_profile.files \ | ||
vk_images_client_plugin_xml.files | ||
|
||
INSTALLS += \ | ||
target \ | ||
vk_images_sync_profile \ | ||
vk_images_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="vk-images" 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="vk.Images" type="sync" > | ||
<key name="category" value="vk.Images" /> | ||
<key name="enabled" value="false" /> | ||
<key name="use_accounts" value="false" /> | ||
<key name="destinationtype" value="online" /> | ||
<key name="hidden" value="true" /> | ||
<key name="displayname" value="VKontakte Images"/> | ||
|
||
<schedule enabled="false" interval="" days="1,2,3,4,5,6,7" syncconfiguredtime="" time="05:00:00" /> | ||
|
||
<profile name="vk-images" 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,54 @@ | ||
/**************************************************************************** | ||
** | ||
** Copyright (C) 2015 Jolla Ltd. | ||
** Contact: Chris Adams <chris.adams@jolla.com> | ||
** | ||
** This program/library is free software; you can redistribute it and/or | ||
** modify it under the terms of the GNU Lesser General Public License | ||
** version 2.1 as published by the Free Software Foundation. | ||
** | ||
** This program/library is distributed in the hope that it will be useful, | ||
** but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
** Lesser General Public License for more details. | ||
** | ||
** You should have received a copy of the GNU Lesser General Public | ||
** License along with this program/library; if not, write to the Free | ||
** Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | ||
** 02110-1301 USA | ||
** | ||
****************************************************************************/ | ||
|
||
#include "vkimagesplugin.h" | ||
#include "vkimagesyncadaptor.h" | ||
#include "socialnetworksyncadaptor.h" | ||
|
||
extern "C" VKImagesPlugin* createPlugin(const QString& pluginName, | ||
const Buteo::SyncProfile& profile, | ||
Buteo::PluginCbInterface *callbackInterface) | ||
{ | ||
return new VKImagesPlugin(pluginName, profile, callbackInterface); | ||
} | ||
|
||
extern "C" void destroyPlugin(VKImagesPlugin* plugin) | ||
{ | ||
delete plugin; | ||
} | ||
|
||
VKImagesPlugin::VKImagesPlugin(const QString& pluginName, | ||
const Buteo::SyncProfile& profile, | ||
Buteo::PluginCbInterface *callbackInterface) | ||
: SocialdButeoPlugin(pluginName, profile, callbackInterface, | ||
QStringLiteral("vk"), | ||
SocialNetworkSyncAdaptor::dataTypeName(SocialNetworkSyncAdaptor::Images)) | ||
{ | ||
} | ||
|
||
VKImagesPlugin::~VKImagesPlugin() | ||
{ | ||
} | ||
|
||
SocialNetworkSyncAdaptor *VKImagesPlugin::createSocialNetworkSyncAdaptor() | ||
{ | ||
return new VKImageSyncAdaptor(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,47 @@ | ||
/**************************************************************************** | ||
** | ||
** Copyright (C) 2015 Jolla Ltd. | ||
** Contact: Chris Adams <chris.adams@jolla.com> | ||
** | ||
** This program/library is free software; you can redistribute it and/or | ||
** modify it under the terms of the GNU Lesser General Public License | ||
** version 2.1 as published by the Free Software Foundation. | ||
** | ||
** This program/library is distributed in the hope that it will be useful, | ||
** but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
** Lesser General Public License for more details. | ||
** | ||
** You should have received a copy of the GNU Lesser General Public | ||
** License along with this program/library; if not, write to the Free | ||
** Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | ||
** 02110-1301 USA | ||
** | ||
****************************************************************************/ | ||
|
||
#ifndef VKIMAGESPLUGIN_H | ||
#define VKIMAGESPLUGIN_H | ||
|
||
#include "socialdbuteoplugin.h" | ||
|
||
class SOCIALDBUTEOPLUGIN_EXPORT VKImagesPlugin : public SocialdButeoPlugin | ||
{ | ||
Q_OBJECT | ||
|
||
public: | ||
VKImagesPlugin(const QString& pluginName, | ||
const Buteo::SyncProfile& profile, | ||
Buteo::PluginCbInterface *cbInterface); | ||
~VKImagesPlugin(); | ||
|
||
protected: | ||
SocialNetworkSyncAdaptor *createSocialNetworkSyncAdaptor(); | ||
}; | ||
|
||
extern "C" VKImagesPlugin* createPlugin(const QString& pluginName, | ||
const Buteo::SyncProfile& profile, | ||
Buteo::PluginCbInterface *cbInterface); | ||
|
||
extern "C" void destroyPlugin(VKImagesPlugin* client); | ||
|
||
#endif // VKIMAGESPLUGIN_H |
Oops, something went wrong.