Skip to content
Permalink
Browse files
automatic indentation update (r9447-r9517)
git-svn-id: http://svn.osgeo.org/qgis/trunk@9518 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Oct 22, 2008
1 parent 0b9b2d3 commit 5a68ac12b046aa8039302084a4b6895d4e648846
@@ -4187,8 +4187,8 @@ void QgisApp::loadPythonSupport()

if ( mPythonUtils && mPythonUtils->isEnabled() )
{
QgsPluginRegistry::instance()->setPythonUtils(mPythonUtils);
QgsPluginRegistry::instance()->setPythonUtils( mPythonUtils );

mActionShowPythonDialog = new QAction( tr( "Python Console" ), this );
connect( mActionShowPythonDialog, SIGNAL( triggered() ), this, SLOT( showPythonDialog() ) );

@@ -5224,7 +5224,7 @@ void QgisApp::activateDeactivateLayerRelatedActions( QgsMapLayer* layer )

//NOTE: This check does not really add any protection, as it is called on load not on layer select/activate
//If you load a layer with a provider and idenitfy ability then load another without, the tool would be disabled for both

//Enable the Identify tool ( GDAL datasets draw without a provider )
//but turn off if data provider exists and has no Identify capabilities
mActionIdentify->setEnabled( true );
@@ -297,8 +297,8 @@ void QgsGraduatedSymbolDialog::adjustClassification()

if ( provider )
{
if ( modeComboBox->currentText() == tr( "Equal Interval" ) ||
modeComboBox->currentText() == tr( "Quantiles" ) )
if ( modeComboBox->currentText() == tr( "Equal Interval" ) ||
modeComboBox->currentText() == tr( "Quantiles" ) )
{
minimum = provider->minimumValue( field ).toDouble();
maximum = provider->maximumValue( field ).toDouble();
@@ -590,11 +590,11 @@ void QgsGraduatedSymbolDialog::updateEntryIcon( QgsSymbol * thepSymbol,
switch ( myType )
{
case QGis::Point:
{
int myWidthScale = 4; //magick no to try to make vector props dialog preview look same as legend
thepItem->setIcon( QIcon( QPixmap::fromImage( thepSymbol->getPointSymbolAsImage( myWidthScale ) ) ) );
}
break;
{
int myWidthScale = 4; //magick no to try to make vector props dialog preview look same as legend
thepItem->setIcon( QIcon( QPixmap::fromImage( thepSymbol->getPointSymbolAsImage( myWidthScale ) ) ) );
}
break;
case QGis::Line:
thepItem->setIcon( QIcon( QPixmap::fromImage( thepSymbol->getLineSymbolAsImage() ) ) );
break;
@@ -95,9 +95,9 @@ void QgsMapToolAddVertex::canvasReleaseEvent( QMouseEvent * e )
//add segment points in case of topological editing
int topologicalEditing = QgsProject::instance()->readNumEntry( "Digitizing", "/TopologicalEditing", 0 );
if ( topologicalEditing )
{
insertSegmentVerticesForSnap( snapResults, vlayer );
}
{
insertSegmentVerticesForSnap( snapResults, vlayer );
}

snappedPointMapCoord = snapPointFromResults( snapResults, e->pos() );
snappedPointLayerCoord = toLayerCoordinates( vlayer, snappedPointMapCoord );
@@ -80,10 +80,10 @@ void QgsMapToolSplitFeatures::canvasReleaseEvent( QMouseEvent * e )
//bring up dialog if a split was not possible (polygon) or only done once (line)
int topologicalEditing = QgsProject::instance()->readNumEntry( "Digitizing", "/TopologicalEditing", 0 );
int returnCode = vlayer->splitFeatures( mCaptureList, topologicalEditing );
if(returnCode == 4)
{
QMessageBox::warning(0, tr("No feature split done"), tr("If there are selected features, the split tool only applies to the selected ones. If you like to split all features under the split line, clear the selection"));
}
if ( returnCode == 4 )
{
QMessageBox::warning( 0, tr( "No feature split done" ), tr( "If there are selected features, the split tool only applies to the selected ones. If you like to split all features under the split line, clear the selection" ) );
}
else if ( returnCode != 0 )
{
//several intersections but only one split (most likely line)
@@ -34,12 +34,12 @@ QgsPluginRegistry *QgsPluginRegistry::instance()
}

QgsPluginRegistry::QgsPluginRegistry()
: mPythonUtils(NULL)
: mPythonUtils( NULL )
{
// constructor does nothing
}

void QgsPluginRegistry::setPythonUtils(QgsPythonUtils* pythonUtils)
void QgsPluginRegistry::setPythonUtils( QgsPythonUtils* pythonUtils )
{
mPythonUtils = pythonUtils;
}
@@ -102,19 +102,19 @@ void QgsPluginRegistry::unloadAll()
it != plugins.end();
it++ )
{
if (isPythonPlugin(it->second->name()))
if ( isPythonPlugin( it->second->name() ) )
{
if (mPythonUtils)
mPythonUtils->unloadPlugin(it->second->library());
if ( mPythonUtils )
mPythonUtils->unloadPlugin( it->second->library() );
else
QgsDebugMsg("warning: python utils is NULL");
QgsDebugMsg( "warning: python utils is NULL" );
}
else
{
if ( it->second->plugin() )
it->second->plugin()->unload();
else
QgsDebugMsg("warning: plugin is NULL:" + it->second->name());
QgsDebugMsg( "warning: plugin is NULL:" + it->second->name() );
}
}
}
@@ -51,7 +51,7 @@ class QgsPluginRegistry
//! Unload plugins
void unloadAll();
//! Save pointer for python utils (needed for unloading python plugins)
void setPythonUtils(QgsPythonUtils* pythonUtils);
void setPythonUtils( QgsPythonUtils* pythonUtils );
protected:
//! protected constructor
QgsPluginRegistry();
@@ -438,11 +438,11 @@ void QgsUniqueValueDialog::updateEntryIcon( QgsSymbol * thepSymbol,
switch ( myType )
{
case QGis::Point:
{
int myWidthScale = 4; //magick no to try to make vector props dialog preview look same as legend
thepItem->setIcon( QIcon( QPixmap::fromImage( thepSymbol->getPointSymbolAsImage( myWidthScale ) ) ) );
}
break;
{
int myWidthScale = 4; //magick no to try to make vector props dialog preview look same as legend
thepItem->setIcon( QIcon( QPixmap::fromImage( thepSymbol->getPointSymbolAsImage( myWidthScale ) ) ) );
}
break;
case QGis::Line:
thepItem->setIcon( QIcon( QPixmap::fromImage( thepSymbol->getLineSymbolAsImage() ) ) );
break;
@@ -180,8 +180,8 @@ bool QgsCoordinateReferenceSystem::createFromEpsg( long id )

bool QgsCoordinateReferenceSystem::createFromSrsId( long id )
{
return loadFromDb( id < 100000 ? QgsApplication::srsDbFilePath() :
QgsApplication::qgisUserDbFilePath(), "srs_id", id );
return loadFromDb( id < 100000 ? QgsApplication::srsDbFilePath() :
QgsApplication::qgisUserDbFilePath(), "srs_id", id );
}

bool QgsCoordinateReferenceSystem::loadFromDb( QString db, QString field, long id )
@@ -242,54 +242,54 @@ class CORE_EXPORT QgsCoordinateReferenceSystem
* @return long theSrsId The internal sqlite3 srs.db primary key for this srs
*/
long srsid() const;

/*! Get the postgis srid for this srs
* @return long theSRID the Postgis spatial_ref_sys identifier for this srs (defaults to 0)
*/
long postgisSrid() const;

/*! Get the EpsgCrsId identifier for this srs
* @return long theEpsg the ESPG identifier for this srs (defaults to 0)
*/
long epsg() const;

/*! Get the Description
* @return QString the Description A textual description of the srs.
* @note A zero length string will be returned if the description is uninitialised
*/
QString description() const;

/*! Get the Projection Acronym
* @return QString theProjectionAcronym The official proj4 acronym for the projection family
* @note A zero length string will be returned if the projectionAcronym is uninitialised
*/
QString projectionAcronym() const;

/*! Get the Ellipsoid Acronym
* @return QString theEllipsoidAcronym The official proj4 acronym for the ellipoid
* @note A zero length string will be returned if the ellipsoidAcronym is uninitialised
*/
QString ellipsoidAcronym() const;

/*! A helper to get an wkt representation of this srs
* @return string containing Wkt of the srs
*/
QString toWkt() const;

/** Get the Proj Proj4 string representation of this srs.
/** Get the Proj Proj4 string representation of this srs.
* If proj and ellps keys are found in the parameters,
* they will be stripped out and the Projection and ellipsoid acronyms will be
* overridden with these.
* @return QString theProj4String Proj4 format specifies that define this srs.
* @note A zero length string will be returned if the toProj4 is uninitialised
*/
QString toProj4() const;

/*! Get this Geographic? flag
* @return bool theGeoFlag Whether this is a geographic or projected coordinate system
*/
bool geographicFlag() const;

/*! Get the units that the projection is in
* @return QGis::UnitType that gives the units for the coordinate system
*/
@@ -305,7 +305,7 @@ class CORE_EXPORT QgsCoordinateReferenceSystem
*/
QString validationHint();
// Mutators -----------------------------------
// We dont want to expose these to the public api since they wont create
// We dont want to expose these to the public api since they wont create
// a fully valid crs. Programmers should use the createFrom* methods rather
private:
/** A static helper function to find out the proj4 string for a srsid
@@ -4883,24 +4883,24 @@ int QgsGeometry::splitPolygonGeometry( GEOSGeometry* splitLine, QList<QgsGeometr
}

bool splitDone = true;
int nGeometriesThis = GEOSGetNumGeometries(mGeos); //original number of geometries
if(testedGeometries.size() == nGeometriesThis)
{
splitDone = false;
}
int nGeometriesThis = GEOSGetNumGeometries( mGeos ); //original number of geometries
if ( testedGeometries.size() == nGeometriesThis )
{
splitDone = false;
}

mergeGeometriesMultiTypeSplit( testedGeometries );

//no split done, preserve original geometry
if(!splitDone)
if ( !splitDone )
{
for ( int i = 0; i < testedGeometries.size(); ++i )
{
for(int i = 0; i < testedGeometries.size(); ++i)
{
GEOSGeom_destroy(testedGeometries[i]);
}
return 1;
GEOSGeom_destroy( testedGeometries[i] );
}
else if(testedGeometries.size() > 0) //split successfull
return 1;
}
else if ( testedGeometries.size() > 0 ) //split successfull
{
GEOSGeom_destroy( mGeos );
mGeos = testedGeometries[0];
@@ -245,10 +245,10 @@ class CORE_EXPORT QgsGeometry
@param topological true if topological editing is enabled
@topologyTestPoints OUT: points that need to be tested for topological completeness in the dataset
@return 0 in case of success, 1 if geometry has not been split, error else*/
int splitGeometry( const QList<QgsPoint>& splitLine,
QList<QgsGeometry*>&newGeometries,
bool topological,
QList<QgsPoint>& topologyTestPoints );
int splitGeometry( const QList<QgsPoint>& splitLine,
QList<QgsGeometry*>&newGeometries,
bool topological,
QList<QgsPoint>& topologyTestPoints );

/**Changes this geometry such that it does not intersect the other geometry
@param other geometry that should not be intersect
@@ -1758,12 +1758,12 @@ int QgsVectorLayer::splitFeatures( const QList<QgsPoint>& splitLine, bool topolo
}
}

if(numberOfSplitedFeatures == 0 && selectedIds.size() > 0)
{
//There is a selection but no feature has been split.
//Maybe user forgot that only the selected features are split
returnCode = 4;
}
if ( numberOfSplitedFeatures == 0 && selectedIds.size() > 0 )
{
//There is a selection but no feature has been split.
//Maybe user forgot that only the selected features are split
returnCode = 4;
}


//now add the new features to this vectorlayer
@@ -1918,15 +1918,15 @@ int QgsVectorLayer::addTopologicalPoints( const QgsPoint& p )

//work with a tolerance because coordinate projection may introduce some rounding
double threshold = 0.0000001;
if(mCRS && mCRS->mapUnits() == QGis::Meters)
{
threshold = 0.001;
}
else if(mCRS && mCRS->mapUnits() == QGis::Feet)
{
threshold = 0.0001;
}
if ( mCRS && mCRS->mapUnits() == QGis::Meters )
{
threshold = 0.001;
}
else if ( mCRS && mCRS->mapUnits() == QGis::Feet )
{
threshold = 0.0001;
}


if ( snapWithContext( p, threshold, snapResults, QgsSnapper::SNAP_TO_SEGMENT ) != 0 )
{
@@ -77,7 +77,7 @@ QgsGraduatedSymbolRenderer::~QgsGraduatedSymbolRenderer()
QgsGraduatedSymbolRenderer::Mode QgsGraduatedSymbolRenderer::mode() const
{
//mode is only really used to be able to reinstate
//the graduated dialog properties properly, so we
//the graduated dialog properties properly, so we
//dont do anything else besides accessors and mutators in
//this class
return mMode;
@@ -86,7 +86,7 @@ QgsGraduatedSymbolRenderer::Mode QgsGraduatedSymbolRenderer::mode() const
void QgsGraduatedSymbolRenderer::setMode( QgsGraduatedSymbolRenderer::Mode theMode )
{
//mode is only really used to be able to reinstate
//the graduated dialog properties properly, so we
//the graduated dialog properties properly, so we
//dont do anything else besides accessors and mutators in
//this class
mMode = theMode;
@@ -183,7 +183,7 @@ void QgsGraduatedSymbolRenderer::renderFeature( QPainter * p, QgsFeature & f, QI
brush.setColor( mSelectionColor );
p->setBrush( brush );
}
else //dont draw outlines in selection colour for polys otherwise they appear merged
else //dont draw outlines in selection colour for polys otherwise they appear merged
{
pen.setColor( mSelectionColor );
}
@@ -310,12 +310,12 @@ bool QgsGraduatedSymbolRenderer::writeXML( QDomNode & layer_node, QDomDocument &
// Mode field first ...
//

QString modeValue="";
QString modeValue = "";
if ( mMode == QgsGraduatedSymbolRenderer::Empty )
{
modeValue == "Empty";
modeValue == "Empty";
}
else if ( QgsGraduatedSymbolRenderer::Quantile )
else if ( QgsGraduatedSymbolRenderer::Quantile )
{
modeValue = "Quantile";
}
Loading

0 comments on commit 5a68ac1

Please sign in to comment.