subsurface/desktop-widgets/plugins/facebook/facebook_integration.cpp
Tomaz Canabrava 15c4fadde9 [Facebook] Use the nonblocking calls to post on fb
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-10-02 08:54:03 -07:00

44 lines
828 B
C++

// SPDX-License-Identifier: GPL-2.0
#include "facebook_integration.h"
#include "facebookconnectwidget.h"
#include <QDebug>
FacebookPlugin::FacebookPlugin(QObject* parent) :
fbConnectWidget(new FacebookConnectWidget())
{
Q_UNUSED(parent)
}
bool FacebookPlugin::isConnected()
{
FacebookManager *instance = FacebookManager::instance();
return instance->loggedIn();
}
void FacebookPlugin::requestLogin()
{
fbConnectWidget->exec();
}
void FacebookPlugin::requestLogoff()
{
FacebookManager::instance()->logout();
}
QString FacebookPlugin::socialNetworkIcon() const
{
return QString();
}
QString FacebookPlugin::socialNetworkName() const
{
return tr("Facebook");
}
void FacebookPlugin::requestUpload()
{
FacebookManager *instance = FacebookManager::instance();
if (instance->loggedIn())
instance->sendDiveInit();
}