Skip to content

Commit 3f06605

Browse files
author
Hugo Mercier
committed
QgsServer cleanup
1 parent 64b131c commit 3f06605

File tree

2 files changed

+0
-81
lines changed

2 files changed

+0
-81
lines changed

src/server/qgsserver.cpp

-69
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ QgsServer::QgsServer( bool captureOutput )
8181
}
8282
sCaptureOutput = captureOutput;
8383
init();
84-
saveEnvVars();
8584
}
8685

8786

@@ -241,38 +240,6 @@ void QgsServer::printRequestInfos()
241240
}
242241
}
243242

244-
void QgsServer::dummyMessageHandler( QtMsgType type, const char *msg )
245-
{
246-
#if 0 //def QGSMSDEBUG
247-
QString output;
248-
249-
switch ( type )
250-
{
251-
case QtDebugMsg:
252-
output += "Debug: ";
253-
break;
254-
case QtCriticalMsg:
255-
output += "Critical: ";
256-
break;
257-
case QtWarningMsg:
258-
output += "Warning: ";
259-
break;
260-
case QtFatalMsg:
261-
output += "Fatal: ";
262-
}
263-
264-
output += msg;
265-
266-
QgsLogger::logMessageToFile( output );
267-
268-
if ( type == QtFatalMsg )
269-
abort();
270-
#else
271-
Q_UNUSED( type );
272-
Q_UNUSED( msg );
273-
#endif
274-
}
275-
276243
/**
277244
* @brief QgsServer::configPath
278245
* @param defaultConfigPath
@@ -317,10 +284,6 @@ bool QgsServer::init( )
317284

318285
QgsServerLogger::instance();
319286

320-
#ifndef _MSC_VER
321-
qInstallMsgHandler( dummyMessageHandler );
322-
#endif
323-
324287
QString optionsPath = getenv( "QGIS_OPTIONS_PATH" );
325288
if ( !optionsPath.isEmpty() )
326289
{
@@ -420,13 +383,6 @@ void QgsServer::putenv( const QString &var, const QString &val )
420383
*/
421384
QPair<QByteArray, QByteArray> QgsServer::handleRequest( const QString& queryString )
422385
{
423-
//apply environment variables
424-
QHash< QString, QString >::const_iterator envIt = mEnvironmentVariables.constBegin();
425-
for ( ; envIt != mEnvironmentVariables.constEnd(); ++envIt )
426-
{
427-
putenv( envIt.key(), envIt.value() );
428-
}
429-
430386
/*
431387
* This is mainly for python bindings, passing QUERY_STRING
432388
* to handleRequest without using os.environment
@@ -637,28 +593,3 @@ void QgsServer::initPython()
637593
}
638594
#endif
639595

640-
#if 0
641-
// The following code was used to test type conversion in python bindings
642-
QPair<QByteArray, QByteArray> QgsServer::testQPair( QPair<QByteArray, QByteArray> pair )
643-
{
644-
return pair;
645-
}
646-
#endif
647-
648-
void QgsServer::saveEnvVars()
649-
{
650-
saveEnvVar( QStringLiteral( "MAX_CACHE_LAYERS" ) );
651-
saveEnvVar( QStringLiteral( "DEFAULT_DATUM_TRANSFORM" ) );
652-
}
653-
654-
void QgsServer::saveEnvVar( const QString& variableName )
655-
{
656-
const char* env = getenv( variableName.toLocal8Bit() );
657-
if ( !env )
658-
{
659-
return;
660-
}
661-
662-
mEnvironmentVariables.insert( variableName, QString::fromLocal8Bit( env ) );
663-
}
664-

src/server/qgsserver.h

-12
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,6 @@ class SERVER_EXPORT QgsServer
7474
* @return the response headers and body QPair of QByteArray if called from python bindings, empty otherwise
7575
*/
7676
QPair<QByteArray, QByteArray> handleRequest( const QString& queryString = QString() );
77-
#if 0
78-
// The following code was used to test type conversion in python bindings
79-
QPair<QByteArray, QByteArray> testQPair( QPair<QByteArray, QByteArray> pair );
80-
#endif
8177

8278
#ifdef HAVE_SERVER_PYTHON_PLUGINS
8379
//! Returns a pointer to the server interface
@@ -93,11 +89,6 @@ class SERVER_EXPORT QgsServer
9389
//! Server initialization
9490
static bool init();
9591

96-
void saveEnvVars();
97-
98-
//! Saves environment variable into mEnvironmentVariables if defined
99-
void saveEnvVar( const QString& variableName );
100-
10192
// All functions that where previously in the main file are now
10293
// static methods of this class
10394
static QString configPath( const QString& defaultConfigPath,
@@ -134,9 +125,6 @@ class SERVER_EXPORT QgsServer
134125
//! Initialization must run once for all servers
135126
static bool sInitialised;
136127
static bool sCaptureOutput;
137-
138-
//! Pass important environment variables to the fcgi processes
139-
QHash< QString, QString > mEnvironmentVariables;
140128
};
141129
#endif // QGSSERVER_H
142130

0 commit comments

Comments
 (0)