Skip to content

Commit

Permalink
identation update and fix clang 3.3 warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Jun 20, 2013
1 parent 0710de3 commit 9bbc647
Show file tree
Hide file tree
Showing 45 changed files with 99 additions and 109 deletions.
2 changes: 1 addition & 1 deletion python/plugins/GdalTools/tools/doOverview.py
Expand Up @@ -136,7 +136,7 @@ def getArguments( self ):
# TODO fix batch enabled, argument order is wrong, levels not at end
if self.isBatchEnabled():
return arguments

arguments.append(self.getInputFileName())

if len(self.mPyramidOptionsWidget.overviewList()) == 0:
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/GdalTools/tools/inOutSelector.py
Expand Up @@ -135,7 +135,7 @@ def setFilename(self, fn=None):
elif isinstance(fn, str) or isinstance(fn, unicode):
fn = unicode( fn )

#TODO test
#TODO test
elif isinstance(fn, list):
if len( fn ) > 0:
if self.getType() & self.MULTIFILE:
Expand Down
4 changes: 2 additions & 2 deletions python/plugins/sextante/algs/ftools/ConvexHull.py
Expand Up @@ -131,7 +131,7 @@ def processAlgorithm(self, progress):
outFeat.setAttributes([fid,val,area,perim])
writer.addFeature(outFeat)
except:
raise GeoAlgorithmExecutionException("Exception while computing convex hull")
raise GeoAlgorithmExecutionException("Exception while computing convex hull")
fid += 1
else:
hull = []
Expand All @@ -155,4 +155,4 @@ def processAlgorithm(self, progress):
raise GeoAlgorithmExecutionException("Exception while computing convex hull")

del writer

2 changes: 1 addition & 1 deletion python/plugins/sextante/algs/ftools/ExportGeometryInfo.py
Expand Up @@ -95,7 +95,7 @@ def processAlgorithm(self, progress):
# 0 - layer CRS
# 1 - project CRS
# 2 - ellipsoidal
if method == 2:
if method == 2:
ellips = QgsProject.instance().readEntry("Measure", "/Ellipsoid", GEO_NONE)[0]
crs = layer.crs().srsid()
elif method == 1:
Expand Down
Expand Up @@ -105,7 +105,7 @@ def processAlgorithm(self, progress):
tmpGeom = QgsGeometry(ftPoint.geometry())
if geom.contains(tmpGeom):
weight = str(ftPoint.attributes()[fieldIdx])
try:
try:
count += float(weight)
except:
pass #ignore fields with non-numeric values
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/sextante/core/SextanteTableWriter.py
Expand Up @@ -44,7 +44,7 @@ def __init__(self, fileName, encoding, fields):
file.write("\n")
file.close()

def addRecord(self, values):
def addRecord(self, values):
file = open(self.fileName, "a")
file.write(";".join([unicode(value) for value in values]))
file.write("\n")
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/sextante/gui/AlgorithmExecutionDialog.py
Expand Up @@ -323,7 +323,7 @@ def resetGUI(self):
QApplication.restoreOverrideCursor()
self.progressLabel.setText("")
self.progress.setValue(100)
#self.progress.setMaximum(100)
#self.progress.setMaximum(100)
self.buttonBox.button(QtGui.QDialogButtonBox.Ok).setEnabled(True)
self.buttonBox.button(QtGui.QDialogButtonBox.Close).setEnabled(True)
self.buttonBox.button(QtGui.QDialogButtonBox.Cancel).setEnabled(False)
Expand Down
4 changes: 2 additions & 2 deletions python/plugins/sextante/gui/BatchProcessingDialog.py
Expand Up @@ -154,7 +154,7 @@ def accept(self):
continue
widget = self.table.cellWidget(row, col)
if not self.setParameterValueFromWidget(param, widget, alg):
self.progressLabel.setText("<b>Missing parameter value: " + param.description + " (row " + str(row + 1) + ")</b>")
self.progressLabel.setText("<b>Missing parameter value: " + param.description + " (row " + str(row + 1) + ")</b>")
self.algs = None
return
col+=1
Expand All @@ -167,7 +167,7 @@ def accept(self):
out.value = text
col+=1
else:
self.progressLabel.setText("<b>Wrong or missing parameter value: " + out.description + " (row " + str(row + 1) + ")</b>")
self.progressLabel.setText("<b>Wrong or missing parameter value: " + out.description + " (row " + str(row + 1) + ")</b>")
self.algs = None
return
self.algs.append(alg)
Expand Down
6 changes: 3 additions & 3 deletions python/plugins/sextante/modeler/ModelerGraphicItem.py
Expand Up @@ -190,7 +190,7 @@ def paint(self, painter, option, widget=None):

