Skip to content
Permalink
Browse files

Merge branch 'release-1_7_0' of github.com:qgis/Quantum-GIS into rele…

…ase-1_7_0
  • Loading branch information
timlinux committed Jul 14, 2011
2 parents e1f6d6e + c79eb9d commit 4e7ee8e9d29b1ac23511dd0dd62b398bbaec2334

Large diffs are not rendered by default.

@@ -504,7 +504,7 @@ class QgsPaintEngineHack : public QPaintEngine
gccaps |= ( QPaintEngine::PrimitiveTransform
// | QPaintEngine::PatternTransform
| QPaintEngine::PixmapTransform
// | QPaintEngine::PatternBrush
| QPaintEngine::PatternBrush
// | QPaintEngine::LinearGradientFill
// | QPaintEngine::RadialGradientFill
// | QPaintEngine::ConicalGradientFill
@@ -559,11 +559,10 @@ void QgsComposer::on_mActionExportAsPDF_triggered()
printer.setPaperSize( QSizeF( mComposition->paperWidth(), mComposition->paperHeight() ), QPrinter::Millimeter );

QPaintEngine *engine = printer.paintEngine();
if ( engine && engine->hasFeature( QPaintEngine::PatternTransform ) )
if ( engine )
{
QgsPaintEngineHack *hack = static_cast<QgsPaintEngineHack*>( engine );
hack->fixFlags();
Q_ASSERT( !engine->hasFeature( QPaintEngine::PatternTransform ) );
}

print( printer );
@@ -345,15 +345,15 @@ QString QgsPgSourceSelect::layerURI( const QModelIndex &index )

if ( typeName == "POINT" )
{
geomFilter = QString( "geometrytype(\"%1\") IN ('POINT','MULTIPOINT')" ).arg( geomColumnName );
geomFilter = QString( "upper(geometrytype(\"%1\")) IN ('POINT','MULTIPOINT')" ).arg( geomColumnName );
}
else if ( typeName == "LINESTRING" )
{
geomFilter = QString( "geometrytype(\"%1\") IN ('LINESTRING','MULTILINESTRING')" ).arg( geomColumnName );
geomFilter = QString( "upper(geometrytype(\"%1\")) IN ('LINESTRING','MULTILINESTRING')" ).arg( geomColumnName );
}
else if ( typeName == "POLYGON" )
{
geomFilter = QString( "geometrytype(\"%1\") IN ('POLYGON','MULTIPOLYGON')" ).arg( geomColumnName );
geomFilter = QString( "upper(geometrytype(\"%1\")) IN ('POLYGON','MULTIPOLYGON')" ).arg( geomColumnName );
}

if ( !geomFilter.isEmpty() && !sql.contains( geomFilter ) )
@@ -971,9 +971,9 @@ void QgsGeomColumnTypeThread::getLayerTypes()
{
QString query = QString( "select distinct "
"case"
" when geometrytype(%1) IN ('POINT','MULTIPOINT') THEN 'POINT'"
" when geometrytype(%1) IN ('LINESTRING','MULTILINESTRING') THEN 'LINESTRING'"
" when geometrytype(%1) IN ('POLYGON','MULTIPOLYGON') THEN 'POLYGON'"
" when upper(geometrytype(%1)) IN ('POINT','MULTIPOINT') THEN 'POINT'"
" when upper(geometrytype(%1)) IN ('LINESTRING','MULTILINESTRING') THEN 'LINESTRING'"
" when upper(geometrytype(%1)) IN ('POLYGON','MULTIPOLYGON') THEN 'POLYGON'"
" end "
"from " ).arg( "\"" + columns[i] + "\"" );
if ( mUseEstimatedMetadata )
@@ -333,7 +333,7 @@ void QgsComposerLegend::drawLayerChildItems( QPainter* p, QStandardItem* layerIt
textAlignCoord = qMax( currentXCoord, textAlignCoord );
}

maxXCoord = textAlignCoord;
maxXCoord = qMax( maxXCoord, textAlignCoord );
for ( int i = 0; i < numChildren; ++i )
{
if ( p )
@@ -126,7 +126,17 @@ QFileInfo defaultAdminSLD()
return QFileInfo( "admin.sld" );
}


int fcgi_accept()
{
#ifdef Q_OS_WIN
if ( FCGX_IsCGI() )
return FCGI_Accept();
else
return FCGX_Accept( &FCGI_stdin->fcgx_stream, &FCGI_stdout->fcgx_stream, &FCGI_stderr->fcgx_stream, &environ );
#else
return FCGI_Accept();
#endif
}

int main( int argc, char * argv[] )
{
@@ -181,11 +191,10 @@ int main( int argc, char * argv[] )
}
}


//creating QgsMapRenderer is expensive (access to srs.db), so we do it here before the fcgi loop
QgsMapRenderer* theMapRenderer = new QgsMapRenderer();

while ( FCGI_Accept() >= 0 )
while ( fcgi_accept() >= 0 )
{
printRequestInfos(); //print request infos if in debug mode

@@ -73,14 +73,19 @@ QgsConfigParser* QgsConfigCache::insertConfiguration( const QString& filePath )
QFile* configFile = new QFile( filePath );
if ( !configFile->exists() || !configFile->open( QIODevice::ReadOnly ) )
{
QgsMSDebugMsg( "File unreadable: " + filePath );
delete configFile;
return 0;
}

//then create xml document
QDomDocument* configDoc = new QDomDocument();
if ( !configDoc->setContent( configFile, true ) )
QString errorMsg;
int line, column;
if ( !configDoc->setContent( configFile, true, &errorMsg, &line, &column ) )
{
QgsMSDebugMsg( QString( "Parse error %1 at row %2, column %3 in %4 " )
.arg( errorMsg ).arg( line ).arg( column ).arg( filePath ) );
delete configFile;
delete configDoc;
return 0;
@@ -99,6 +104,7 @@ QgsConfigParser* QgsConfigCache::insertConfiguration( const QString& filePath )
}
else
{
QgsMSDebugMsg( "SLD or qgis expected in " + filePath );
delete configDoc;
return 0;
}
@@ -57,7 +57,8 @@ void QgsMapServerLogger::printMessage( const QString& message )
if ( !mLogFile.isOpen() )
{
#ifdef _MSC_VER
::OutputDebugString( message.toLocal8Bit() );
::OutputDebugString( message .toLocal8Bit() );
::OutputDebugString( "\n" );
#endif
return;
}
@@ -324,12 +324,12 @@ QDomDocument QgsWMSServer::getStyle()
std::map<QString, QString>::const_iterator style_it = mParameterMap.find( "STYLE" );
if ( style_it == mParameterMap.end() )
{
throw QgsMapServiceException( "StyleNotSpecified", "Style is manadatory for GetStyle operation" );
throw QgsMapServiceException( "StyleNotSpecified", "Style is mandatory for GetStyle operation" );
}
std::map<QString, QString>::const_iterator layer_it = mParameterMap.find( "LAYER" );
if ( layer_it == mParameterMap.end() )
{
throw QgsMapServiceException( "LayerNotSpecified", "Layer is manadatory for GetStyle operation" );
throw QgsMapServiceException( "LayerNotSpecified", "Layer is mandatory for GetStyle operation" );
}

QString styleName = style_it->second;
@@ -348,7 +348,7 @@ class QgsPaintEngineHack : public QPaintEngine
gccaps |= ( QPaintEngine::PrimitiveTransform
// | QPaintEngine::PatternTransform
| QPaintEngine::PixmapTransform
// | QPaintEngine::PatternBrush
| QPaintEngine::PatternBrush
// | QPaintEngine::LinearGradientFill
// | QPaintEngine::RadialGradientFill
// | QPaintEngine::ConicalGradientFill
@@ -458,11 +458,10 @@ QByteArray* QgsWMSServer::getPrint( const QString& formatString )
QRectF paperRectPixel = printer.pageRect( QPrinter::DevicePixel );

QPaintEngine *engine = printer.paintEngine();
if ( engine->hasFeature( QPaintEngine::PatternTransform ) )
if ( engine )
{
QgsPaintEngineHack *hack = static_cast<QgsPaintEngineHack*>( engine );
hack->fixFlags();
Q_ASSERT( !engine->hasFeature( QPaintEngine::PatternTransform ) );
}

QPainter p( &printer );
@@ -3160,7 +3160,7 @@ bool QgsPostgresProvider::getGeometryDetails()
}
}

sql = QString( "select type,srid from geometry_columns"
sql = QString( "select upper(type),srid from geometry_columns"
" where f_table_name=%1 and f_geometry_column=%2 and f_table_schema=%3" )
.arg( quotedValue( tableName ) )
.arg( quotedValue( geomCol ) )
@@ -3204,7 +3204,7 @@ bool QgsPostgresProvider::getGeometryDetails()
// Didn't find what we need in the geometry_columns table, so
// get stuff from the relevant column instead. This may (will?)
// fail if there is no data in the relevant table.
sql = QString( "select %1(%2),geometrytype(%2) from %3" )
sql = QString( "select %1(%2),upper(geometrytype(%2)) from %3" )
.arg( connectionRO->majorVersion() < 2 ? "srid" : "st_srid" )
.arg( quotedIdentifier( geometryColumn ) )
.arg( mQuery );
@@ -3234,9 +3234,9 @@ bool QgsPostgresProvider::getGeometryDetails()
// check to see if there is a unique geometry type
sql = QString( "select distinct "
"case"
" when geometrytype(%1) IN ('POINT','MULTIPOINT') THEN 'POINT'"
" when geometrytype(%1) IN ('LINESTRING','MULTILINESTRING') THEN 'LINESTRING'"
" when geometrytype(%1) IN ('POLYGON','MULTIPOLYGON') THEN 'POLYGON'"
" when upper(geometrytype(%1)) IN ('POINT','MULTIPOINT') THEN 'POINT'"
" when upper(geometrytype(%1)) IN ('LINESTRING','MULTILINESTRING') THEN 'LINESTRING'"
" when upper(geometrytype(%1)) IN ('POLYGON','MULTIPOLYGON') THEN 'POLYGON'"
" end "
"from " ).arg( quotedIdentifier( geometryColumn ) );
if ( mUseEstimatedMetadata )

0 comments on commit 4e7ee8e

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