libresapilocal is now optional (enabled by default)

This commit is contained in:
Gio 2016-07-14 22:48:44 +02:00
parent 47414acb62
commit b5f95cb651
4 changed files with 27 additions and 7 deletions

View File

@ -3,8 +3,7 @@
TEMPLATE = lib
CONFIG += staticlib
CONFIG += create_prl
CONFIG += qt
QT += network
CONFIG -= qt
TARGET = resapi
TARGET_PRL = libresapi
DESTDIR = lib
@ -147,8 +146,7 @@ SOURCES += \
api/TmpBlobStore.cpp \
util/ContentTypes.cpp \
api/ApiPluginHandler.cpp \
api/ChannelsHandler.cpp \
api/ApiServerLocal.cpp
api/ChannelsHandler.cpp
HEADERS += \
api/ApiServer.h \
@ -174,5 +172,11 @@ HEADERS += \
api/TmpBlobStore.h \
util/ContentTypes.h \
api/ApiPluginHandler.h \
api/ChannelsHandler.h \
api/ApiServerLocal.h
api/ChannelsHandler.h
libresapilocalserver {
CONFIG *= qt
QT *= network
SOURCES *= api/ApiServerLocal.cpp
HEADERS *= api/ApiServerLocal.h
}

View File

@ -15,7 +15,10 @@
resource_api::ApiServer* WebuiPage::apiServer = 0;
resource_api::ApiServerMHD* WebuiPage::apiServerMHD = 0;
// TODO: LIBRESAPI_LOCAL_SERVER Move in appropriate place
#ifdef LIBRESAPI_LOCAL_SERVER
resource_api::ApiServerLocal* WebuiPage::apiServerLocal = 0;
#endif
resource_api::RsControlModule* WebuiPage::controlModule = 0;
WebuiPage::WebuiPage(QWidget */*parent*/, Qt::WindowFlags /*flags*/)
@ -95,8 +98,10 @@ QString WebuiPage::helpText() const
Settings->getWebinterfaceAllowAllIps());
apiServerMHD->start();
// TODO: LIBRESAPI_LOCAL_SERVER Move in appropriate place
#ifdef LIBRESAPI_LOCAL_SERVER
apiServerLocal = new resource_api::ApiServerLocal(apiServer);
#endif
return ok;
}
@ -107,8 +112,11 @@ QString WebuiPage::helpText() const
apiServerMHD->stop();
delete apiServerMHD;
apiServerMHD = 0;
// TODO: LIBRESAPI_LOCAL_SERVER Move in appropriate place
#ifdef LIBRESAPI_LOCAL_SERVER
delete apiServerLocal;
apiServerLocal = 0;
#endif
delete apiServer;
apiServer = 0;
delete controlModule;

View File

@ -49,6 +49,8 @@ private:
static resource_api::ApiServer* apiServer;
static resource_api::ApiServerMHD* apiServerMHD;
#ifdef LIBRESAPI_LOCAL_SERVER
static resource_api::ApiServerLocal* apiServerLocal;
#endif
static resource_api::RsControlModule* controlModule;
};

View File

@ -1,3 +1,7 @@
# To {dis,en}able libresapi via local socket (unix domain socket or windows named pipes)
# {,un}comment the following line
CONFIG *= libresapilocalserver
# Gxs is always enabled now.
DEFINES *= RS_ENABLE_GXS
@ -62,3 +66,5 @@ unfinished {
}
wikipoos:DEFINES *= RS_USE_WIKI
libresapilocalserver:DEFINES *= LIBRESAPI_LOCAL_SERVER