Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
indentation update
  • Loading branch information
jef-n committed Jan 22, 2015
1 parent ccc0d2f commit cce2eb5
Show file tree
Hide file tree
Showing 23 changed files with 75 additions and 75 deletions.
2 changes: 1 addition & 1 deletion python/core/__init__.py
Expand Up @@ -55,7 +55,7 @@ def func(self, values, feature, parent):
expandargs = False
if arg_count == 0 and not name[0] == '$':
name = '${0}'.format(name)

if arg_count == "auto":
# Work out the number of args we need.
# Number of function args - 2. The last two args are always feature, parent.
Expand Down
4 changes: 2 additions & 2 deletions python/core/composer/qgscomposermultiframe.sip
Expand Up @@ -22,13 +22,13 @@ class QgsComposerMultiFrame: QgsComposerObject
if (dynamic_cast<QgsComposerHtml*>(sipCpp) != NULL)
sipClass = sipClass_QgsComposerHtml;
else if (dynamic_cast<QgsComposerAttributeTableV2*>(sipCpp) != NULL)
sipClass = sipClass_QgsComposerAttributeTableV2;
sipClass = sipClass_QgsComposerAttributeTableV2;
else if (dynamic_cast<QgsComposerTableV2*>(sipCpp) != NULL)
sipClass = sipClass_QgsComposerTableV2;
else if (dynamic_cast<QgsComposerMultiFrame*>(sipCpp) != NULL)
sipClass = sipClass_QgsComposerMultiFrame;
else
sipClass = NULL;
sipClass = NULL;
%End

public:
Expand Down
16 changes: 8 additions & 8 deletions python/core/effects/qgsimageoperation.sip
Expand Up @@ -32,7 +32,7 @@ class QgsImageOperation
GrayscaleLuminosity, /*< grayscale by perceptual luminosity (weighted sum of color RGB components) */
GrayscaleAverage /*< grayscale by taking average of color RGB components */
};

/** Flip operation types
*/
enum FlipType
Expand All @@ -57,7 +57,7 @@ class QgsImageOperation
* contrast of the image.
*/
static void adjustBrightnessContrast( QImage &image, const int brightness, const double contrast );

/**Alter the hue or saturation of a QImage.
* @param image QImage to alter
* @param saturation double between 0 and 2 inclusive, where 0 = desaturate and 1.0 = no change
Expand All @@ -67,20 +67,20 @@ class QgsImageOperation
*/
static void adjustHueSaturation( QImage &image, const double saturation, const QColor& colorizeColor = QColor(),
const double colorizeStrength = 1.0 );

/**Multiplies opacity of image pixel values by a factor.
* @param image QImage to alter
* @param factor factor to multiple pixel's opacity by
*/
static void multiplyOpacity( QImage &image, const double factor );

/**Overlays a color onto an image. This operation retains the alpha channel of the
* original image, but replaces all image pixel colors with the specified color.
* @param image QImage to alter
* @param color color to overlay (any alpha component of the color is ignored)
*/
static void overlayColor( QImage &image, const QColor& color );

/**Struct for storing properties of a distance transform operation*/
struct DistanceTransformProperties
{
Expand Down Expand Up @@ -117,19 +117,19 @@ class QgsImageOperation
* @param alphaOnly set to true to blur only the alpha component of the image
*/
static void stackBlur( QImage &image, const int radius, const bool alphaOnly = false );

/**Performs a gaussian blur on an image. Gaussian blur is slower but results in a high
* quality blur.
* @param image QImage to blur
* @param radius blur radius in pixels
* @returns blurred image
*/
static QImage* gaussianBlur( QImage &image, const int radius ) /Factory/;

/**Flips an image horizontally or vertically
* @param image QImage to flip
* @param type type of flip to perform (horizontal or vertical)
*/
static void flipImage( QImage &image, FlipType type );

};
2 changes: 1 addition & 1 deletion python/core/qgscoordinatereferencesystem.sip
Expand Up @@ -304,7 +304,7 @@ class QgsCoordinateReferenceSystem

/**Returns auth id of related geographic CRS*/
QString geographicCRSAuthId() const;

