diff --git a/python/plugins/processing/algs/otb/OTBAlgorithmProvider.py b/python/plugins/processing/algs/otb/OTBAlgorithmProvider.py index 4b629836d24..032efba6457 100644 --- a/python/plugins/processing/algs/otb/OTBAlgorithmProvider.py +++ b/python/plugins/processing/algs/otb/OTBAlgorithmProvider.py @@ -75,10 +75,10 @@ class OTBAlgorithmProvider(AlgorithmProvider): def initializeSettings(self): AlgorithmProvider.initializeSettings(self) if OTBUtils.findOtbPath() is None: - ProcessingConfig.addSetting(Setting(self.getDescription(), OTBUtils.OTB_FOLDER, + ProcessingConfig.addSetting(Setting(self.getDescription(), OTBUtils.OTB_FOLDER, "OTB command line tools folder", OTBUtils.otbPath())) - if OTBUtils.findOtbLibPath() is None: - ProcessingConfig.addSetting(Setting(self.getDescription(), OTBUtils.OTB_LIB_FOLDER, + if OTBUtils.findOtbLibPath() is None: + ProcessingConfig.addSetting(Setting(self.getDescription(), OTBUtils.OTB_LIB_FOLDER, "OTB applications folder", OTBUtils.otbLibPath())) ProcessingConfig.addSetting(Setting(self.getDescription(), OTBUtils.OTB_SRTM_FOLDER, "SRTM tiles folder", OTBUtils.otbSRTMPath())) ProcessingConfig.addSetting(Setting(self.getDescription(), OTBUtils.OTB_GEOID_FILE, "Geoid file", OTBUtils.otbGeoidPath())) diff --git a/python/plugins/processing/algs/otb/OTBUtils.py b/python/plugins/processing/algs/otb/OTBUtils.py index 7185c1bb991..b3b3b30484a 100644 --- a/python/plugins/processing/algs/otb/OTBUtils.py +++ b/python/plugins/processing/algs/otb/OTBUtils.py @@ -60,7 +60,7 @@ class OTBUtils: if os.path.exists(os.path.join(testfolder, "otbcli")): folder = testfolder elif isWindows(): - testfolder = os.path.join(os.path.dirname(QgsApplication.prefixPath()), + testfolder = os.path.join(os.path.dirname(QgsApplication.prefixPath()), os.pardir, "bin") if os.path.exists(os.path.join(testfolder, "otbcli.bat")): folder = testfolder @@ -71,12 +71,12 @@ class OTBUtils: return folder @staticmethod - def otbPath(): + def otbPath(): folder = OTBUtils.findOtbPath() if folder is None: folder = ProcessingConfig.getSetting(OTBUtils.OTB_FOLDER) return folder - + @staticmethod def findOtbLibPath(): folder = None @@ -105,8 +105,8 @@ class OTBUtils: if folder is None: folder = ProcessingConfig.getSetting(OTBUtils.OTB_LIB_FOLDER) return folder - - + + @staticmethod def otbSRTMPath(): folder = ProcessingConfig.getSetting(OTBUtils.OTB_SRTM_FOLDER) diff --git a/python/plugins/processing/algs/qgis/SetRasterStyle.py b/python/plugins/processing/algs/qgis/SetRasterStyle.py index 30f93c54211..7b87057474c 100644 --- a/python/plugins/processing/algs/qgis/SetRasterStyle.py +++ b/python/plugins/processing/algs/qgis/SetRasterStyle.py @@ -38,7 +38,7 @@ from qgis.utils import iface class SetRasterStyle(GeoAlgorithm): INPUT = 'INPUT' - STYLE = 'STYLE' + STYLE = 'STYLE' OUTPUT = 'OUTPUT' @@ -46,22 +46,22 @@ class SetRasterStyle(GeoAlgorithm): self.allowOnlyOpenedLayers = True self.name = 'Set style for raster layer' self.group = 'Raster general tools' - self.addParameter(ParameterRaster(self.INPUT, 'Vector layer')) + self.addParameter(ParameterRaster(self.INPUT, 'Vector layer')) self.addParameter(ParameterFile(self.STYLE, 'Style file', False, False, 'qml')) self.addOutput(OutputRaster(self.OUTPUT, 'Styled layer', True)) def processAlgorithm(self, progress): filename = self.getParameterValue(self.INPUT) - layer = dataobjects.getObjectFromUri(filename) - + layer = dataobjects.getObjectFromUri(filename) + style = self.getParameterValue(self.STYLE) with open(style) as f: - xml = "".join(f.readlines()) + xml = "".join(f.readlines()) d = QDomDocument(); d.setContent(xml); - n = d.firstChild(); - layer.readSymbology(n, '') + n = d.firstChild(); + layer.readSymbology(n, '') self.setOutputValue(self.OUTPUT, filename) iface.mapCanvas().refresh() iface.legendInterface().refreshLayerSymbology(layer) diff --git a/python/plugins/processing/algs/qgis/SetVectorStyle.py b/python/plugins/processing/algs/qgis/SetVectorStyle.py index db32b6f9d46..3e6fe808e9d 100644 --- a/python/plugins/processing/algs/qgis/SetVectorStyle.py +++ b/python/plugins/processing/algs/qgis/SetVectorStyle.py @@ -37,7 +37,7 @@ from qgis.utils import iface class SetVectorStyle(GeoAlgorithm): INPUT = 'INPUT' - STYLE = 'STYLE' + STYLE = 'STYLE' OUTPUT = 'OUTPUT' @@ -46,18 +46,18 @@ class SetVectorStyle(GeoAlgorithm): self.name = 'Set style for vector layer' self.group = 'Vector general tools' self.addParameter(ParameterVector(self.INPUT, 'Vector layer', - [ParameterVector.VECTOR_TYPE_ANY])) + [ParameterVector.VECTOR_TYPE_ANY])) self.addParameter(ParameterFile(self.STYLE, 'Style file', False, False, 'qml')) self.addOutput(OutputVector(self.OUTPUT, 'Styled layer', True)) def processAlgorithm(self, progress): filename = self.getParameterValue(self.INPUT) - layer = dataobjects.getObjectFromUri(filename) - + layer = dataobjects.getObjectFromUri(filename) + style = self.getParameterValue(self.STYLE) - layer.loadNamedStyle(style) - + layer.loadNamedStyle(style) + self.setOutputValue(self.OUTPUT, filename) iface.mapCanvas().refresh() iface.legendInterface().refreshLayerSymbology(layer) diff --git a/python/plugins/processing/algs/saga/SagaAlgorithmProvider.py b/python/plugins/processing/algs/saga/SagaAlgorithmProvider.py index 62989e2f2b2..325febfa0bf 100644 --- a/python/plugins/processing/algs/saga/SagaAlgorithmProvider.py +++ b/python/plugins/processing/algs/saga/SagaAlgorithmProvider.py @@ -52,7 +52,7 @@ class SagaAlgorithmProvider(AlgorithmProvider): 'Use SAGA 2.0.8 syntax', not isMac())) if isWindows() or isMac(): ProcessingConfig.addSetting(Setting(self.getDescription(), - SagaUtils.SAGA_FOLDER, 'SAGA folder', '')) + SagaUtils.SAGA_FOLDER, 'SAGA folder', '')) ProcessingConfig.addSetting(Setting(self.getDescription(), SagaUtils.SAGA_IMPORT_EXPORT_OPTIMIZATION, 'Enable SAGA Import/Export optimizations', @@ -74,7 +74,7 @@ class SagaAlgorithmProvider(AlgorithmProvider): def _loadAlgorithms(self): - self.algs = [] + self.algs = [] folder = SagaUtils.sagaDescriptionPath() for descriptionFile in os.listdir(folder): if descriptionFile.endswith('txt'): diff --git a/python/plugins/processing/algs/saga/SagaUtils.py b/python/plugins/processing/algs/saga/SagaUtils.py index bcf5d1640fe..c216ec11d2f 100644 --- a/python/plugins/processing/algs/saga/SagaUtils.py +++ b/python/plugins/processing/algs/saga/SagaUtils.py @@ -60,7 +60,7 @@ class SagaUtils: @staticmethod def findSagaFolder(): - folder = None + folder = None if isMac(): testfolder = os.path.join(QgsApplication.prefixPath(), 'bin') if os.path.exists(os.path.join(testfolder, 'saga_cmd')): @@ -70,16 +70,16 @@ class SagaUtils: if os.path.exists(os.path.join(testfolder, 'saga_cmd')): folder = testfolder elif isWindows(): - testfolder = os.path.join(os.path.dirname(QgsApplication.prefixPath()), 'saga') + testfolder = os.path.join(os.path.dirname(QgsApplication.prefixPath()), 'saga') if os.path.exists(os.path.join(testfolder, 'saga_cmd.exe')): folder = testfolder return folder - + @staticmethod - def sagaPath(): + def sagaPath(): folder = SagaUtils.findSagaFolder() if folder is None: - folder = ProcessingConfig.getSetting(SagaUtils.SAGA_FOLDER) + folder = ProcessingConfig.getSetting(SagaUtils.SAGA_FOLDER) return folder or '' @staticmethod @@ -87,8 +87,8 @@ class SagaUtils: if SagaUtils.findSagaFolder() is not None: return not isMac(); else: - return ProcessingConfig.getSetting(SagaUtils.SAGA_208) - + return ProcessingConfig.getSetting(SagaUtils.SAGA_208) + @staticmethod def sagaDescriptionPath(): return os.path.join(os.path.dirname(__file__), 'description') diff --git a/python/plugins/processing/parameters/ParameterFile.py b/python/plugins/processing/parameters/ParameterFile.py index f6ef7c8294a..388e52230de 100644 --- a/python/plugins/processing/parameters/ParameterFile.py +++ b/python/plugins/processing/parameters/ParameterFile.py @@ -53,7 +53,7 @@ class ParameterFile(Parameter): else: self.value = '' if self.ext is not None and self.value != '': - return self.value.endswith(self.ext) + return self.value.endswith(self.ext) return True def deserialize(self, s): diff --git a/src/app/qgsidentifyresultsdialog.cpp b/src/app/qgsidentifyresultsdialog.cpp index dfe1257d5dd..538d1d9bc85 100644 --- a/src/app/qgsidentifyresultsdialog.cpp +++ b/src/app/qgsidentifyresultsdialog.cpp @@ -433,7 +433,7 @@ void QgsIdentifyResultsDialog::addFeature( QgsVectorLayer *vlayer, const QgsFeat featItem->addChild( attrItem ); } - if( !featureLabeled ) + if ( !featureLabeled ) { featItem->setText( 0, tr( "feature id" ) ); featItem->setText( 1, QString::number( f.id() ) ); diff --git a/src/core/qgsgeometry.cpp b/src/core/qgsgeometry.cpp index 20e75aa5450..e31d770ac7a 100644 --- a/src/core/qgsgeometry.cpp +++ b/src/core/qgsgeometry.cpp @@ -6440,9 +6440,9 @@ QgsGeometry* QgsGeometry::convertToPolygon( bool destMultipart ) QgsGeometry *QgsGeometry::unaryUnion( const QList &geometryList ) { QList geoms; - foreach( QgsGeometry* g, geometryList ) + foreach ( QgsGeometry* g, geometryList ) { - geoms.append( GEOSGeom_clone(g->asGeos()) ); + geoms.append( GEOSGeom_clone( g->asGeos() ) ); } GEOSGeometry *geomUnion = _makeUnion( geoms ); QgsGeometry *ret = new QgsGeometry(); diff --git a/src/core/qgsgeometry.h b/src/core/qgsgeometry.h index bf522a7e458..89b203147c5 100644 --- a/src/core/qgsgeometry.h +++ b/src/core/qgsgeometry.h @@ -356,6 +356,7 @@ class CORE_EXPORT QgsGeometry QgsGeometry* buffer( double distance, int segments ); /** Returns a buffer region around the geometry, with additional style options. + * @param distance buffer distance * @param segments For round joins, number of segments to approximate quarter-circle * @param endCapStyle Round (1) / Flat (2) / Square (3) end cap style * @param joinStyle Round (1) / Mitre (2) / Bevel (3) join style diff --git a/src/core/qgsmaprendererjob.cpp b/src/core/qgsmaprendererjob.cpp index a148d4db70d..f2b3e87ad5e 100644 --- a/src/core/qgsmaprendererjob.cpp +++ b/src/core/qgsmaprendererjob.cpp @@ -562,6 +562,7 @@ LayerRenderJobs QgsMapRendererJob::prepareJobs( QPainter* painter, QgsPalLabelin { bool cacheValid = mCache->init( mSettings.visibleExtent(), mSettings.scale() ); QgsDebugMsg( QString( "CACHE VALID: %1" ).arg( cacheValid ) ); + Q_UNUSED( cacheValid ); } mGeometryCaches.clear(); @@ -915,6 +916,7 @@ void QgsMapRendererParallelJob::renderLayerStatic( LayerRenderJob& job ) job.renderer->render(); int tt = t.elapsed(); QgsDebugMsg( QString( "job %1 end [%2 ms]" ).arg(( ulong ) &job, 0, 16 ).arg( tt ) ); + Q_UNUSED( tt ); } diff --git a/src/core/symbology-ng/qgslinesymbollayerv2.cpp b/src/core/symbology-ng/qgslinesymbollayerv2.cpp index 94e708c8be8..44976a5fdc0 100644 --- a/src/core/symbology-ng/qgslinesymbollayerv2.cpp +++ b/src/core/symbology-ng/qgslinesymbollayerv2.cpp @@ -462,7 +462,7 @@ void QgsSimpleLineSymbolLayerV2::applyDataDefinedSymbology( QgsSymbolV2RenderCon { dashWidthDiv = 1.0; } - + QVector dashVector; QStringList dashList = dashPatternExpression->evaluate( const_cast( context.feature() ) ).toString().split( ";" ); QStringList::const_iterator dashIt = dashList.constBegin(); diff --git a/src/gui/layertree/qgslayertreemodel.cpp b/src/gui/layertree/qgslayertreemodel.cpp index be37651b82f..1076bad38a2 100644 --- a/src/gui/layertree/qgslayertreemodel.cpp +++ b/src/gui/layertree/qgslayertreemodel.cpp @@ -479,7 +479,9 @@ void QgsLayerTreeModel::setLayerTreeNodeFont( int nodeType, const QFont& font ) } } else + { QgsDebugMsg( "invalid node type" ); + } } diff --git a/src/gui/qgsmapcanvasmap.cpp b/src/gui/qgsmapcanvasmap.cpp index c5e0e510485..eef29e5df9f 100644 --- a/src/gui/qgsmapcanvasmap.cpp +++ b/src/gui/qgsmapcanvasmap.cpp @@ -42,7 +42,9 @@ void QgsMapCanvasMap::paint( QPainter* painter ) { int w = qRound( boundingRect().width() ) - 2, h = qRound( boundingRect().height() ) - 2; // setRect() makes the size +2 :-( if ( mImage.size() != QSize( w, h ) ) + { QgsDebugMsg( QString( "map paint DIFFERENT SIZE: img %1,%2 item %3,%4" ).arg( mImage.width() ).arg( mImage.height() ).arg( w ).arg( h ) ); + } painter->drawImage( QRect( 0, 0, w, h ), mImage ); }