Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add a second PNG in case UMN mapserver offers image/png and image/png…
…; mode=24bit

git-svn-id: http://svn.osgeo.org/qgis/trunk@10052 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent committed Jan 30, 2009
1 parent a380360 commit 5b2cb31
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/app/qgsserversourceselect.cpp
Expand Up @@ -70,12 +70,14 @@ QgsServerSourceSelect::QgsServerSourceSelect( QWidget * parent, Qt::WFlags fl )
// Some wms servers will support tiff, but by default Qt doesn't, but leave
// this in for those versions of Qt that might support tiff
m_PotentialFormats.insert( "image/tiff", qMakePair( QString( "TIFF" ), 6 ) );
//MH: UMN mapserver often offers png 24 bit
m_PotentialFormats.insert( "image/png; mode=24bit", qMakePair( QString( "PNG" ), 7 ) );

QMap<QString, QPair<QString, int> >::const_iterator iter = m_PotentialFormats.constBegin();
int i = 1;
while ( iter != m_PotentialFormats.end() )
{
QRadioButton* btn = new QRadioButton( iter.value().first );
QRadioButton* btn = new QRadioButton(iter.value().first);
m_imageFormatGroup->addButton( btn, iter.value().second );
m_imageFormatLayout->addWidget( btn );
if ( i == 1 )
Expand Down Expand Up @@ -579,7 +581,13 @@ QString QgsServerSourceSelect::selectedImageEncoding()
// a value that isn't in the map, hence we don't need to check for the value
// not being found.

return m_PotentialFormats.key( qMakePair( label, id ) );
QString imageEncoding = m_PotentialFormats.key( qMakePair( label, id ) );

//substitute blanks with %20 (e.g. in "image/png; mode=24bit")
imageEncoding.replace(QRegExp(" "), "%20");
return imageEncoding;

//return m_PotentialFormats.key( qMakePair( label, id ) );
}


Expand Down

0 comments on commit 5b2cb31

Please sign in to comment.