/**Returns a list of recently used projections
* @returns list of srsid for recently used projections
* @note added in QGIS 2.7
Expand Down
2 changes: 1 addition & 1 deletion python/core/qgsdatadefined.sip
Expand Up @@ -23,7 +23,7 @@ class QgsDataDefined
const QString& field = QString() );

/**
* Construct a new data defined object, analyse the expression to determine
* Construct a new data defined object, analyse the expression to determine
* if it's a simple field
*
* @param expression can be null
Expand Down
6 changes: 3 additions & 3 deletions python/core/symbology-ng/qgsrendererv2.sip
Expand Up @@ -43,11 +43,11 @@ class QgsFeatureRendererV2
else if (sipCpp->type() == "RuleRenderer")
sipClass = sipClass_QgsRuleBasedRendererV2;
else if (sipCpp->type() == "heatmapRenderer")
sipClass = sipClass_QgsHeatmapRenderer;
sipClass = sipClass_QgsHeatmapRenderer;
else if (sipCpp->type() == "invertedPolygonRenderer")
sipClass = sipClass_QgsInvertedPolygonRenderer;
sipClass = sipClass_QgsInvertedPolygonRenderer;
else if (sipCpp->type() == "pointDisplacement")
sipClass = sipClass_QgsPointDisplacementRenderer;
sipClass = sipClass_QgsPointDisplacementRenderer;
else
sipClass = 0;
%End
Expand Down
6 changes: 3 additions & 3 deletions python/core/symbology-ng/qgssymbollayerv2.sip
Expand Up @@ -44,16 +44,16 @@ class QgsSymbolLayerV2
else if (dynamic_cast<QgsSVGFillSymbolLayer*>(sipCpp) != NULL)
sipClass = sipClass_QgsSVGFillSymbolLayer;
else if (dynamic_cast<QgsRasterFillSymbolLayer*>(sipCpp) != NULL)
sipClass = sipClass_QgsRasterFillSymbolLayer;
sipClass = sipClass_QgsRasterFillSymbolLayer;
else
sipClass = sipClass_QgsImageFillSymbolLayer;
}
else if (dynamic_cast<QgsCentroidFillSymbolLayerV2*>(sipCpp) != NULL)
sipClass = sipClass_QgsCentroidFillSymbolLayerV2;
else if (dynamic_cast<QgsGradientFillSymbolLayerV2*>(sipCpp) != NULL)
sipClass = sipClass_QgsGradientFillSymbolLayerV2;
sipClass = sipClass_QgsGradientFillSymbolLayerV2;
else if (dynamic_cast<QgsShapeburstFillSymbolLayerV2*>(sipCpp) != NULL)
sipClass = sipClass_QgsShapeburstFillSymbolLayerV2;
sipClass = sipClass_QgsShapeburstFillSymbolLayerV2;
else
sipClass = sipClass_QgsFillSymbolLayerV2;
break;
Expand Down
8 changes: 4 additions & 4 deletions python/gui/symbology-ng/qgssymbollayerv2widget.sip
Expand Up @@ -12,21 +12,21 @@ class QgsSymbolLayerV2Widget : QWidget
virtual QgsSymbolLayerV2* symbolLayer() = 0;

protected:

void registerDataDefinedButton( QgsDataDefinedButton * button, const QString & propertyName, QgsDataDefinedButton::DataType type, const QString & description );

/** Get label for data defined entry.
* Implemented only for 'size' of marker symbols
* @note added in 2.1
*/
virtual QString dataDefinedPropertyLabel( const QString &entryName );

signals:
void changed();

protected slots:
void updateDataDefinedProperty();

};

///////////
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/core/parameters.py
Expand Up @@ -520,7 +520,7 @@ def setValue(self, obj):
else:
# Layer could not be found
return False