rect = QtCore.QRectF(-(ModelerGraphicItem.BOX_WIDTH + 2)/2.0, -(ModelerGraphicItem.BOX_HEIGHT + 2)/2.0,
ModelerGraphicItem.BOX_WIDTH + 2, ModelerGraphicItem.BOX_HEIGHT + 2)
painter.setPen(QtGui.QPen(QtCore.Qt.gray, 1))
painter.setPen(QtGui.QPen(QtCore.Qt.gray, 1))
color = QtGui.QColor(125,232, 232)
if isinstance(self.element, Parameter):
color = QtGui.QColor(179,179, 255)
Expand Down Expand Up @@ -227,7 +227,7 @@ def paint(self, painter, option, widget=None):
painter.drawText(pt, text)
i += 1
i = 1
h = (fm.height() * 1.2)
h = (fm.height() * 1.2)
h = h + ModelerGraphicItem.BOX_HEIGHT / 2.0
pt = QtCore.QPointF(-(ModelerGraphicItem.BOX_WIDTH)/2 + 25, h)
painter.drawText(pt, "Out")
Expand Down Expand Up @@ -284,7 +284,7 @@ def itemChange(self, change, value):

def polygon(self):
font = QtGui.QFont("Verdana", 8)
fm = QtGui.QFontMetricsF(font)
fm = QtGui.QFontMetricsF(font)
hUp = (fm.height() * 1.2) * (len(self.element.parameters) + 2)
hDown = (fm.height() * 1.2) * (len(self.element.outputs) + 2)
pol = QtGui.QPolygonF([
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/sextante/otb/OTBAlgorithm.py
Expand Up @@ -140,7 +140,7 @@ def processAlgorithm(self, progress):
elif isinstance(param, ParameterMultipleInput):
commands.append(param.name)
files = str(param.value).split(";")
paramvalue = " ".join(["\"" + f + "\"" for f in files])
paramvalue = " ".join(["\"" + f + "\"" for f in files])
commands.append(paramvalue)
elif isinstance(param, ParameterSelection):
commands.append(param.name)
Expand Down
4 changes: 2 additions & 2 deletions python/plugins/sextante/r/RAlgorithm.py
Expand Up @@ -390,12 +390,12 @@ def checkBeforeOpeningParametersDialog(self):
path = RUtils.RFolder()
if path == "":
return "R folder is not configured.\nPlease configure it before running R scripts."

R_INSTALLED = "R_INSTALLED"
settings = QSettings()
if settings.contains(R_INSTALLED):
return
if SextanteUtils.isWindows():
if SextanteUtils.isWindows():
if SextanteConfig.getSetting(RUtils.R_USE64):
execDir = "x64"
else:
Expand Down
10 changes: 5 additions & 5 deletions python/pyplugin_installer/qgsplugininstallerinstallingdialog.py
Expand Up @@ -49,13 +49,13 @@ def __init__(self, parent, plugin):
self.buttonBox.clicked.connect(self.abort)

url = QUrl(plugin["download_url"])

fileName = plugin["filename"]
tmpDir = QDir.tempPath()
tmpPath = QDir.cleanPath(tmpDir+"/"+fileName)
self.file = QFile(tmpPath)
self.nam = QPNetworkAccessManager(url.host(), )

self.nam = QPNetworkAccessManager(url.host(), )
#self.http = QPHttp(url.host(), port)
self.request = QNetworkRequest(url)
self.reply = self.nam.get( self.request )
Expand Down Expand Up @@ -85,7 +85,7 @@ def readProgress(self, done, total):
# ----------------------------------------- #
def requestFinished(self, reply):
self.buttonBox.setEnabled(False)
if reply.error() != QNetworkReply.NoError:
if reply.error() != QNetworkReply.NoError:
self.mResult = self.http.errorString()
self.reject()
return
Expand Down Expand Up @@ -121,6 +121,6 @@ def requestFinished(self, reply):
def abort(self):
if self.reply.isRunning():
self.nam.finished.disconnect()
self.reply.abort()
self.reply.abort()
self.mResult = self.tr("Aborted by user")
self.reject()
25 changes: 21 additions & 4 deletions src/analysis/raster/qgsrastercalcnode.cpp
Expand Up @@ -15,19 +15,36 @@
#include "qgsrastercalcnode.h"
#include <cfloat>

QgsRasterCalcNode::QgsRasterCalcNode(): mLeft( 0 ), mRight( 0 ), mRasterMatrix( 0 ), mNumber( 0 )
QgsRasterCalcNode::QgsRasterCalcNode()
: mLeft( 0 )
, mRight( 0 )
, mNumber( 0 )
{
}

QgsRasterCalcNode::QgsRasterCalcNode( double number ): mType( tNumber ), mLeft( 0 ), mRight( 0 ), mRasterMatrix( 0 ), mNumber( number )
QgsRasterCalcNode::QgsRasterCalcNode( double number )
: mType( tNumber )
, mLeft( 0 )
, mRight( 0 )
, mNumber( number )
{
}

QgsRasterCalcNode::QgsRasterCalcNode( Operator op, QgsRasterCalcNode* left, QgsRasterCalcNode* right ): mType( tOperator ), mLeft( left ), mRight( right ), mRasterMatrix( 0 ), mNumber( 0 ), mOperator( op )
QgsRasterCalcNode::QgsRasterCalcNode( Operator op, QgsRasterCalcNode* left, QgsRasterCalcNode* right )
: mType( tOperator )
, mLeft( left )
, mRight( right )
, mNumber( 0 )
, mOperator( op )
{
}

QgsRasterCalcNode::QgsRasterCalcNode( const QString& rasterName ): mType( tRasterRef ), mLeft( 0 ), mRight( 0 ), mRasterMatrix( 0 ), mNumber( 0 ), mRasterName( rasterName )
QgsRasterCalcNode::QgsRasterCalcNode( const QString& rasterName )
: mType( tRasterRef )
, mLeft( 0 )
, mRight( 0 )
, mNumber( 0 )
, mRasterName( rasterName )
{
}

Expand Down
1 change: 0 additions & 1 deletion src/analysis/raster/qgsrastercalcnode.h
Expand Up @@ -81,7 +81,6 @@ class ANALYSIS_EXPORT QgsRasterCalcNode
Type mType;
QgsRasterCalcNode* mLeft;
QgsRasterCalcNode* mRight;
QgsRasterMatrix* mRasterMatrix;
double mNumber;
QString mRasterName;
Operator mOperator;
Expand Down
20 changes: 10 additions & 10 deletions src/app/main.cpp
Expand Up @@ -254,28 +254,28 @@ void myMessageOutput( QtMsgType type, const char *msg )
{
fprintf( stderr, "Fatal: %s\n", msg );
#if defined(linux) && !defined(ANDROID)
if( access( "/usr/bin/c++filt", X_OK) )
if ( access( "/usr/bin/c++filt", X_OK ) )
{
( void ) write( STDERR_FILENO, "Stacktrace (c++filt NOT FOUND):\n", 32 );
}
else
{
int fd[2];

if( pipe(fd)==0 && fork()==0 )
if ( pipe( fd ) == 0 && fork() == 0 )
{
close( STDIN_FILENO );
close( fd[1] );
dup( fd[0] );
execl( "/usr/bin/c++filt", "c++filt", (char *) 0 );
exit(1);
close( STDIN_FILENO );
close( fd[1] );
dup( fd[0] );
execl( "/usr/bin/c++filt", "c++filt", ( char * ) 0 );
exit( 1 );
}

( void ) write( STDERR_FILENO, "Stacktrace (piped through c++filt):\n", 36 );

close( STDERR_FILENO );
close( fd[0] );
dup( fd[1] );
close( STDERR_FILENO );
close( fd[0] );
dup( fd[1] );
}

void *buffer[256];
Expand Down
12 changes: 6 additions & 6 deletions src/app/nodetool/qgsselectedfeature.cpp
Expand Up @@ -421,7 +421,7 @@ void QgsSelectedFeature::createVertexMapPolygon()
const QgsPolyline& poly = polygon[i2];
for ( int i = 0; i < poly.size(); i++ )
{
mVertexMap.insert( y + i, new QgsVertexEntry( mCanvas, mVlayer, poly[i], i, tr( "ring %1, vertex %2" ).arg( i2 ).arg( i ) ) );
mVertexMap.insert( y + i, new QgsVertexEntry( mCanvas, mVlayer, poly[i], tr( "ring %1, vertex %2" ).arg( i2 ).arg( i ) ) );
}
mVertexMap[y + poly.size() - 1 ]->setEqual( y );
mVertexMap[y]->setEqual( y + poly.size() - 1 );
Expand All @@ -441,7 +441,7 @@ void QgsSelectedFeature::createVertexMapPolygon()
const QgsPolyline& poly = poly2[i3];
for ( int i = 0; i < poly.size(); i++ )
{
mVertexMap.insert( y + i, new QgsVertexEntry( mCanvas, mVlayer, poly[i], y + i - 1, tr( "polygon %1, ring %2, vertex %3" ).arg( i2 ).arg( i3 ).arg( i ) ) );
mVertexMap.insert( y + i, new QgsVertexEntry( mCanvas, mVlayer, poly[i], tr( "polygon %1, ring %2, vertex %3" ).arg( i2 ).arg( i3 ).arg( i ) ) );
}
mVertexMap[y + poly.size() - 1]->setEqual( y );
mVertexMap[y]->setEqual( y + poly.size() - 1 );
Expand All @@ -465,7 +465,7 @@ void QgsSelectedFeature::createVertexMapLine()
QgsPolyline poly = mLine[i2];
for ( int i = 0; i < poly.size(); i++ )
{
mVertexMap.insert( y + i, new QgsVertexEntry( mCanvas, mVlayer, poly[i], i, tr( "polyline %1, vertex %2" ).arg( i2 ).arg( i ) ) );
mVertexMap.insert( y + i, new QgsVertexEntry( mCanvas, mVlayer, poly[i], tr( "polyline %1, vertex %2" ).arg( i2 ).arg( i ) ) );
}
y += poly.size();
}
Expand All @@ -475,7 +475,7 @@ void QgsSelectedFeature::createVertexMapLine()
QgsPolyline poly = mGeometry->asPolyline();
for ( int i = 0; i < poly.size(); i++ )
{
mVertexMap.insert( i, new QgsVertexEntry( mCanvas, mVlayer, poly[i], i, tr( "vertex %1" ).arg( i ) ) );
mVertexMap.insert( i, new QgsVertexEntry( mCanvas, mVlayer, poly[i], tr( "vertex %1" ).arg( i ) ) );
}
}
}
Expand All @@ -490,13 +490,13 @@ void QgsSelectedFeature::createVertexMapPoint()
QgsMultiPoint poly = mGeometry->asMultiPoint();
for ( int i = 0; i < poly.size(); i++ )
{
mVertexMap.insert( i, new QgsVertexEntry( mCanvas, mVlayer, poly[i], 1, tr( "point %1" ).arg( i ) ) );
mVertexMap.insert( i, new QgsVertexEntry( mCanvas, mVlayer, poly[i], tr( "point %1" ).arg( i ) ) );
}
}
else
{
// single point
mVertexMap.insert( 1, new QgsVertexEntry( mCanvas, mVlayer, mGeometry->asPoint(), 1, tr( "single point" ) ) );
mVertexMap.insert( 1, new QgsVertexEntry( mCanvas, mVlayer, mGeometry->asPoint(), tr( "single point" ) ) );
}
}

