2017-04-27 18:26:05 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0
|
2015-10-29 23:47:08 +00:00
|
|
|
#include "facebook_integration.h"
|
2015-11-08 12:51:50 +00:00
|
|
|
#include "facebookconnectwidget.h"
|
|
|
|
|
|
|
|
#include <QDebug>
|
2015-10-29 23:47:08 +00:00
|
|
|
|
2015-11-09 20:14:20 +00:00
|
|
|
FacebookPlugin::FacebookPlugin(QObject* parent) :
|
2016-12-20 20:40:31 +00:00
|
|
|
fbConnectWidget(new FacebookConnectWidget())
|
2015-10-29 23:47:08 +00:00
|
|
|
{
|
2016-03-10 04:42:33 +00:00
|
|
|
Q_UNUSED(parent)
|
2015-10-29 23:47:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool FacebookPlugin::isConnected()
|
|
|
|
{
|
2015-11-08 13:50:04 +00:00
|
|
|
FacebookManager *instance = FacebookManager::instance();
|
|
|
|
return instance->loggedIn();
|
2015-10-29 23:47:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void FacebookPlugin::requestLogin()
|
|
|
|
{
|
2015-11-08 13:50:04 +00:00
|
|
|
fbConnectWidget->exec();
|
2015-10-29 23:47:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void FacebookPlugin::requestLogoff()
|
|
|
|
{
|
2015-11-08 13:50:04 +00:00
|
|
|
FacebookManager::instance()->logout();
|
2015-10-29 23:47:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
QString FacebookPlugin::socialNetworkIcon() const
|
|
|
|
{
|
|
|
|
return QString();
|
|
|
|
}
|
|
|
|
|
|
|
|
QString FacebookPlugin::socialNetworkName() const
|
|
|
|
{
|
|
|
|
return tr("Facebook");
|
|
|
|
}
|
|
|
|
|
2015-11-08 12:58:59 +00:00
|
|
|
void FacebookPlugin::requestUpload()
|
2015-10-29 23:47:08 +00:00
|
|
|
{
|
2015-11-08 13:50:04 +00:00
|
|
|
FacebookManager *instance = FacebookManager::instance();
|
|
|
|
if (instance->loggedIn())
|
2017-10-02 12:35:36 +00:00
|
|
|
instance->sendDiveInit();
|
2015-10-29 23:47:08 +00:00
|
|
|
}
|