def getFileFilter(self):
exts = dataobjects.getSupportedOutputRasterLayerExtensions()
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/gui/BatchInputSelectionPanel.py
Expand Up @@ -130,7 +130,7 @@ def showFileSelectionDialog(self):
settings.setValue('/Processing/LastInputPath',
os.path.dirname(unicode(files[0])))
for i, filename in enumerate(files):
files[i] = dataobjects.getRasterSublayer(filename, self.param)
files[i] = dataobjects.getRasterSublayer(filename, self.param)
if len(files) == 1:
self.text.setText(files[0])
else:
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/gui/InputLayerSelectorPanel.py
Expand Up @@ -71,7 +71,7 @@ def showSelectionDialog(self):
filename = dataobjects.getRasterSublayer(filename, self.param)
self.cmbText.addItem(filename, filename)
self.cmbText.setCurrentIndex(self.cmbText.count() - 1)


def getValue(self):
return self.cmbText.itemData(self.cmbText.currentIndex())
22 changes: 11 additions & 11 deletions python/plugins/processing/tools/dataobjects.py
Expand Up @@ -375,23 +375,23 @@ def exportTable(table):
return filename[:-3] + 'dbf'
else:
return filename

def getRasterSublayer(path, param):

layer = QgsRasterLayer(path)

try:
# If the layer is a raster layer and has multiple sublayers, let the user chose one.
# # Based on QgisApp::askUserForGDALSublayers
if layer and param.showSublayersDialog and layer.dataProvider().name() == "gdal" and len(layer.subLayers()) > 1:
if layer and param.showSublayersDialog and layer.dataProvider().name() == "gdal" and len(layer.subLayers()) > 1:
layers = []
subLayerNum = 0
# simplify raster sublayer name
for subLayer in layer.subLayers():
# if netcdf/hdf use all text after filename
if bool(re.match('netcdf', subLayer, re.I)) or bool(re.match('hdf', subLayer, re.I)):
subLayer = subLayer.split(path)[1]
subLayer = subLayer[1:]
subLayer = subLayer[1:]
else:
# remove driver name and file name
subLayer.replace(subLayer.split(":")[0], "")
Expand All @@ -405,22 +405,22 @@ def getRasterSublayer(path, param):
subLayer = subLayer[:-1]
if subLayer.endswith("\""):
subLayer = subLayer[:-1]

layers.append(str(subLayerNum)+"|"+subLayer)
subLayerNum = subLayerNum + 1

# Use QgsSublayersDialog
# Would be good if QgsSublayersDialog had an option to allow only one sublayer to be selected
chooseSublayersDialog = QgsSublayersDialog(QgsSublayersDialog.Gdal, "gdal")
# Would be good if QgsSublayersDialog had an option to allow only one sublayer to be selected
chooseSublayersDialog = QgsSublayersDialog(QgsSublayersDialog.Gdal, "gdal")
chooseSublayersDialog.populateLayerTable( layers, "|" )

if chooseSublayersDialog.exec_():
return layer.subLayers()[chooseSublayersDialog.selectionIndexes()[0]]
else:
# If user pressed cancel then just return the input path
return path
else:
# If the sublayers selection dialog is not to be shown then just return the input path
# If the sublayers selection dialog is not to be shown then just return the input path
return path
except:
# If the layer is not a raster layer, then just return the input path
Expand Down
4 changes: 2 additions & 2 deletions python/plugins/processing/ui/convert.py
Expand Up @@ -2,9 +2,9 @@
import subprocess

def convertUiFile(f):

command = ["pyuic4.bat", f, "-o", "ui_" + os.path.splitext(f)[0] + ".py"]

