Skip to content

Commit

Permalink
mapserver: semicolon removed from QgsMSDebugMsg macro
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@15162 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Feb 12, 2011
1 parent a0d0408 commit 91b8cee
Show file tree
Hide file tree
Showing 15 changed files with 164 additions and 166 deletions.
50 changes: 25 additions & 25 deletions src/mapserver/qgis_map_serv.cpp
Expand Up @@ -72,36 +72,36 @@ void printRequestInfos()
{
#ifdef QGSMSDEBUG
//print out some infos about the request
QgsMSDebugMsg( "************************new request**********************" )
QgsMSDebugMsg( "************************new request**********************" );
QgsMSDebugMsg( QDateTime::currentDateTime().toString( "yyyy-MM-dd hh:mm:ss" ) );

if ( getenv( "REMOTE_ADDR" ) != NULL )
{
QgsMSDebugMsg( "remote ip: " + QString( getenv( "REMOTE_ADDR" ) ) )
QgsMSDebugMsg( "remote ip: " + QString( getenv( "REMOTE_ADDR" ) ) );
}
if ( getenv( "REMOTE_HOST" ) != NULL )
{
QgsMSDebugMsg( "remote host: " + QString( getenv( "REMOTE_HOST" ) ) )
QgsMSDebugMsg( "remote host: " + QString( getenv( "REMOTE_HOST" ) ) );
}
if ( getenv( "REMOTE_USER" ) != NULL )
{
QgsMSDebugMsg( "remote user: " + QString( getenv( "REMOTE_USER" ) ) )
QgsMSDebugMsg( "remote user: " + QString( getenv( "REMOTE_USER" ) ) );
}
if ( getenv( "REMOTE_IDENT" ) != NULL )
{
QgsMSDebugMsg( "REMOTE_IDENT: " + QString( getenv( "REMOTE_IDENT" ) ) )
QgsMSDebugMsg( "REMOTE_IDENT: " + QString( getenv( "REMOTE_IDENT" ) ) );
}
if ( getenv( "CONTENT_TYPE" ) != NULL )
{
QgsMSDebugMsg( "CONTENT_TYPE: " + QString( getenv( "CONTENT_TYPE" ) ) )
QgsMSDebugMsg( "CONTENT_TYPE: " + QString( getenv( "CONTENT_TYPE" ) ) );
}
if ( getenv( "AUTH_TYPE" ) != NULL )
{
QgsMSDebugMsg( "AUTH_TYPE: " + QString( getenv( "AUTH_TYPE" ) ) )
QgsMSDebugMsg( "AUTH_TYPE: " + QString( getenv( "AUTH_TYPE" ) ) );
}
if ( getenv( "HTTP_USER_AGENT" ) != NULL )
{
QgsMSDebugMsg( "HTTP_USER_AGENT: " + QString( getenv( "HTTP_USER_AGENT" ) ) )
QgsMSDebugMsg( "HTTP_USER_AGENT: " + QString( getenv( "HTTP_USER_AGENT" ) ) );
}
#endif //QGSMSDEBUG
}
Expand Down Expand Up @@ -154,12 +154,12 @@ int main( int argc, char * argv[] )
//write to qgis_wms_server.log in application directory
QgsMapServerLogger::instance()->setLogFilePath( qgsapp.applicationDirPath() + "/qgis_wms_server.log" );
#endif
QgsMSDebugMsg( "Prefix PATH: " + QgsApplication::prefixPath() )
QgsMSDebugMsg( "Plugin PATH: " + QgsApplication::pluginPath() )
QgsMSDebugMsg( "PkgData PATH: " + QgsApplication::pkgDataPath() )
QgsMSDebugMsg( "User DB PATH: " + QgsApplication::qgisUserDbFilePath() )
QgsMSDebugMsg( "Prefix PATH: " + QgsApplication::prefixPath() );
QgsMSDebugMsg( "Plugin PATH: " + QgsApplication::pluginPath() );
QgsMSDebugMsg( "PkgData PATH: " + QgsApplication::pkgDataPath() );
QgsMSDebugMsg( "User DB PATH: " + QgsApplication::qgisUserDbFilePath() );

QgsMSDebugMsg( qgsapp.applicationDirPath() + "/qgis_wms_server.log" )
QgsMSDebugMsg( qgsapp.applicationDirPath() + "/qgis_wms_server.log" );

