Commit 2bffc30f authored by Aline Gondim Santos's avatar Aline Gondim Santos

fix windows build

Change-Id: Ie03359a3550c39e9d223e4e8aee2bcc664d454aa
parent f1963250
......@@ -81,6 +81,13 @@ FIND_PACKAGE(Qt5LinguistTools) # translations
FIND_PACKAGE(Qt5Sql REQUIRED)
FIND_PACKAGE(Qt5Gui REQUIRED)
IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
MESSAGE(STATUS "PLUGIN enabled")
SET(ENABLE_PLUGIN 0 CACHE BOOLEAN "Enable plugin")
SET(ENABLE_PLUGIN true)
add_definitions( -DENABLE_PLUGIN=true )
ENDIF()
IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux" AND NOT ENABLE_LIBWRAP)
FIND_PACKAGE(Qt5DBus)
ELSE()
......@@ -238,11 +245,10 @@ IF(NOT (${ENABLE_VIDEO} MATCHES false))
add_definitions( -DENABLE_VIDEO=true )
ENDIF(NOT (${ENABLE_VIDEO} MATCHES false))
IF(NOT (${ENABLE_PLUGIN} MATCHES false))
MESSAGE(STATUS "PLUGIN enabled")
SET(ENABLE_PLUGIN 1 CACHE BOOLEAN "Enable plugin")
add_definitions( -DENABLE_PLUGIN=true )
ENDIF(NOT (${ENABLE_PLUGIN} MATCHES false))
IF(NOT (${ENABLE_PLUGIN} MATCHES true))
MESSAGE(STATUS "PLUGIN disabled")
SET(ENABLE_PLUGIN 0 CACHE BOOLEAN "Disable plugin")
ENDIF(NOT (${ENABLE_PLUGIN} MATCHES true))
# ADD_DEFINITIONS(-DQT_DISABLE_DEPRECATED_BEFORE=1)
......
......@@ -34,6 +34,12 @@ IF(NOT (${ENABLE_VIDEO} MATCHES "false"))
SET(ENABLE_VIDEO 1 CACHE BOOLEAN "Enable video")
ENDIF(NOT (${ENABLE_VIDEO} MATCHES "false"))
IF(NOT (${ENABLE_PLUGIN} MATCHES "true"))
MESSAGE("PLUGIN disabled")
ADD_DEFINITIONS(-DENABLE_PLUGIN=false)
SET(ENABLE_PLUGIN 0 CACHE BOOLEAN "Disable plugin")
ENDIF(NOT (${ENABLE_PLUGIN} MATCHES "true"))
INCLUDE_DIRECTORIES(SYSTEM ${Qt5Core_INCLUDE_DIRS} )
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
INCLUDE_DIRECTORIES(${ring_INCLUDE_DIRS})
......
......@@ -27,7 +27,9 @@
#include <QtCore/QTimer>
#include "typedefs.h"
#ifdef ENABLE_PLUGIN
#include <plugin_manager_interface.h>
#endif
#include "conversions_wrap.hpp"
......@@ -46,69 +48,121 @@ public Q_SLOTS: // METHODS
bool loadPlugin(const QString& path)
{
#ifdef ENABLE_PLUGIN
return DRing::loadPlugin(path.toStdString());
#else
return false;
#endif
}
bool unloadPlugin(const QString& path)
{
#ifdef ENABLE_PLUGIN
return DRing::unloadPlugin(path.toStdString());
#else
return false;
#endif
}
MapStringString getPluginDetails(const QString& path)
{
MapStringString temp =
convertMap(DRing::getPluginDetails(path.toStdString()));
#ifdef ENABLE_PLUGIN
return convertMap(DRing::getPluginDetails(path.toStdString()));
#else
MapStringString temp;
return temp;
#endif
}
QStringList listAvailablePlugins()
{
#ifdef ENABLE_PLUGIN
return convertStringList(DRing::listAvailablePlugins());
#else
QStringList temp;
return temp;
#endif
}
QStringList listLoadedPlugins()
{
#ifdef ENABLE_PLUGIN
return convertStringList(DRing::listLoadedPlugins());
#else
QStringList temp;
return temp;
#endif
}
int installPlugin(const QString& jplPath, bool force)
{
#ifdef ENABLE_PLUGIN
return DRing::installPlugin(jplPath.toStdString(), force);
#else
return 0;
#endif
}
int uninstallPlugin(const QString& pluginRootPath)
{
#ifdef ENABLE_PLUGIN
return DRing::uninstallPlugin(pluginRootPath.toStdString());
#else
return 0;
#endif
}
QStringList listCallMediaHandlers()
{
#ifdef ENABLE_PLUGIN
return convertStringList(DRing::listCallMediaHandlers());
#else
QStringList temp;
return temp;
#endif
}
void toggleCallMediaHandler(const QString& id, bool toggle)
{
#ifdef ENABLE_PLUGIN
DRing::toggleCallMediaHandler(id.toStdString(), toggle);
#endif
}
MapStringString getCallMediaHandlerStatus()
{
#ifdef ENABLE_PLUGIN
return convertMap(DRing::getCallMediaHandlerStatus());
#else
MapStringString temp;
return temp;
#endif
}
MapStringString getCallMediaHandlerDetails(const QString& id)
{
#ifdef ENABLE_PLUGIN
return convertMap(DRing::getCallMediaHandlerDetails(id.toStdString()));
#else
MapStringString temp;
return temp;
#endif
}
void setPluginsEnabled(bool enable)
{
#ifdef ENABLE_PLUGIN
DRing::setPluginsEnabled(enable);
#endif
}
bool getPluginsEnabled()
{
#ifdef ENABLE_PLUGIN
return DRing::getPluginsEnabled();
#else
return false;
#endif
}
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment