Skip to content
Permalink
Browse files

fix warnings and link errors on windows

  • Loading branch information
jef-n committed Jun 14, 2012
1 parent 9275f8e commit 414cb778f65bb4ceb444d8ed347cbb6e1f1e3b1d
@@ -2541,7 +2541,7 @@ void QgsLegend::groupSelectedLayers()
//avoid multiple refreshes of map canvas because of itemChanged signal
blockSignals( true );

QTreeWidgetItem * parent;
QTreeWidgetItem * parent = 0;
foreach( QTreeWidgetItem* item, selectedItems() )
{
parent = item->parent();
@@ -498,7 +498,7 @@ void QgsProjectFileTransform::convertRasterProperties( QDomDocument& doc, QDomNo
if ( !transparencyElem.isNull() )
{
double transparency = transparencyElem.text().toInt();
rasterRendererElem.setAttribute( "opacity", transparency / 255.0 );
rasterRendererElem.setAttribute( "opacity", QString::number( transparency / 255.0 ) );
}

//alphaBand was not saved until now (bug)
@@ -21,7 +21,7 @@
#include "qgsrasterresampler.h"
#include <QColor>

class QgsBilinearRasterResampler: public QgsRasterResampler
class CORE_EXPORT QgsBilinearRasterResampler: public QgsRasterResampler
{
public:
QgsBilinearRasterResampler();
@@ -21,7 +21,7 @@
#include "qgsrasterresampler.h"
#include <QColor>

class QgsCubicRasterResampler: public QgsRasterResampler
class CORE_EXPORT QgsCubicRasterResampler: public QgsRasterResampler
{
public:
QgsCubicRasterResampler();
@@ -115,17 +115,17 @@ void QgsMultiBandColorRenderer::draw( QPainter* p, QgsRasterViewPort* viewPort,
&& mAlphaBand < 1 && !mRedContrastEnhancement && !mGreenContrastEnhancement && !mBlueContrastEnhancement
&& !mInvertColor );

QgsRasterDataProvider::DataType redType;
QgsRasterDataProvider::DataType redType = QgsRasterDataProvider::UnknownDataType;
if ( mRedBand > 0 )
{
redType = ( QgsRasterDataProvider::DataType )mProvider->dataType( mRedBand );
}
QgsRasterDataProvider::DataType greenType;
QgsRasterDataProvider::DataType greenType = QgsRasterDataProvider::UnknownDataType;
if ( mGreenBand > 0 )
{
greenType = ( QgsRasterDataProvider::DataType )mProvider->dataType( mGreenBand );
}
QgsRasterDataProvider::DataType blueType;
QgsRasterDataProvider::DataType blueType = QgsRasterDataProvider::UnknownDataType;
if ( mBlueBand > 0 )
{
blueType = ( QgsRasterDataProvider::DataType )mProvider->dataType( mBlueBand );
@@ -136,7 +136,7 @@ void QgsMultiBandColorRenderer::draw( QPainter* p, QgsRasterViewPort* viewPort,
transparencyType = ( QgsRasterDataProvider::DataType )mProvider->dataType( mAlphaBand );
}

double oversamplingX, oversamplingY;
double oversamplingX = 1.0, oversamplingY = 1.0;
QSet<int> bands;
if ( mRedBand > 0 )
{
@@ -24,7 +24,7 @@ class QgsContrastEnhancement;
class QDomElement;

/**Renderer for multiband images with the color components*/
class QgsMultiBandColorRenderer: public QgsRasterRenderer
class CORE_EXPORT QgsMultiBandColorRenderer: public QgsRasterRenderer
{
public:
QgsMultiBandColorRenderer( QgsRasterDataProvider* provider, int redBand, int greenBand, int blueBand,
@@ -42,8 +42,8 @@ QgsRasterRenderer* QgsPalettedRasterRenderer::create( const QDomElement& elem, Q
}

int bandNumber = elem.attribute( "band", "-1" ).toInt();
int nColors;
QColor* colors;
int nColors = 0;
QColor* colors = 0;

QDomElement paletteElem = elem.firstChildElement( "colorPalette" );
if ( !paletteElem.isNull() )
@@ -118,7 +118,7 @@ void QgsPalettedRasterRenderer::draw( QPainter* p, QgsRasterViewPort* viewPort,

//rendering is faster without considering user-defined transparency
bool hasTransparency = usesTransparency( viewPort->mSrcCRS, viewPort->mDestCRS );
void* transparencyData;
void* transparencyData = 0;

while ( readNextRasterPart( mBandNumber, oversamplingX, oversamplingY, viewPort, nCols, nRows, nRasterCols, nRasterRows,
&rasterData, topLeftCol, topLeftRow ) )
@@ -23,7 +23,7 @@
class QColor;
class QDomElement;

class QgsPalettedRasterRenderer: public QgsRasterRenderer
class CORE_EXPORT QgsPalettedRasterRenderer: public QgsRasterRenderer
{
public:
/**Renderer owns color array*/
@@ -105,7 +105,7 @@ void QgsRasterRenderer::startRasterRead( int bandNumber, QgsRasterViewPort* view

int totalMemoryUsage = pInfo.nCols * oversamplingX * pInfo.nRows * oversamplingY * mProvider->dataTypeSize( bandNumber );
int parts = totalMemoryUsage / 100000000 + 1;
int nPartsPerDimension = sqrt( parts );
int nPartsPerDimension = sqrt(( double ) parts );
pInfo.nColsPerPart = pInfo.nCols / nPartsPerDimension;
pInfo.nRowsPerPart = pInfo.nRows / nPartsPerDimension;
pInfo.currentCol = 0;
@@ -246,7 +246,7 @@ void QgsRasterRenderer::drawImage( QPainter* p, QgsRasterViewPort* viewPort, con
}

//get QgsRasterProjector
QgsRasterProjector* prj;
QgsRasterProjector* prj = 0;
QMap<int, RasterPartInfo>::const_iterator partInfoIt = mRasterPartInfos.constBegin();
if ( partInfoIt != mRasterPartInfos.constEnd() )
{
@@ -326,9 +326,9 @@ void QgsRasterRenderer::_writeXML( QDomDocument& doc, QDomElement& rasterRendere
}

rasterRendererElem.setAttribute( "type", mType );
rasterRendererElem.setAttribute( "opacity", mOpacity );
rasterRendererElem.setAttribute( "opacity", QString::number( mOpacity ) );
rasterRendererElem.setAttribute( "alphaBand", mAlphaBand );
rasterRendererElem.setAttribute( "maxOversampling", mMaxOversampling );
rasterRendererElem.setAttribute( "maxOversampling", QString::number( mMaxOversampling ) );
rasterRendererElem.setAttribute( "invertColor", mInvertColor );
if ( mZoomedInResampler )
{
@@ -26,11 +26,11 @@ class QgsMapToPixel;
class QgsRasterResampler;
class QgsRasterProjector;
class QgsRasterTransparency;
class QgsRasterViewPort;
struct QgsRasterViewPort;

class QDomElement;

class QgsRasterRenderer
class CORE_EXPORT QgsRasterRenderer
{
public:
//Stores information about reading of a raster band. Columns and rows are in unsampled coordinates
@@ -30,7 +30,7 @@ class QgsRasterRendererWidget;
typedef QgsRasterRenderer*( *QgsRasterRendererCreateFunc )( const QDomElement&, QgsRasterDataProvider* provider );
typedef QgsRasterRendererWidget*( *QgsRasterRendererWidgetCreateFunc )( QgsRasterLayer* );

struct QgsRasterRendererRegistryEntry
struct CORE_EXPORT QgsRasterRendererRegistryEntry
{
QgsRasterRendererRegistryEntry( const QString& theName, const QString& theVisibleName, QgsRasterRendererCreateFunc rendererFunction,
QgsRasterRendererWidgetCreateFunc widgetFunction );
@@ -41,7 +41,7 @@ struct QgsRasterRendererRegistryEntry
QgsRasterRendererWidgetCreateFunc widgetCreateFunction; //pointer to create function for renderer widget
};

class QgsRasterRendererRegistry
class CORE_EXPORT QgsRasterRendererRegistry
{
public:
static QgsRasterRendererRegistry* instance();
@@ -147,7 +147,7 @@ void QgsRasterShader::writeXML( QDomDocument& doc, QDomElement& parent ) const
{
QDomElement itemElem = doc.createElement( "item" );
itemElem.setAttribute( "label", itemIt->label );
itemElem.setAttribute( "value", itemIt->value );
itemElem.setAttribute( "value", QString::number( itemIt->value ) );
itemElem.setAttribute( "color", itemIt->color.name() );
colorRampShaderElem.appendChild( itemElem );
}
@@ -23,7 +23,7 @@
class QgsContrastEnhancement;
class QDomElement;

class QgsSingleBandGrayRenderer: public QgsRasterRenderer
class CORE_EXPORT QgsSingleBandGrayRenderer: public QgsRasterRenderer
{
public:
QgsSingleBandGrayRenderer( QgsRasterDataProvider* provider, int grayBand );
@@ -89,7 +89,7 @@ void QgsSingleBandPseudoColorRenderer::draw( QPainter* p, QgsRasterViewPort* vie
int topLeftCol = 0;
int topLeftRow = 0;
void* rasterData;
void* transparencyData;
void* transparencyData = 0;
double currentOpacity = mOpacity;
QgsRasterDataProvider::DataType rasterType = ( QgsRasterDataProvider::DataType )mProvider->dataType( mBand );
int red, green, blue;
@@ -23,7 +23,7 @@
class QDomElement;
class QgsRasterShader;

class QgsSingleBandPseudoColorRenderer: public QgsRasterRenderer
class CORE_EXPORT QgsSingleBandPseudoColorRenderer: public QgsRasterRenderer
{
public:
/**Note: takes ownership of QgsRasterShader*/
@@ -27,7 +27,7 @@ class QgsRasterDataProvider;
class QgsRasterLayer;
class QLineEdit;

class QgsMultiBandColorRendererWidget: public QgsRasterRendererWidget, private Ui::QgsMultiBandColorRendererWidgetBase
class GUI_EXPORT QgsMultiBandColorRendererWidget: public QgsRasterRendererWidget, private Ui::QgsMultiBandColorRendererWidgetBase
{
Q_OBJECT

@@ -23,7 +23,7 @@

class QgsRasterLayer;

class QgsPalettedRendererWidget: public QgsRasterRendererWidget, private Ui::QgsPalettedRendererWidgetBase
class GUI_EXPORT QgsPalettedRendererWidget: public QgsRasterRendererWidget, private Ui::QgsPalettedRendererWidgetBase
{
Q_OBJECT

@@ -23,7 +23,7 @@
class QgsRasterLayer;
class QgsRasterRenderer;

class QgsRasterRendererWidget: public QWidget
class GUI_EXPORT QgsRasterRendererWidget: public QWidget
{
public:
QgsRasterRendererWidget( QgsRasterLayer* layer ) { mRasterLayer = layer; }
@@ -21,7 +21,7 @@
#include "qgsrasterrendererwidget.h"
#include "ui_qgssinglebandgrayrendererwidgetbase.h"

class QgsSingleBandGrayRendererWidget: public QgsRasterRendererWidget, private Ui::QgsSingleBandGrayRendererWidgetBase
class GUI_EXPORT QgsSingleBandGrayRendererWidget: public QgsRasterRendererWidget, private Ui::QgsSingleBandGrayRendererWidgetBase
{
Q_OBJECT
public:
@@ -22,7 +22,7 @@
#include "qgscolorrampshader.h"
#include "ui_qgssinglebandpseudocolorrendererwidgetbase.h"

class QgsSingleBandPseudoColorRendererWidget: public QgsRasterRendererWidget,
class GUI_EXPORT QgsSingleBandPseudoColorRendererWidget: public QgsRasterRendererWidget,
private Ui::QgsSingleBandPseudoColorRendererWidgetBase
{
Q_OBJECT
@@ -2548,6 +2548,7 @@ void QgsWmsProvider::parseWMTSContents( QDomElement const &e )
metersPerUnit = 111319.49079327358;
break;

default:
case QGis::UnknownUnit:
QgsDebugMsg( "Unknown CRS units - assuming meters" );
metersPerUnit = 1.0;

0 comments on commit 414cb77

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