Skip to content

Commit

Permalink
Drop gui dependency from server
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Jul 7, 2017
1 parent 59d1f6d commit 4a16b3a
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 19 deletions.
5 changes: 0 additions & 5 deletions src/server/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -155,7 +151,6 @@ ENDIF (NOT ANDROID)

TARGET_LINK_LIBRARIES(qgis_server
qgis_core
qgis_gui
qgis_analysis
${PROJ_LIBRARY}
${FCGI_LIBRARY}
Expand Down
4 changes: 0 additions & 4 deletions src/server/qgsserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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
Expand Down
8 changes: 0 additions & 8 deletions src/server/qgsserverprojectparser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -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() );

Expand Down
3 changes: 1 addition & 2 deletions src/server/services/wms/qgswmsrenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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 ) );

Expand Down

0 comments on commit 4a16b3a

Please sign in to comment.