summaryrefslogtreecommitdiffstats
path: root/desktop-widgets/plugins/facebook/facebook_integration.cpp
blob: b07d78f661bf568008f68370dd309eb34a278df8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#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->sendDive();
}