proc = subprocess.Popen(
command,
shell=True,
Expand Down
2 changes: 1 addition & 1 deletion python/user.py
Expand Up @@ -2,7 +2,7 @@
import sys
import glob

from qgis.core import QgsApplication
from qgis.core import QgsApplication

def load_user_expressions(path):
"""
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgsmaptooloffsetcurve.cpp
Expand Up @@ -203,7 +203,7 @@ void QgsMapToolOffsetCurve::canvasMoveEvent( QMouseEvent * e )
QgsPointLocator::Match m = mCanvas->snappingUtils()->snapToMap( e->pos() );
if ( m.isValid() )
{
if ( ( m.layer() && m.layer()->id() != mSourceLayerId ) || m.featureId() != mModifiedFeature )
if (( m.layer() && m.layer()->id() != mSourceLayerId ) || m.featureId() != mModifiedFeature )
{
layerCoords = toLayerCoordinates( layer, m.point() );
mSnapVertexMarker = new QgsVertexMarker( mCanvas );
Expand Down
14 changes: 7 additions & 7 deletions src/core/qgslayerdefinition.h
Expand Up @@ -12,13 +12,13 @@
*/
class CORE_EXPORT QgsLayerDefinition
{
public:
/* Loads the QLR at path into QGIS. New layers are added to rootGroup and the map layer registry*/
static bool loadLayerDefinition( const QString & path, QgsLayerTreeGroup* rootGroup, QString &errorMessage);
/* Loads the QLR from the XML document. New layers are added to rootGroup and the map layer registry */
static bool loadLayerDefinition( QDomDocument doc, QgsLayerTreeGroup* rootGroup, QString &errorMessage);
/* Export the selected layer tree nodes to a QLR file */
static bool exportLayerDefinition( QString path, QList<QgsLayerTreeNode*> selectedTreeNodes, QString &errorMessage );
public:
/* Loads the QLR at path into QGIS. New layers are added to rootGroup and the map layer registry*/
static bool loadLayerDefinition( const QString & path, QgsLayerTreeGroup* rootGroup, QString &errorMessage );
/* Loads the QLR from the XML document. New layers are added to rootGroup and the map layer registry */
static bool loadLayerDefinition( QDomDocument doc, QgsLayerTreeGroup* rootGroup, QString &errorMessage );
/* Export the selected layer tree nodes to a QLR file */
static bool exportLayerDefinition( QString path, QList<QgsLayerTreeNode*> selectedTreeNodes, QString &errorMessage );
};

#endif // QGSLAYERDEFINITION_H
2 changes: 1 addition & 1 deletion src/core/qgsofflineediting.cpp
Expand Up @@ -140,7 +140,7 @@ bool QgsOfflineEditing::convertToOfflineProject( const QString& offlineDataPath,

if ( newLayer )
{
Q_FOREACH( QgsVectorJoinInfo join, it.value() )
Q_FOREACH ( QgsVectorJoinInfo join, it.value() )
{
QgsVectorLayer* newJoinedLayer = layerIdMapping.value( join.joinLayerId );
if ( newJoinedLayer )
Expand Down
14 changes: 7 additions & 7 deletions src/core/qgspallabeling.cpp
Expand Up @@ -1784,11 +1784,11 @@ void QgsPalLayerSettings::registerFeature( QgsFeature& f, const QgsRenderContext
const QgsMapToPixel& m2p = context.mapToPixel();
if ( m2p.mapRotation() )
{
if ( geom->rotate( m2p.mapRotation(), context.extent().center() ) )
{
QgsDebugMsg( QString("Error rotating geometry").arg( geom->exportToWkt() ) );
return; // really ?
}
if ( geom->rotate( m2p.mapRotation(), context.extent().center() ) )
{
QgsDebugMsg( QString( "Error rotating geometry" ).arg( geom->exportToWkt() ) );
return; // really ?
}
}

// CLIP the geometry if it is bigger than the extent
Expand Down Expand Up @@ -3908,7 +3908,7 @@ void QgsPalLabeling::drawLabeling( QgsRenderContext& context )
// also pre-scaled/translated, as suggested here:
// http://hub.qgis.org/issues/11856
QgsMapToPixel xform = mMapSettings->mapToPixel();
xform.setMapRotation(0,0,0);
xform.setMapRotation( 0, 0, 0 );
#else
const QgsMapToPixel& xform = mMapSettings->mapToPixel();
#endif
Expand Down Expand Up @@ -4213,7 +4213,7 @@ void QgsPalLabeling::drawLabel( pal::LabelPosition* label, QgsRenderContext& con
// also pre-scaled/translated, as suggested here:
// http://hub.qgis.org/issues/11856
QgsMapToPixel xform = context.mapToPixel();
xform.setMapRotation(0,0,0);
xform.setMapRotation( 0, 0, 0 );
#else
const QgsMapToPixel& xform = context.mapToPixel();
#endif
Expand Down

0 comments on commit cce2eb5

Please sign in to comment.