Expand Down
3 changes: 1 addition & 2 deletions src/app/nodetool/qgsvertexentry.cpp
Expand Up @@ -16,12 +16,11 @@
#include "nodetool/qgsvertexentry.h"
#include "qgsmaprenderer.h"

QgsVertexEntry::QgsVertexEntry( QgsMapCanvas *canvas, QgsMapLayer *layer, QgsPoint p, int originalIndex, QString tooltip, QgsVertexMarker::IconType type, int penWidth )
QgsVertexEntry::QgsVertexEntry( QgsMapCanvas *canvas, QgsMapLayer *layer, QgsPoint p, QString tooltip, QgsVertexMarker::IconType type, int penWidth )
: mSelected( false )
, mEquals( -1 )
, mInRubberBand( false )
, mRubberBandNr( 0 )
, mOriginalIndex( originalIndex )
, mPenWidth( penWidth )
, mToolTip( tooltip )
, mType( type )
Expand Down
2 changes: 0 additions & 2 deletions src/app/nodetool/qgsvertexentry.h
Expand Up @@ -29,7 +29,6 @@ class QgsVertexEntry
bool mInRubberBand;
int mRubberBandNr;
int mRubberBandIndex;
int mOriginalIndex;
int mPenWidth;
QString mToolTip;
QgsVertexMarker::IconType mType;
Expand All @@ -41,7 +40,6 @@ class QgsVertexEntry
QgsVertexEntry( QgsMapCanvas *canvas,
QgsMapLayer *layer,
QgsPoint p,
int originalIndex,
QString tooltip = QString::null,
QgsVertexMarker::IconType type = QgsVertexMarker::ICON_BOX,
int penWidth = 2 );
Expand Down
14 changes: 7 additions & 7 deletions src/app/pluginmanager/qgspluginmanager_texts.cpp
Expand Up @@ -5,7 +5,7 @@

