Skip to content
Permalink
Browse files

Drop gui dependency from server

  • Loading branch information
m-kuhn committed Jul 7, 2017
1 parent 59d1f6d commit 4a16b3a1c5a87de2e7701fb17e0eb97e7a0bbfd1
@@ -123,15 +123,11 @@ INCLUDE_DIRECTORIES(
${CMAKE_SOURCE_DIR}/src/core/symbology-ng
${CMAKE_SOURCE_DIR}/src/core/composer
${CMAKE_SOURCE_DIR}/src/core/layertree
${CMAKE_SOURCE_DIR}/src/gui
${CMAKE_SOURCE_DIR}/src/gui/editorwidgets
${CMAKE_SOURCE_DIR}/src/gui/editorwidgets/core
${CMAKE_SOURCE_DIR}/src/analysis/interpolation
${CMAKE_SOURCE_DIR}/src/plugins/diagram_overlay
${CMAKE_SOURCE_DIR}/src/python

${CMAKE_BINARY_DIR}/src/core
${CMAKE_BINARY_DIR}/src/gui
${CMAKE_BINARY_DIR}/src/python
${CMAKE_BINARY_DIR}/src/analysis
${CMAKE_BINARY_DIR}/src/server
@@ -155,7 +151,6 @@ ENDIF (NOT ANDROID)

TARGET_LINK_LIBRARIES(qgis_server
qgis_core
qgis_gui
qgis_analysis
${PROJ_LIBRARY}
${FCGI_LIBRARY}
@@ -33,14 +33,12 @@
#include "qgsmapserviceexception.h"
#include "qgsnetworkaccessmanager.h"
#include "qgsserverlogger.h"
#include "qgseditorwidgetregistry.h"
#include "qgsserverrequest.h"
#include "qgsbufferserverresponse.h"
#include "qgsbufferserverrequest.h"
#include "qgsfilterresponsedecorator.h"
#include "qgsservice.h"
#include "qgsserverprojectutils.h"
#include "qgsgui.h"

#include <QDomDocument>
#include <QNetworkDiskCache>
@@ -273,8 +271,6 @@ bool QgsServer::init( )
QgsFontUtils::loadStandardTestFonts( QStringList() << QStringLiteral( "Roman" ) << QStringLiteral( "Bold" ) );
#endif

QgsGui::editorWidgetRegistry()->initEditors();

sServerInterface = new QgsServerInterfaceImpl( sCapabilitiesCache, &sServiceRegistry, &sSettings );

// Load service module
@@ -27,13 +27,11 @@
#include "qgsrasterlayer.h"
#include "qgsreadwritecontext.h"
#include "qgsvectorlayerjoinbuffer.h"
#include "qgseditorwidgetregistry.h"
#include "qgslayertreegroup.h"
#include "qgslayertreelayer.h"
#include "qgslayertree.h"
#include "qgslogger.h"
#include "qgseditorwidgetsetup.h"
#include "qgsgui.h"
#include "qgsexpressionnodeimpl.h"
#include "qgsserverprojectutils.h"

@@ -299,12 +297,6 @@ QgsMapLayer *QgsServerProjectParser::createLayerFromElement( const QDomElement &

if ( layer )
{
if ( layer->type() == QgsMapLayer::VectorLayer )
{
// see QgsEditorWidgetRegistry::mapLayerAdded()
QObject::connect( layer, SIGNAL( readCustomSymbology( const QDomElement &, QString & ) ), QgsGui::editorWidgetRegistry(), SLOT( readSymbology( const QDomElement &, QString & ) ) );
}

QgsReadWriteContext context;
context.setPathResolver( QgsProject::instance()->pathResolver() );

@@ -52,7 +52,6 @@
#include "qgspaintenginehack.h"
#include "qgsogcutils.h"
#include "qgsfeature.h"
#include "qgseditorwidgetregistry.h"
#include "qgsaccesscontrol.h"
#include "qgsfeaturerequest.h"
#include "qgsmaprendererjobproxy.h"
@@ -2359,7 +2358,7 @@ namespace QgsWms
QString QgsRenderer::replaceValueMapAndRelation( QgsVectorLayer *vl, int idx, const QString &attributeVal )
{
// TODO Could we get rid of QgsEditorWidgetRegistry dependency ?
const QgsEditorWidgetSetup setup = QgsGui::editorWidgetRegistry()->findBest( vl, vl->fields().field( idx ).name() );
const QgsEditorWidgetSetup setup = vl->editorWidgetSetup( idx );
QgsFieldFormatter *fieldFormatter = QgsApplication::fieldFormatterRegistry()->fieldFormatter( setup.type() );
QString value( fieldFormatter->representValue( vl, idx, setup.config(), QVariant(), attributeVal ) );

0 comments on commit 4a16b3a

Please sign in to comment.
You can’t perform that action at this time.