//create config cache and search for config files in the current directory.
//These configurations are used if no mapfile parameter is present in the request
Expand Down Expand Up @@ -194,18 +194,18 @@ int main( int argc, char * argv[] )
{
if ( strcmp( requestMethod, "POST" ) == 0 )
{
QgsMSDebugMsg( "Creating QgsSOAPRequestHandler" )
QgsMSDebugMsg( "Creating QgsSOAPRequestHandler" );
theRequestHandler = new QgsSOAPRequestHandler();
}
else
{
QgsMSDebugMsg( "Creating QgsGetRequestHandler" )
QgsMSDebugMsg( "Creating QgsGetRequestHandler" );
theRequestHandler = new QgsGetRequestHandler();
}
}
else
{
QgsMSDebugMsg( "Creating QgsGetRequestHandler" )
QgsMSDebugMsg( "Creating QgsGetRequestHandler" );
theRequestHandler = new QgsGetRequestHandler();
}

Expand All @@ -217,7 +217,7 @@ int main( int argc, char * argv[] )
}
catch ( QgsMapServiceException& e )
{
QgsMSDebugMsg( "An exception was thrown during input parsing" )
QgsMSDebugMsg( "An exception was thrown during input parsing" );
theRequestHandler->sendServiceException( e );
continue;
}
Expand Down Expand Up @@ -246,7 +246,7 @@ int main( int argc, char * argv[] )
if ( serviceIt == parameterMap.end() )
{
//tell the user that service parameter is mandatory
QgsMSDebugMsg( "unable to find 'SERVICE' parameter, exiting..." )
QgsMSDebugMsg( "unable to find 'SERVICE' parameter, exiting..." );
theRequestHandler->sendServiceException( QgsMapServiceException( "ServiceNotSpecified", "Service not specified. The SERVICE parameter is mandatory" ) );
delete theRequestHandler;
continue;
Expand All @@ -271,7 +271,7 @@ int main( int argc, char * argv[] )
if ( requestIt == parameterMap.end() )
{
//do some error handling
QgsMSDebugMsg( "unable to find 'REQUEST' parameter, exiting..." )
QgsMSDebugMsg( "unable to find 'REQUEST' parameter, exiting..." );
theRequestHandler->sendServiceException( QgsMapServiceException( "OperationNotSupported", "Please check the value of the REQUEST parameter" ) );
delete theRequestHandler;
delete theServer;
Expand All @@ -292,7 +292,7 @@ int main( int argc, char * argv[] )
delete theServer;
continue;
}
QgsMSDebugMsg( "sending GetCapabilities response" )
QgsMSDebugMsg( "sending GetCapabilities response" );
theRequestHandler->sendGetCapabilitiesResponse( capabilitiesDocument );
delete theRequestHandler;
delete theServer;
Expand All @@ -307,7 +307,7 @@ int main( int argc, char * argv[] )
}
catch ( QgsMapServiceException& ex )
{
QgsMSDebugMsg( "Catched exception during GetMap request" )
QgsMSDebugMsg( "Catched exception during GetMap request" );
theRequestHandler->sendServiceException( ex );
delete theRequestHandler;
delete theServer;
Expand All @@ -316,13 +316,13 @@ int main( int argc, char * argv[] )

if ( result )
{
QgsMSDebugMsg( "Sending GetMap response" )
QgsMSDebugMsg( "Sending GetMap response" );
theRequestHandler->sendGetMapResponse( serviceIt->second, result );
}
else
{
//do some error handling
QgsMSDebugMsg( "result image is 0" )
QgsMSDebugMsg( "result image is 0" );
}
delete result;
delete theRequestHandler;
Expand Down Expand Up @@ -392,14 +392,14 @@ int main( int argc, char * argv[] )

if ( result )
{
QgsMSDebugMsg( "Sending GetLegendGraphics response" )
QgsMSDebugMsg( "Sending GetLegendGraphics response" );
//sending is the same for GetMap and GetLegendGraphics
theRequestHandler->sendGetMapResponse( serviceIt->second, result );
}
else
{
//do some error handling
QgsMSDebugMsg( "result image is 0" )
QgsMSDebugMsg( "result image is 0" );
}
delete result;
delete theRequestHandler;
Expand Down
4 changes: 2 additions & 2 deletions src/mapserver/qgsconfigcache.cpp
Expand Up @@ -38,12 +38,12 @@ QgsConfigParser* QgsConfigCache::searchConfiguration( const QString& filePath )
QMap<QString, QgsConfigParser*>::const_iterator configIt = mCachedConfigurations.find( filePath );
if ( configIt == mCachedConfigurations.constEnd() )
{
QgsMSDebugMsg( "Create new configuration" )
QgsMSDebugMsg( "Create new configuration" );
return insertConfiguration( filePath );
}
else
{
QgsMSDebugMsg( "Return configuration from cash" )
QgsMSDebugMsg( "Return configuration from cache" );
return configIt.value();
}
}
Expand Down
8 changes: 4 additions & 4 deletions src/mapserver/qgsgetrequesthandler.cpp
Expand Up @@ -24,11 +24,11 @@ std::map<QString, QString> QgsGetRequestHandler::parseInput()
if ( qs )
{
queryString = QString( qs );
QgsMSDebugMsg( "query string is: " + queryString )
QgsMSDebugMsg( "query string is: " + queryString );
}
else
{
QgsMSDebugMsg( "error, no query string found" )
QgsMSDebugMsg( "error, no query string found" );
return parameters; //no query string? something must be wrong...
}

