Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[buteo-sync-plugins-social] Implement Dropbox backup/restore sync plu…
…gin. Contributes to MER#1323 This commit implements a backup sync plugin for Dropbox. Contributes to MER#1323
- Loading branch information
Chris Adams
committed
Oct 9, 2015
1 parent
63beb7a
commit e8f4b7e
Showing
16 changed files
with
1,017 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
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,7 @@ | ||
CONFIG += link_pkgconfig | ||
PKGCONFIG += mlite5 | ||
|
||
SOURCES += $$PWD/dropboxbackupsyncadaptor.cpp | ||
HEADERS += $$PWD/dropboxbackupsyncadaptor.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 = dropbox-backup-client | ||
VERSION = 0.0.1 | ||
|
||
DEFINES += "CLASSNAME=DropboxBackupPlugin" | ||
DEFINES += CLASSNAME_H=\\\"dropboxbackupplugin.h\\\" | ||
include($$PWD/../../common.pri) | ||
include($$PWD/../dropbox-common.pri) | ||
include($$PWD/dropbox-backup.pri) | ||
|
||
dropbox_backup_sync_profile.path = /etc/buteo/profiles/sync | ||
dropbox_backup_sync_profile.files = $$PWD/dropbox.Backup.xml | ||
dropbox_backup_client_plugin_xml.path = /etc/buteo/profiles/client | ||
dropbox_backup_client_plugin_xml.files = $$PWD/dropbox-backup.xml | ||
|
||
HEADERS += dropboxbackupplugin.h | ||
SOURCES += dropboxbackupplugin.cpp | ||
|
||
OTHER_FILES += \ | ||
dropbox_backup_sync_profile.files \ | ||
dropbox_backup_client_plugin_xml.files | ||
|
||
INSTALLS += \ | ||
target \ | ||
dropbox_backup_sync_profile \ | ||
dropbox_backup_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="dropbox-backup" 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="dropbox.Backup" type="sync" > | ||
<key name="category" value="dropbox.Backup" /> | ||
<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="Dropbox Backup"/> | ||
|
||
<schedule enabled="false" interval="" days="1,2,3,4,5,6,7" syncconfiguredtime="" time="" /> | ||
|
||
<profile name="dropbox-backup" type="client" > | ||
<key name="Sync Direction" value="two-way" /> | ||
</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 "dropboxbackupplugin.h" | ||
#include "dropboxbackupsyncadaptor.h" | ||
#include "socialnetworksyncadaptor.h" | ||
|
||
extern "C" DropboxBackupPlugin* createPlugin(const QString& pluginName, | ||
const Buteo::SyncProfile& profile, | ||
Buteo::PluginCbInterface *callbackInterface) | ||
{ | ||
return new DropboxBackupPlugin(pluginName, profile, callbackInterface); | ||
} | ||
|
||
extern "C" void destroyPlugin(DropboxBackupPlugin* plugin) | ||
{ | ||
delete plugin; | ||
} | ||
|
||
DropboxBackupPlugin::DropboxBackupPlugin(const QString& pluginName, | ||
const Buteo::SyncProfile& profile, | ||
Buteo::PluginCbInterface *callbackInterface) | ||
: SocialdButeoPlugin(pluginName, profile, callbackInterface, | ||
QStringLiteral("dropbox"), | ||
SocialNetworkSyncAdaptor::dataTypeName(SocialNetworkSyncAdaptor::Backup)) | ||
{ | ||
} | ||
|
||
DropboxBackupPlugin::~DropboxBackupPlugin() | ||
{ | ||
} | ||
|
||
SocialNetworkSyncAdaptor *DropboxBackupPlugin::createSocialNetworkSyncAdaptor() | ||
{ | ||
return new DropboxBackupSyncAdaptor(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 DROPBOXBACKUPPLUGIN_H | ||
#define DROPBOXBACKUPPLUGIN_H | ||
|
||
#include "socialdbuteoplugin.h" | ||
|
||
class SOCIALDBUTEOPLUGIN_EXPORT DropboxBackupPlugin : public SocialdButeoPlugin | ||
{ | ||
Q_OBJECT | ||
|
||
public: | ||
DropboxBackupPlugin(const QString& pluginName, | ||
const Buteo::SyncProfile& profile, | ||
Buteo::PluginCbInterface *cbInterface); | ||
~DropboxBackupPlugin(); | ||
|
||
protected: | ||
SocialNetworkSyncAdaptor *createSocialNetworkSyncAdaptor(); | ||
}; | ||
|
||
extern "C" DropboxBackupPlugin* createPlugin(const QString& pluginName, | ||
const Buteo::SyncProfile& profile, | ||
Buteo::PluginCbInterface *cbInterface); | ||
|
||
extern "C" void destroyPlugin(DropboxBackupPlugin* client); | ||
|
||
#endif // DROPBOXBACKUPPLUGIN_H |
Oops, something went wrong.