void QgsPluginManager::initTabDescriptions()
{
if( !mTabDescriptions.isEmpty() )
if ( !mTabDescriptions.isEmpty() )
return;

mTabDescriptions.insert( "installed_plugins", tr( "<h3>Installed Plugins</h3>\
Expand All @@ -25,7 +25,7 @@ To <i>enable</i> or <i>disable</i> a plugin,\
Plugins showing in <span style='color:red'>red</span> are not loaded because there is a problem. Consult the \
'Invalid' tab to see more details, or to reinstall or uninstall this plugin.\
</p>\
") );
" ) );



Expand All @@ -36,11 +36,11 @@ Here are <b>upgradeable plugins</b>. It means more recent versions of installed
plugins are available in the repositories.\
</p>\
\
") );
" ) );



mTabDescriptions.insert( "get_more_plugins", tr( "<h3>Get more plugins</h3>\
mTabDescriptions.insert( "get_more_plugins", tr( "<h3>Get more plugins</h3>\
\
<p>\
Here you see the list of all plugins available in the repositories, but which are <b>not yet installed</b>.\
Expand All @@ -57,7 +57,7 @@ then click the 'Install plugin' button.\
</p>\
\
\
") );
" ) );



Expand All @@ -68,7 +68,7 @@ Here you see brand <b>new</b> plugins which can be installed.\
</p>\
\
\
") );
" ) );



Expand All @@ -92,6 +92,6 @@ Another common reason is that a python plugin needs some external python librari
You can install them yourself, depending on your operating system. After a correct \
install the plugin should work.\
</p>\
") );
" ) );

}

0 comments on commit 9bbc647

Please sign in to comment.