4 changes: 2 additions & 2 deletions python/plugins/processing/modeler/ModelerAlgorithm.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* *
***************************************************************************
"""


__author__ = 'Victor Olaya'
__date__ = 'August 2012'
Expand Down Expand Up @@ -120,7 +120,7 @@ def openModel(self, filename):
self.algParameters = []
self.algOutputs = []
self.paramValues = {}
self.dependencies = []
self.dependencies = []
self.descriptionFile = filename
lines = codecs.open(filename, 'r', encoding='utf-8')
line = lines.readline().strip('\n').strip('\r')
Expand Down
25 changes: 13 additions & 12 deletions src/app/legend/qgslegend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -404,15 +404,15 @@ void QgsLegend::mousePressEvent( QMouseEvent * e )
if ( !legend.isNull() )
{
mGetLegendGraphicPopup = new QFrame();
mGetLegendGraphicPopup->setFrameStyle(QFrame::Box | QFrame::Raised);
mGetLegendGraphicPopup->setLineWidth(2);
mGetLegendGraphicPopup->setAutoFillBackground(true);
mGetLegendGraphicPopup->setFrameStyle( QFrame::Box | QFrame::Raised );
mGetLegendGraphicPopup->setLineWidth( 2 );
mGetLegendGraphicPopup->setAutoFillBackground( true );
QVBoxLayout *layout = new QVBoxLayout;
QLabel *label = new QLabel(mGetLegendGraphicPopup);
label->setPixmap( QPixmap::fromImage(legend) );
layout->addWidget(label);
mGetLegendGraphicPopup->setLayout(layout);
mGetLegendGraphicPopup->move(e->globalX(), e->globalY());
QLabel *label = new QLabel( mGetLegendGraphicPopup );
label->setPixmap( QPixmap::fromImage( legend ) );
layout->addWidget( label );
mGetLegendGraphicPopup->setLayout( layout );
mGetLegendGraphicPopup->move( e->globalX(), e->globalY() );
mGetLegendGraphicPopup->show();
}

Expand Down Expand Up @@ -645,11 +645,12 @@ void QgsLegend::updateGroupCheckStates( QTreeWidgetItem *item )

void QgsLegend::mouseReleaseEvent( QMouseEvent * e )
{
if (mGetLegendGraphicPopup) {
if ( mGetLegendGraphicPopup )
{
delete mGetLegendGraphicPopup;
mGetLegendGraphicPopup = 0;
}

QStringList layersPriorToEvent = layerIDs();
QTreeWidget::mouseReleaseEvent( e );
mMousePressedFlag = false;
Expand Down Expand Up @@ -3243,7 +3244,7 @@ QImage QgsLegend::getWmsLegendPixmap( QTreeWidgetItem *item )
}

QTreeWidgetItem *parent = item->parent();
if ( !parent )
if ( !parent )
{
return QImage();
}
Expand All @@ -3270,7 +3271,7 @@ QImage QgsLegend::getWmsLegendPixmap( QTreeWidgetItem *item )
{
return QImage();
}

return rasterLayer->dataProvider()->getLegendGraphic( canvas()->scale() );
}

4 changes: 2 additions & 2 deletions src/app/legend/qgslegend.h
Original file line number Diff line number Diff line change
Expand Up @@ -591,9 +591,9 @@ class QgsLegend : public QTreeWidget
bool verifyDrawingOrder();

/*!
* Check if current LegendItem belogs to a WMS layer
* Check if current LegendItem belongs to a WMS layer
* @param item LegendItem to check if belongs to a WMS layer
* @return QImage A valid Legend image if belogs to WMS otherwise QImage()
* @return QImage A valid Legend image if belongs to WMS otherwise QImage()
*/
QImage getWmsLegendPixmap( QTreeWidgetItem *item );

Expand Down
12 changes: 6 additions & 6 deletions src/app/legend/qgslegendlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,8 @@ void QgsLegendLayer::rasterLayerSymbology( QgsRasterLayer* layer )
itemList.reserve( rasterItemList.size() );
#endif

// GetLegendGraphics in case of WMS service... pixmap can return null if GetLegendGraphics
// is not supported by server
// GetLegendGraphics in case of WMS service... pixmap can return null if GetLegendGraphics
// is not supported by the server
QgsDebugMsg( QString( "layer providertype:: %1" ).arg( layer->providerType() ) );
if ( layer->providerType() == "wms" )
{
Expand All @@ -219,12 +219,12 @@ void QgsLegendLayer::rasterLayerSymbology( QgsRasterLayer* layer )
QImage legendGraphic = layer->dataProvider()->getLegendGraphic( currentScale );
if ( !legendGraphic.isNull() )
{
QgsDebugMsg( QString( "downloaded legend with dimension Width:" )+QString::number(legendGraphic.width())+QString(" and Height:")+QString::number(legendGraphic.height()) );
QgsDebugMsg( QString( "downloaded legend with dimension width:" ) + QString::number( legendGraphic.width() ) + QString( " and Height:" ) + QString::number( legendGraphic.height() ) );

#if QT_VERSION >= 0x40700
if ( rasterItemList.size() == 0) itemList.reserve( 1 );
if ( rasterItemList.size() == 0 ) itemList.reserve( 1 );
#endif
itemList.append( qMakePair( QString(""), QPixmap::fromImage(legendGraphic) ) );
itemList.append( qMakePair( QString( "" ), QPixmap::fromImage( legendGraphic ) ) );
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/app/qgisapp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8902,7 +8902,7 @@ void QgisApp::keyReleaseEvent( QKeyEvent *event )
case QMessageBox::No:
break;
}
event->setAccepted( accepted ); // dont't close my Top Level Widget !
event->setAccepted( accepted ); // don't close my Top Level Widget !
accepted = false;// close the app next time when the user press back button
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgsclipboard.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ class APP_EXPORT QgsClipboard : public QObject
const QgsFields &fields() { return mFeatureFields; }

signals:
/** Emited when content changed */
/** Emitted when content changed */
void changed();

private:
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgsguivectorlayertools.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class QgsGuiVectorLayerTools : public QgsVectorLayerTools, public QObject
bool addFeature( QgsVectorLayer *layer, QgsAttributeMap defaultValues, const QgsGeometry &defaultGeometry );

/**
* This should be called, whenever a vector layer should be switched to edit mode. If succesful
* This should be called, whenever a vector layer should be switched to edit mode. If successful
* the layer is switched to editable and an edit sessions started.
*
* @param layer The layer on which to start an edit session
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgslabelengineconfigdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ QgsLabelEngineConfigDialog::QgsLabelEngineConfigDialog( QgsPalLabeling* lbl, QWi
mShadowDebugRectChkBox->setChecked( mLBL->isShowingShadowRectangles() );

mSaveWithProjectChkBox->setChecked( mLBL->isStoredWithProject() );

chkShowPartialsLabels->setChecked( mLBL-> isShowingPartialsLabels() );
}

Expand Down
2 changes: 1 addition & 1 deletion src/app/qgsoptions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WFlags fl ) :
cmbLegendDoubleClickAction->setCurrentIndex( settings.value( "/qgis/legendDoubleClickAction", 0 ).toInt() );

// WMS getLegendGraphic setting
mLegendGraphicResolutionSpinBox->setValue( settings.value("/qgis/defaultLegendGraphicResolution", 0).toInt() );
mLegendGraphicResolutionSpinBox->setValue( settings.value( "/qgis/defaultLegendGraphicResolution", 0 ).toInt() );

//
// Raster properties
Expand Down
4 changes: 2 additions & 2 deletions src/core/composer/qgscomposerlegend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -363,10 +363,10 @@ QgsComposerLegend::Nucleon QgsComposerLegend::drawSymbolItem( QgsComposerLegendI
if ( maxWidth < size.width() ) maxWidth = size.width();
if ( maxHeight < size.height() ) maxHeight = size.height();
}
QSize maxSize(maxWidth, maxHeight);
QSize maxSize( maxWidth, maxHeight );

// get and print legend
QImage legend = symbolIcon.pixmap(maxWidth, maxHeight).toImage();
QImage legend = symbolIcon.pixmap( maxWidth, maxHeight ).toImage();
if ( painter )
{
painter->drawImage( QRectF( point.x(), point.y(), mWmsLegendWidth, mWmsLegendHeight ), legend, QRectF( 0, 0, maxWidth, maxHeight ) );
Expand Down
16 changes: 8 additions & 8 deletions src/core/composer/qgslegendmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -233,29 +233,29 @@ int QgsLegendModel::addRasterLayerItems( QStandardItem* layerItem, QgsMapLayer*
if ( rasterLayer->providerType() == "wms" )
{
QgsComposerRasterSymbolItem* currentSymbolItem = new QgsComposerRasterSymbolItem( "" );
// GetLegendGraphics in case of WMS service... image can return null if GetLegendGraphics
// is not supported by server
// GetLegendGraphics in case of WMS service... image can return null if GetLegendGraphics
// is not supported by the server
// double currentScale = legend()->canvas()->scale();
// BEAWARE getLegendGraphic() COULD BE USED WITHOUT SCALE PARAMETER IF IT WAS ALREADY CALLED WITH
// THIS PARAMER FROM A COMPONENT THAT CAN RECOVER CURRENT SCALE => LEGEND IN THE DESKTOP
// BEWARE getLegendGraphic() COULD BE USED WITHOUT SCALE PARAMETER IF IT WAS ALREADY CALLED WITH
// THIS PARAMETER FROM A COMPONENT THAT CAN RECOVER CURRENT SCALE => LEGEND IN THE DESKTOP
// OTHERWISE IT RETURN A INVALID PIXMAP (QPixmap().isNull() == False)
QImage legendGraphic = rasterLayer->dataProvider()->getLegendGraphic();
if ( !legendGraphic.isNull() )
{
QgsDebugMsg( QString( "downloaded legend with dimension Width:" )+QString::number(legendGraphic.width())+QString(" and Height:")+QString::number(legendGraphic.height()) );
QgsDebugMsg( QString( "downloaded legend with dimension width:" ) + QString::number( legendGraphic.width() ) + QString( " and Height:" ) + QString::number( legendGraphic.height() ) );
if ( mHasTopLevelWindow )
{
currentSymbolItem->setIcon( QIcon( QPixmap::fromImage(legendGraphic) ) );
currentSymbolItem->setIcon( QIcon( QPixmap::fromImage( legendGraphic ) ) );
}
}
else
{
currentSymbolItem->setText(tr("No Legend Available"));
currentSymbolItem->setText( tr( "No Legend Available" ) );
}

currentSymbolItem->setLayerID( rasterLayer->id() );
currentSymbolItem->setColor( QColor() );
layerItem->removeRows(0, layerItem->rowCount());
layerItem->removeRows( 0, layerItem->rowCount() );
layerItem->setChild( layerItem->rowCount(), 0, currentSymbolItem );
}
else
Expand Down
2 changes: 1 addition & 1 deletion src/core/composer/qgslegendmodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ class CORE_EXPORT QgsLegendModel: public QStandardItemModel

public slots:
void removeLayer( const QString& layerId );
void addLayer( QgsMapLayer* theMapLayer, double scaleDenominator = -1, QString rule="" );
void addLayer( QgsMapLayer* theMapLayer, double scaleDenominator = -1, QString rule = "" );

signals:
void layersChanged();
Expand Down
8 changes: 4 additions & 4 deletions src/core/pal/labelposition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ namespace pal
return false;

}

bool LabelPosition::isIntersect( double *bbox )
{
int i;
Expand All @@ -201,13 +201,13 @@ namespace pal
else
return false;
}

bool LabelPosition::isInside( double *bbox )
{
for (int i = 0; i < 4; i++ )
for ( int i = 0; i < 4; i++ )
{
if ( !( x[i] >= bbox[0] && x[i] <= bbox[2] &&
y[i] >= bbox[1] && y[i] <= bbox[3] ) )
y[i] >= bbox[1] && y[i] <= bbox[3] ) )
return false;
}

Expand Down
2 changes: 1 addition & 1 deletion src/core/pal/labelposition.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ namespace pal
*\param bbox the bounding-box double[4] = {xmin, ymin, xmax, ymax}
*/
bool isIntersect( double *bbox );

/**
* \brief Is the labelposition inside the bounding-box ?
*
Expand Down
10 changes: 5 additions & 5 deletions src/core/pal/pal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,9 @@ namespace pal
point_p = 8;
line_p = 8;
poly_p = 8;

showPartial = true;

this->map_unit = pal::METER;

std::cout.precision( 12 );
Expand Down Expand Up @@ -901,8 +901,8 @@ namespace pal
if ( dpi > 0 )
this->dpi = dpi;
}
void Pal::setShowPartial(bool show)

void Pal::setShowPartial( bool show )
{
this->showPartial = show;
}
Expand Down Expand Up @@ -936,7 +936,7 @@ namespace pal
{
return dpi;
}

bool Pal::getShowPartial()
{
return showPartial;
Expand Down
10 changes: 5 additions & 5 deletions src/core/pal/pal.h
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ namespace pal
int ejChainDeg;
int tenure;
double candListSize;

/**
* \brief show partial labels (cut-off by the map canvas) or not
*/
Expand Down Expand Up @@ -357,14 +357,14 @@ namespace pal
* @return map resolution (dot per inch)
*/
int getDpi();

/**
*\brief Set flag show partial label
*
* @param show flag value
*/
void setShowPartial(bool show);
*/
void setShowPartial( bool show );

/**
* \brief Get flag show partial label
*
Expand Down
4 changes: 2 additions & 2 deletions src/core/qgspallabeling.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4816,7 +4816,7 @@ void QgsPalLabeling::loadEngineSettings()
mShowingAllLabels = QgsProject::instance()->readBoolEntry(
"PAL", "/ShowingAllLabels", false, &saved );
mShowingPartialsLabels = QgsProject::instance()->readBoolEntry(
"PAL", "/ShowingPartialsLabels", p.getShowPartial(), &saved );
"PAL", "/ShowingPartialsLabels", p.getShowPartial(), &saved );
mSavedWithProject = saved;
}

Expand Down Expand Up @@ -4852,6 +4852,6 @@ QgsLabelingEngineInterface* QgsPalLabeling::clone()
lbl->mShowingAllLabels = mShowingAllLabels;
lbl->mShowingCandidates = mShowingCandidates;
lbl->mShowingShadowRects = mShowingShadowRects;
lbl->mShowingPartialsLabels = mShowingPartialsLabels;
lbl->mShowingPartialsLabels = mShowingPartialsLabels;
return lbl;
}
2 changes: 1 addition & 1 deletion src/core/qgspallabeling.h
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,7 @@ class CORE_EXPORT QgsPalLabeling : public QgsLabelingEngineInterface

bool isShowingPartialsLabels() const { return mShowingPartialsLabels; }
void setShowingPartialsLabels( bool showing ) { mShowingPartialsLabels = showing; }

// implemented methods from labeling engine interface

//! called when we're going to start with rendering
Expand Down
2 changes: 1 addition & 1 deletion src/core/raster/qgsrasterdataprovider.h
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ class CORE_EXPORT QgsRasterDataProvider : public QgsDataProvider, public QgsRast

/** \brief Returns the legend rendered as pixmap
* useful for that layer that need to get legend layer remotly as WMS */
virtual QImage getLegendGraphic( double scale=0, bool forceRefresh = false )
virtual QImage getLegendGraphic( double scale = 0, bool forceRefresh = false )
{
Q_UNUSED( scale );
Q_UNUSED( forceRefresh );
Expand Down
3 changes: 2 additions & 1 deletion src/core/symbology-ng/qgsrulebasedrendererv2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,8 @@ QgsLegendSymbolList QgsRuleBasedRendererV2::Rule::legendSymbolItems( double scal
for ( RuleList::iterator it = mChildren.begin(); it != mChildren.end(); ++it )
{
Rule* rule = *it;
if ( scaleDenominator == -1 || rule->isScaleOK(scaleDenominator) ) {
if ( scaleDenominator == -1 || rule->isScaleOK( scaleDenominator ) )
{
lst << rule->legendSymbolItems( scaleDenominator, ruleFilter );
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/gui/qgscomposerview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ void QgsComposerView::endMarqueeSelect( QMouseEvent* e )
}

QRectF boundsRect = QRectF( mRubberBandItem->transform().dx(), mRubberBandItem->transform().dy(),
mRubberBandItem->rect().width(), mRubberBandItem->rect().height() );
mRubberBandItem->rect().width(), mRubberBandItem->rect().height() );

//determine item selection mode, default to intersection
Qt::ItemSelectionMode selectionMode = Qt::IntersectsItemShape;
Expand Down
2 changes: 1 addition & 1 deletion src/mapserver/qgsprojectparser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3661,7 +3661,7 @@ void QgsProjectParser::loadLabelSettings( QgsLabelingEngineInterface* lbl )
{
pal->setShowingAllLabels( showAllLabelsElem.text().compare( "true", Qt::CaseInsensitive ) == 0 );
}

//mShowingPartialsLabels
QDomElement showPartialsLabelsElem = palElem.firstChildElement( "ShowingPartialsLabels" );
if ( !showPartialsLabelsElem.isNull() )
Expand Down
6 changes: 4 additions & 2 deletions src/mapserver/qgswmsserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,8 @@ QImage* QgsWMSServer::getLegendGraphics()
return 0;
}

if ( !rule.isEmpty() ) {
if ( !rule.isEmpty() )
{
//create second image with the right dimensions
QImage* paintImage = createImage( symbolWidth, symbolHeight );

Expand All @@ -399,7 +400,8 @@ QImage* QgsWMSServer::getLegendGraphics()
p.setRenderHint( QPainter::Antialiasing, true );

QgsComposerLegendItem* currentComposerItem = dynamic_cast<QgsComposerLegendItem*>( rootItem->child( 0 )->child( 0 ) );
if ( currentComposerItem != NULL ) {
if ( currentComposerItem != NULL )
{
QgsComposerLegendItem::ItemType type = currentComposerItem->itemType();
switch ( type )
{
Expand Down
91 changes: 48 additions & 43 deletions src/providers/wms/qgswmsprovider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4001,7 +4001,7 @@ QgsRasterIdentifyResult QgsWmsProvider::identify( const QgsPoint & thePoint, Qgs
if ( !myExtent.isEmpty() )
{
// we cannot reliably identify WMS if theExtent is specified but theWidth or theHeight
// are not, because we dont know original resolution
// are not, because we don't know original resolution
if ( theWidth == 0 || theHeight == 0 )
{
return QgsRasterIdentifyResult( ERROR( tr( "Context not fully specified (extent was defined but width and/or height was not)." ) ) );
Expand Down Expand Up @@ -4600,7 +4600,7 @@ QImage QgsWmsProvider::getLegendGraphic( double scale, bool forceRefresh )
// the layer tags inside capabilities
QgsDebugMsg( "entering." );

if ( !scale && !mGetLegendGraphicScale)
if ( !scale && !mGetLegendGraphicScale )
{
QgsDebugMsg( QString( "No scale factor set" ) );
return QImage();
Expand All @@ -4611,7 +4611,7 @@ QImage QgsWmsProvider::getLegendGraphic( double scale, bool forceRefresh )
forceRefresh = true;
QgsDebugMsg( QString( "Download again due to scale change from: %1 to: %2" ).arg( mGetLegendGraphicScale ).arg( scale ) );
}

if ( forceRefresh )
{
if ( scale )
Expand All @@ -4620,67 +4620,72 @@ QImage QgsWmsProvider::getLegendGraphic( double scale, bool forceRefresh )
}

// if style is not defined, set as "default"
QString currentStyle("default");
QString currentStyle( "default" );
if ( mActiveSubStyles[0] != "" )
{
currentStyle = mActiveSubStyles[0];
}

#if 0
// add WMS GetGraphicLegend request
// TODO set sld version using instance var something like mSldVersion
// TODO at this moment LSD version can be get from LegendURL in getCapability,but parsing of
// this tag is not complete. Below the code that should work if pasing whould correct
// if ( mActiveSubLayers[0] == mCapabilities.capability.layer.name )
// {
// foreach( QgsWmsStyleProperty style, mCapabilities.capability.layer.style )
// {
// if ( currentStyle == style.name )
// {
// url.setUrl( style.legendUrl[0].onlineResource.xlinkHref, QUrl::StrictMode );
// }
// }
// } // is a sublayer
// else if ( mActiveSubLayers[0].contains( mCapabilities.capability.layer.name ) )
// {
// foreach( QgsWmsLayerProperty layerProperty, mCapabilities.capability.layer.layer )
// {
// if ( mActiveSubLayers[0] == layerProperty.name )
// {
// foreach( QgsWmsStyleProperty style, layerProperty.style )
// {
// if ( currentStyle == style.name )
// {
// url.setUrl( style.legendUrl[0].onlineResource.xlinkHref, QUrl::StrictMode );
// }
// }
// }
// }
// }
// this tag is not complete. Below the code that should work if parsing would correct

if ( mActiveSubLayers[0] == mCapabilities.capability.layer.name )
{
foreach ( QgsWmsStyleProperty style, mCapabilities.capability.layer.style )
{
if ( currentStyle == style.name )
{
url.setUrl( style.legendUrl[0].onlineResource.xlinkHref, QUrl::StrictMode );
}
}
} // is a sublayer
else if ( mActiveSubLayers[0].contains( mCapabilities.capability.layer.name ) )
{
foreach ( QgsWmsLayerProperty layerProperty, mCapabilities.capability.layer.layer )
{
if ( mActiveSubLayers[0] == layerProperty.name )
{
foreach ( QgsWmsStyleProperty style, layerProperty.style )
{
if ( currentStyle == style.name )
{
url.setUrl( style.legendUrl[0].onlineResource.xlinkHref, QUrl::StrictMode );
}
}
}
}
}
#endif
QUrl url( mIgnoreGetMapUrl ? mBaseUrl : getMapUrl(), QUrl::StrictMode );
setQueryItem( url, "SERVICE", "WMS" );
setQueryItem( url, "VERSION", mCapabilities.version );
setQueryItem( url, "SLD_VERSION", "1.1.0" ); // can not determine SLD_VERSION
setQueryItem( url, "REQUEST", "GetLegendGraphic" );
setQueryItem( url, "LAYER", mActiveSubLayers[0] );
setQueryItem( url, "STYLE", currentStyle );
setQueryItem( url, "SCALE", QString::number( scale, 'f') );
setQueryItem( url, "SCALE", QString::number( scale, 'f' ) );
setQueryItem( url, "FORMAT", mImageMimeType );

// add config parameter related to resolution
QSettings s;
int defaultLegendGraphicResolution = s.value( "/qgis/defaultLegendGraphicResolution", 0 ).toInt();
QgsDebugMsg( QString( "defaultLegendGraphicResolution: %1" ).arg( defaultLegendGraphicResolution ) );
if ( defaultLegendGraphicResolution ) {
if (url.queryItemValue("map_resolution") != "")
if ( defaultLegendGraphicResolution )
{
if ( url.queryItemValue( "map_resolution" ) != "" )
{
setQueryItem( url, "map_resolution", QString::number(defaultLegendGraphicResolution) );
setQueryItem( url, "map_resolution", QString::number( defaultLegendGraphicResolution ) );
}
else if (url.queryItemValue("dpi") != "")
else if ( url.queryItemValue( "dpi" ) != "" )
{
setQueryItem( url, "dpi", QString::number(defaultLegendGraphicResolution) );
setQueryItem( url, "dpi", QString::number( defaultLegendGraphicResolution ) );
}
else{
QgsLogger::warning(tr("getLegendGraphic: Can not determine resolution uri parameter [map_resolution | dpi]. No resolution parameter will be used"));
else
{
QgsLogger::warning( tr( "getLegendGraphic: Can not determine resolution uri parameter [map_resolution | dpi]. No resolution parameter will be used" ) );
}
}

Expand Down Expand Up @@ -4709,7 +4714,7 @@ QImage QgsWmsProvider::getLegendGraphic( double scale, bool forceRefresh )

QgsDebugMsg( "exiting." );

return mGetLegendGraphicImage;
return mGetLegendGraphicImage;
}

void QgsWmsProvider::getLegendGraphicReplyFinished()
Expand Down Expand Up @@ -4761,16 +4766,16 @@ void QgsWmsProvider::getLegendGraphicReplyFinished()
if ( myLocalImage.isNull() )
{
QgsMessageLog::logMessage( tr( "Returned legend image is flawed [URL: %2]" )
.arg( mGetLegendGraphicReply->url().toString() ), tr( "WMS" ) );
.arg( mGetLegendGraphicReply->url().toString() ), tr( "WMS" ) );
}
else
{
mGetLegendGraphicImage = myLocalImage;

#ifdef QGISDEBUG
QString filename = QDir::tempPath() + "/GetLegendGraphic.png";
mGetLegendGraphicImage.save(filename);
QgsDebugMsg( "saved GetLegendGraphic result in debug ile: "+filename );
mGetLegendGraphicImage.save( filename );
QgsDebugMsg( "saved GetLegendGraphic result in debug ile: " + filename );
#endif
}
}
Expand Down
10 changes: 5 additions & 5 deletions src/providers/wms/qgswmsprovider.h
Original file line number Diff line number Diff line change
Expand Up @@ -650,15 +650,15 @@ class QgsWmsProvider : public QgsRasterDataProvider


/**
* \brief Get GetLegendGraphic if service available otherwise QImage()
* BEAWARE call it the first time specifying scale parameter otherwise it always return QImage()
* \todo some services dowsn't expose getLegendGraphic in capabilities but adding LegendURL in
* \brief Get GetLegendGraphic if service available otherwise QImage()
* BEWARE call it the first time specifying scale parameter otherwise it always return QImage()
* \todo some services doesn't expose getLegendGraphic in capabilities but adds LegendURL in
* the layer tags inside capabilities, but LegendURL parsing is still not developed => getLegendGraphic is
* always called assuming that error means service is not available. Other drowback is that SLD_VERSION
* always called assuming that error means service is not available. Other drawback is that SLD_VERSION
* is inside LegendURL, so at this moment it is fixed to 1.1.0 waiting a correct parsing of LegendURL
* in getCapability
* \param scale Optional parameter that is the Scale of the wms layer
* \param forceRefresh Optional bool parameter to force refresh getLegendGraphic call
* \param forceRefresh Optional bool parameter to force refresh getLegendGraphic call
*/
QImage getLegendGraphic( double scale = 0, bool forceRefresh = false );

Expand Down
22 changes: 11 additions & 11 deletions tests/src/core/testqgsmaplayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@
class TestSignalReceiver : public QObject
{
Q_OBJECT;
public:
TestSignalReceiver() : QObject( 0 ), blendMode( QPainter::CompositionMode_SourceOver ) {}
QPainter::CompositionMode blendMode;
public slots:
void onBlendModeChanged( const QPainter::CompositionMode blendMode )
{
this->blendMode = blendMode;
}

public:
TestSignalReceiver() : QObject( 0 ), blendMode( QPainter::CompositionMode_SourceOver ) {}
QPainter::CompositionMode blendMode;
public slots:
void onBlendModeChanged( const QPainter::CompositionMode blendMode )
{
this->blendMode = blendMode;
}
};

/** \ingroup UnitTests
Expand All @@ -55,7 +55,7 @@ class TestQgsMapLayer: public QObject
void cleanup() {};// will be called after every testfunction.

void isValid();

void setBlendMode();
private:
QgsMapLayer * mpLayer;
Expand Down Expand Up @@ -90,7 +90,7 @@ void TestQgsMapLayer::setBlendMode()
TestSignalReceiver receiver;
QObject::connect( mpLayer, SIGNAL( blendModeChanged( const QPainter::CompositionMode ) ),
&receiver, SLOT( onBlendModeChanged( const QPainter::CompositionMode ) ) );
QCOMPARE( int(receiver.blendMode), 0 );
QCOMPARE( int( receiver.blendMode ), 0 );
mpLayer->setBlendMode( QPainter::CompositionMode_Screen );
// check the signal has been correctly emitted
QCOMPARE( receiver.blendMode, QPainter::CompositionMode_Screen );
Expand Down
24 changes: 12 additions & 12 deletions tests/src/core/testqgsrasterlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,17 +89,17 @@ class TestQgsRasterLayer: public QObject
class TestSignalReceiver : public QObject
{
Q_OBJECT;
public:
TestSignalReceiver() : QObject( 0 ),
rendererChanged( false )
{}
bool rendererChanged;
public slots:
void onRendererChanged()
{
rendererChanged = true;
}

public:
TestSignalReceiver() : QObject( 0 ),
rendererChanged( false )
{}
bool rendererChanged;
public slots:
void onRendererChanged()
{
rendererChanged = true;
}
};

//runs before all tests
Expand Down Expand Up @@ -502,7 +502,7 @@ void TestQgsRasterLayer::setRenderer()
TestSignalReceiver receiver;
QObject::connect( mpRasterLayer, SIGNAL( rendererChanged() ),
&receiver, SLOT( onRendererChanged() ) );
QgsRasterRenderer* renderer = (QgsRasterRenderer*) mpRasterLayer->renderer()->clone();
QgsRasterRenderer* renderer = ( QgsRasterRenderer* ) mpRasterLayer->renderer()->clone();
QCOMPARE( receiver.rendererChanged, false );
mpRasterLayer->setRenderer( renderer );
QCOMPARE( receiver.rendererChanged, true );
Expand Down
60 changes: 30 additions & 30 deletions tests/src/core/testqgsvectorlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,29 +39,29 @@
class TestSignalReceiver : public QObject
{
Q_OBJECT;
public:
TestSignalReceiver() : QObject( 0 ),
rendererChanged( false ),
featureBlendMode( QPainter::CompositionMode(0) ),
transparency( 0 )
{}
bool rendererChanged;
QPainter::CompositionMode featureBlendMode;
int transparency;
public slots:
void onRendererChanged()
{
rendererChanged = true;
}
void onFeatureBlendModeChanged( const QPainter::CompositionMode blendMode )
{
featureBlendMode = blendMode;
}
void onLayerTransparencyChanged( int layerTransparency )
{
transparency = layerTransparency;
}

public:
TestSignalReceiver() : QObject( 0 ),
rendererChanged( false ),
featureBlendMode( QPainter::CompositionMode( 0 ) ),
transparency( 0 )
{}
bool rendererChanged;
QPainter::CompositionMode featureBlendMode;
int transparency;
public slots:
void onRendererChanged()
{
rendererChanged = true;
}
void onFeatureBlendModeChanged( const QPainter::CompositionMode blendMode )
{
featureBlendMode = blendMode;
}
void onLayerTransparencyChanged( int layerTransparency )
{
transparency = layerTransparency;
}
};

/** \ingroup UnitTests
Expand Down Expand Up @@ -676,21 +676,21 @@ class TestQgsVectorLayer: public QObject

};

void QgsVectorLayersetFeatureBlendMode()
{
void QgsVectorLayersetFeatureBlendMode()
{
QgsVectorLayer* vLayer = static_cast< QgsVectorLayer * >( mpPointsLayer );
TestSignalReceiver receiver;
QObject::connect( vLayer, SIGNAL( featureBlendModeChanged( const QPainter::CompositionMode ) ),
&receiver, SLOT( onFeatureBlendModeChanged( const QPainter::CompositionMode ) ) );

QCOMPARE( int(receiver.featureBlendMode), 0 );
QCOMPARE( int( receiver.featureBlendMode ), 0 );
vLayer->setFeatureBlendMode( QPainter::CompositionMode_Screen );
QCOMPARE( receiver.featureBlendMode, QPainter::CompositionMode_Screen );
QCOMPARE( vLayer->featureBlendMode(), QPainter::CompositionMode_Screen );
}
}

void QgsVectorLayersetLayerTransparency()
{
void QgsVectorLayersetLayerTransparency()
{
QgsVectorLayer* vLayer = static_cast< QgsVectorLayer * >( mpPointsLayer );
TestSignalReceiver receiver;
QObject::connect( vLayer, SIGNAL( layerTransparencyChanged( int ) ),
Expand All @@ -700,7 +700,7 @@ class TestQgsVectorLayer: public QObject
vLayer->setLayerTransparency( 50 );
QCOMPARE( receiver.transparency, 50 );
QCOMPARE( vLayer->layerTransparency(), 50 );
}
}
};

QTEST_MAIN( TestQgsVectorLayer )
Expand Down
4 changes: 2 additions & 2 deletions tests/src/python/qgis_local_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ def __init__(self, err=''):
port = 80 or a user-defined port above 1024
fcgipath = path to working qgis_mapserv.fcgi as known by server
sourceurl = DO NOT ADJUST
projdir = path WRITEABLE by this user and READABLE by www server
projdir = path WRITABLE by this user and READABLE by www server
Sample configuration (default):
sourceurl (built) = http://localhost:80/cgi-bin/qgis_mapserv.fcgi
Expand Down Expand Up @@ -340,7 +340,7 @@ def _checkItemReadable(item, path):


def _checkItemWriteable(item, path):
msg = ('Server configuration {0} is not writeable from:\n'
msg = ('Server configuration {0} is not writable from:\n'
' {1}'.format(item, path))
assert os.access(path, os.W_OK), msg

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@

class WSGIServer(BaseAJPServer, ThreadedServer):
"""
AJP1.3/WSGI server. Runs your WSGI application as a persistant program
AJP1.3/WSGI server. Runs your WSGI application as a persistent program
that understands AJP1.3. Opens up a TCP socket, binds it, and then
waits for forwarded requests from your webserver.
Expand Down
8 changes: 4 additions & 4 deletions tests/src/python/test_qgspallabeling_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,24 +299,24 @@ def test_write_read_settings(self):

msg = '\nLayer settings read not same as settings written'
self.assertDictEqual(lyr1dict, lyr2dict, msg)

def test_default_partials_labels_enabled(self):
# Verify ShowingPartialsLabels is enabled for PAL by default
pal = QgsPalLabeling()
self.assertTrue(pal.isShowingPartialsLabels())

def test_partials_labels_activate(self):
pal = QgsPalLabeling()
# Enable partials labels
pal.setShowingPartialsLabels(True)
self.assertTrue(pal.isShowingPartialsLabels())

def test_partials_labels_deactivate(self):
pal = QgsPalLabeling()
# Disable partials labels
pal.setShowingPartialsLabels(False)
self.assertFalse(pal.isShowingPartialsLabels())



def runSuite(module, tests):
Expand Down
2 changes: 1 addition & 1 deletion tests/src/python/test_qgspallabeling_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def test_text_color(self):
# Label color change
self.lyr.textColor = Qt.blue
self.checkTest()

def test_partials_labels_enabled(self):
# Set Big font size
font = QFont(self._TestFont)
Expand Down