Expand Down Expand Up @@ -80,7 +80,7 @@ std::map<QString, QString> QgsGetRequestHandler::parseInput()

}
parameters.insert( std::make_pair( key.toUpper(), value ) );
QgsMSDebugMsg( "inserting pair " + key.toUpper() + " // " + value + " into the parameter map" )
QgsMSDebugMsg( "inserting pair " + key.toUpper() + " // " + value + " into the parameter map" );
}

//feature info format?
Expand Down Expand Up @@ -160,7 +160,7 @@ void QgsGetRequestHandler::sendGetStyleResponse( const QDomDocument& doc ) const
void QgsGetRequestHandler::sendGetFeatureInfoResponse( const QDomDocument& infoDoc, const QString& infoFormat ) const
{
QByteArray ba;
QgsMSDebugMsg( "Info format is:" + infoFormat )
QgsMSDebugMsg( "Info format is:" + infoFormat );

if ( infoFormat == "text/xml" )
{
Expand Down
8 changes: 4 additions & 4 deletions src/mapserver/qgshostedrdsbuilder.cpp
Expand Up @@ -35,7 +35,7 @@ QgsHostedRDSBuilder::~QgsHostedRDSBuilder()

QgsMapLayer* QgsHostedRDSBuilder::createMapLayer( const QDomElement& elem, const QString& layerName, QList<QTemporaryFile*>& filesToRemove, QList<QgsMapLayer*>& layersToRemove, bool allowCaching ) const
{
QgsMSDebugMsg( "entering." )
QgsMSDebugMsg( "entering." );

if ( elem.isNull() )
{
Expand All @@ -45,20 +45,20 @@ QgsMapLayer* QgsHostedRDSBuilder::createMapLayer( const QDomElement& elem, const
QString uri = elem.attribute( "uri", "not found" );
if ( uri == "not found" )
{
QgsMSDebugMsg( "Uri not found" )
QgsMSDebugMsg( "Uri not found" );
return 0;
}
else
{
QgsMSDebugMsg( "Trying to get hostedrds layer from cache with uri: " + uri )
QgsMSDebugMsg( "Trying to get hostedrds layer from cache with uri: " + uri );
QgsRasterLayer* rl = 0;
if ( allowCaching )
{
rl = dynamic_cast<QgsRasterLayer*>( QgsMSLayerCache::instance()->searchLayer( uri, layerName ) );
}
if ( !rl )
{
QgsMSDebugMsg( "hostedrds layer not in cache, so create and insert it" )
QgsMSDebugMsg( "hostedrds layer not in cache, so create and insert it" );
rl = new QgsRasterLayer( uri, layerNameFromUri( uri ) );
if ( allowCaching )
{
Expand Down
6 changes: 3 additions & 3 deletions src/mapserver/qgshostedvdsbuilder.cpp
Expand Up @@ -44,7 +44,7 @@ QgsMapLayer* QgsHostedVDSBuilder::createMapLayer( const QDomElement& elem, const

if ( providerType == "not found" || uri == "not found" )
{
QgsMSDebugMsg( "error, provider type not found" )
QgsMSDebugMsg( "error, provider type not found" );
return 0;
}

Expand All @@ -58,12 +58,12 @@ QgsMapLayer* QgsHostedVDSBuilder::createMapLayer( const QDomElement& elem, const

if ( !ml )
{
QgsMSDebugMsg( "hostedvds layer not in cash, so create and insert it" )
QgsMSDebugMsg( "hostedvds layer not in cash, so create and insert it" );
ml = new QgsVectorLayer( uri, layerNameFromUri( uri ), providerType );

if ( !ml || !ml->isValid() )
{
QgsMSDebugMsg( "error, VectorLayer is 0 or invalid" )
QgsMSDebugMsg( "error, VectorLayer is 0 or invalid" );
delete ml;
return 0;
}
Expand Down
4 changes: 2 additions & 2 deletions src/mapserver/qgsmapserverlogger.cpp
Expand Up @@ -68,9 +68,9 @@ void QgsMapServerLogger::printChar( QChar c )
void QgsMapServerLogger::printMessage( const char *file, const char *function, int line, const QString& message )
{
#if defined(_MSC_VER)
printMessage( QString( "%1(%2): (%3) %4" ).arg( file ).arg( line ).arg( function ).arg( line ).arg( message ) );
printMessage( QString( "%1(%2): (%3) %4" ).arg( file ).arg( line ).arg( function ).arg( message ) );
#else
printMessage( QString( "%1: %2: (%3) %4" ).arg( file ).arg( line ).arg( function ).arg( line ).arg( message ) );
printMessage( QString( "%1: %2: (%3) %4" ).arg( file ).arg( line ).arg( function ).arg( message ) );
#endif
}
#endif
2 changes: 1 addition & 1 deletion src/mapserver/qgsmapserverlogger.h
Expand Up @@ -22,7 +22,7 @@
#include <QTextStream>

#ifdef QGSMSDEBUG
#define QgsMSDebugMsg(str) QgsMapServerLogger::instance()->printMessage(__FILE__, __FUNCTION__, __LINE__, str);
#define QgsMSDebugMsg(str) QgsMapServerLogger::instance()->printMessage(__FILE__, __FUNCTION__, __LINE__, str)
#else
#define QgsMSDebugMsg(str)
#endif
Expand Down
18 changes: 8 additions & 10 deletions src/mapserver/qgsmslayercache.cpp
Expand Up @@ -39,7 +39,7 @@ QgsMSLayerCache::QgsMSLayerCache()

QgsMSLayerCache::~QgsMSLayerCache()
{
QgsMSDebugMsg( "removing all entries" )
QgsMSDebugMsg( "removing all entries" );
QMap<QPair<QString, QString>, QgsMSLayerCacheEntry>::iterator it;
for ( it = mEntries.begin(); it != mEntries.end(); ++it )
{
Expand All @@ -50,7 +50,7 @@ QgsMSLayerCache::~QgsMSLayerCache()

void QgsMSLayerCache::insertLayer( const QString& url, const QString& layerName, QgsMapLayer* layer, const QList<QString>& tempFiles )
{
QgsMSDebugMsg( "inserting layer" )
QgsMSDebugMsg( "inserting layer" );
if ( mEntries.size() > MAX_N_LAYERS ) //force cache layer examination after 10 inserted layers
{
updateEntries();
Expand Down Expand Up @@ -79,7 +79,7 @@ QgsMapLayer* QgsMSLayerCache::searchLayer( const QString& url, const QString& la
QMap<QPair<QString, QString>, QgsMSLayerCacheEntry>::iterator it = mEntries.find( urlNamePair );
if ( it == mEntries.end() )
{
QgsMSDebugMsg( "Layer not found in cache" )
QgsMSDebugMsg( "Layer not found in cache" );
return 0;
}
else
Expand All @@ -93,14 +93,14 @@ QgsMapLayer* QgsMSLayerCache::searchLayer( const QString& url, const QString& la
vl->removeOverlay( "diagram" );
}
#endif //DIAGRAMSERVER
QgsMSDebugMsg( "Layer found in cache" )
QgsMSDebugMsg( "Layer found in cache" );
return it->layerPointer;
}
}

void QgsMSLayerCache::updateEntries()
{
QgsMSDebugMsg( "updateEntries" )
QgsMSDebugMsg( "updateEntries" );
int entriesToDelete = mEntries.size() - MAX_N_LAYERS;
if ( entriesToDelete < 1 )
{
Expand All @@ -120,7 +120,7 @@ void QgsMSLayerCache::removeLeastUsedEntry()
{
return;
}
QgsMSDebugMsg( "removeLeastUsedEntry" )
QgsMSDebugMsg( "removeLeastUsedEntry" );
QMap<QPair<QString, QString>, QgsMSLayerCacheEntry>::iterator it = mEntries.begin();
QMap<QPair<QString, QString>, QgsMSLayerCacheEntry>::iterator lowest_it = it;
time_t lowest_time = it->lastUsedTime;
Expand Down Expand Up @@ -149,10 +149,8 @@ void QgsMSLayerCache::freeEntryRessources( QgsMSLayerCacheEntry& entry )
QFile removeFile( *it );
if ( !removeFile.remove() )
{
QgsMSDebugMsg( "could not remove file: " + *it )
QgsMSDebugMsg( removeFile.errorString() )
QgsMSDebugMsg( "could not remove file: " + *it );
QgsMSDebugMsg( removeFile.errorString() );
}
}
}


2 changes: 1 addition & 1 deletion src/mapserver/qgsremotedatasourcebuilder.cpp
Expand Up @@ -155,7 +155,7 @@ int QgsRemoteDataSourceBuilder::loadData( const QString& url, QByteArray& data )
QgsHttpTransaction http( url );
if ( !http.getSynchronously( data ) )
{
QgsMSDebugMsg( "Error, loading from http failed" )
QgsMSDebugMsg( "Error, loading from http failed" );
return 1; //no success
}
}
Expand Down

0 comments on commit 91b8cee

Please sign in to comment.