Make Facebook support a config option

By default it is turned off, turn on by calling qmake with
CONFIG+=FBSUPPORT.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2015-01-17 08:43:49 +13:00
parent 0d619d569b
commit abddb3ecb9
3 changed files with 23 additions and 9 deletions

View file

@ -16,7 +16,10 @@
#include "qthelper.h"
#include "display.h"
#include "divepicturewidget.h"
#if defined(FBSUPPORT)
#include "socialnetworks.h"
#endif
#include <QLabel>
#include <QCompleter>
@ -190,11 +193,15 @@ MainTab::MainTab(QWidget *parent) : QTabWidget(parent),
ui.photosView->setSelectionMode(QAbstractItemView::SingleSelection);
connect(deletePhoto, SIGNAL(triggered(bool)), this, SLOT(removeSelectedPhotos()));
#if defined(FBSUPPORT)
FacebookManager *fb = FacebookManager::instance();
connect(fb, &FacebookManager::justLoggedIn, ui.facebookPublish, &QPushButton::show);
connect(fb, &FacebookManager::justLoggedOut, ui.facebookPublish, &QPushButton::hide);
connect(ui.facebookPublish, &QPushButton::clicked, fb, &FacebookManager::sendDive);
ui.facebookPublish->setVisible(fb->loggedIn());
#else
ui.facebookPublish->setVisible(false);
#endif
acceptingEdit = false;
}