Skip to content

Commit

Permalink
Use qimagereader filters to show all available file types for save ma…
Browse files Browse the repository at this point in the history
…p as image

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@12313 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
timlinux committed Dec 2, 2009
1 parent 5823e97 commit 78e8c49
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions src/app/qgisapp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
#include <QEvent>
#include <QFile>
#include <QFileInfo>
#include <QImageReader>
#include <QInputDialog>
#include <QKeyEvent>
#include <QLabel>
Expand All @@ -62,11 +63,11 @@
#include <QStringList>
#include <QTcpSocket>
#include <QTextStream>
#include <QtGlobal>
#include <QTimer>
#include <QToolButton>
#include <QVBoxLayout>
#include <QWhatsThis>
#include <QtGlobal>
//
// Mac OS X Includes
// Must include before GEOS 3 due to unqualified use of 'Point'
Expand Down Expand Up @@ -3771,18 +3772,13 @@ void QgisApp::saveMapAsImage()
// get a list of supported output image types
int myCounterInt = 0;
QString myFilters;
QList<QByteArray> formats = QPictureIO::outputFormats();
// Workaround for a problem with Qt4 - calls to outputFormats tend
// to return nothing :(
if ( formats.count() == 0 )
{
formats.append( "png" );
formats.append( "jpg" );
}
QList<QByteArray> formats = QImageReader::supportedImageFormats();

for ( ; myCounterInt < formats.count(); myCounterInt++ )
{
QString myFormat = QString( formats.at( myCounterInt ) );
//svg doesnt work so skip it
if ( myFormat == "svg" ) continue;
QString myFilter = createFileFilter_( myFormat + " format", "*." + myFormat );
myFilters += myFilter;
myFilterMap[myFilter] = myFormat;
Expand Down

0 comments on commit 78e8c49

Please sign in to comment.