550 changes: 275 additions & 275 deletions src/core/qgsdiagramrendererv2.h

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions src/core/qgsexpression.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -789,14 +789,14 @@ static QVariant fcnRound( const QVariantList& values , QgsFeature *f, QgsExpress

static QVariant fcnScale( const QVariantList&, QgsFeature*, QgsExpression* parent )
{
return QVariant( parent->scale() );
return QVariant( parent->scale() );
}

static QVariant fcnFormatNumber( const QVariantList& values, QgsFeature*, QgsExpression* parent )
{
double value = getDoubleValue( values.at(0), parent );
int places = getIntValue( values.at(1), parent );
return QString( "%L1" ).arg( value, 0, 'f', places );
double value = getDoubleValue( values.at( 0 ), parent );
int places = getIntValue( values.at( 1 ), parent );
return QString( "%L1" ).arg( value, 0, 'f', places );
}

QList<QgsExpression::FunctionDef> QgsExpression::gmBuiltinFunctions;
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsgeometry.h
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ class CORE_EXPORT QgsGeometry
double sqrDistToVertexAt( QgsPoint& point, int atVertex );

/**
* Searches for the the closest vertex in this geometry to the given point.
* Searches for the closest vertex in this geometry to the given point.
* @param point Specifiest the point for search
* @param atVertex Receives index of the closest vertex
* @return The squared cartesian distance is also returned in sqrDist, negative number on error
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsmaplayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ class CORE_EXPORT QgsMapLayer : public QObject
/** Retrieve the style URI for this layer
* (either as a .qml file on disk or as a
* record in the users style table in their personal qgis.db)
* @return a QString withe the style file name
* @return a QString with the style file name
* @see also loadNamedStyle () and saveNamedStyle ();
* @note This method was added in QGIS 1.8
*/
Expand Down
1 change: 1 addition & 0 deletions src/core/qgsrectangle.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ class CORE_EXPORT QgsRectangle
QgsPoint center() const;
//! Scale the rectangle around its center point
void scale( double scaleFactor, const QgsPoint *c = 0 );
//! Deprecated in 1.9, use scale instead
Q_DECL_DEPRECATED void expand( double scaleFactor, const QgsPoint *c = 0 ) { return scale( scaleFactor * 2.0, c ); }
//! return the intersection with the given rectangle
QgsRectangle intersect( const QgsRectangle *rect ) const;
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsvectorlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3160,7 +3160,7 @@ bool QgsVectorLayer::readSymbology( const QDomNode& node, QString& errorMessage
bool allowNull = editTypeElement.attribute( "allowNull" ) == "true";
bool orderByValue = editTypeElement.attribute( "orderByValue" ) == "true";
bool allowMulti = editTypeElement.attribute( "allowMulti", "false" ) == "true";
QString filterAttributeColumn= editTypeElement.attribute( "filterAttributeColumn", QString::null );
QString filterAttributeColumn = editTypeElement.attribute( "filterAttributeColumn", QString::null );
QString filterAttributeValue = editTypeElement.attribute( "filterAttributeValue", QString::null );
mValueRelations[ name ] = ValueRelationData( id, key, value, allowNull, orderByValue, allowMulti, filterAttributeColumn, filterAttributeValue );
}
Expand Down
28 changes: 14 additions & 14 deletions src/core/raster/qgsrasterchecker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ QgsRasterChecker::QgsRasterChecker( ) :
mErrMsgStyle = "color: #ff0000;";
}

bool QgsRasterChecker::runTest( QString theVerifiedKey, QString theVerifiedUri,
bool QgsRasterChecker::runTest( QString theVerifiedKey, QString theVerifiedUri,
QString theExpectedKey, QString theExpectedUri )
{
bool ok = true;
Expand All @@ -46,14 +46,14 @@ bool QgsRasterChecker::runTest( QString theVerifiedKey, QString theVerifiedUri,
QgsRasterDataProvider* verifiedProvider = QgsRasterLayer::loadProvider( theVerifiedKey, theVerifiedUri );
if ( !verifiedProvider || !verifiedProvider->isValid() )
{
error( QString( "Cannot load provider %1 with URI: %2" ).arg( theVerifiedKey).arg( theVerifiedUri), mReport );
error( QString( "Cannot load provider %1 with URI: %2" ).arg( theVerifiedKey ).arg( theVerifiedUri ), mReport );
ok = false;
}

QgsRasterDataProvider* expectedProvider = QgsRasterLayer::loadProvider( theExpectedKey, theExpectedUri );
if ( !expectedProvider || !expectedProvider->isValid() )
{
error( QString( "Cannot load provider %1 with URI: %2" ).arg( theExpectedKey).arg( theExpectedUri ), mReport );
error( QString( "Cannot load provider %1 with URI: %2" ).arg( theExpectedKey ).arg( theExpectedUri ), mReport );
ok = false;
}

Expand All @@ -63,7 +63,7 @@ bool QgsRasterChecker::runTest( QString theVerifiedKey, QString theVerifiedUri,
mReport += QString( "Expected URI: %1<br>" ).arg( theExpectedUri.replace( "&", "&amp;" ) );

mReport += "<br>";
mReport += QString("<table style='%1'>\n").arg( mTabStyle );
mReport += QString( "<table style='%1'>\n" ).arg( mTabStyle );
mReport += compareHead();

compare( "Band count", verifiedProvider->bandCount(), expectedProvider->bandCount(), mReport, ok );
Expand All @@ -86,7 +86,7 @@ bool QgsRasterChecker::runTest( QString theVerifiedKey, QString theVerifiedUri,
{
bool bandOk = true;
mReport += QString( "<h3>Band %1</h3>\n" ).arg( band );
mReport += QString("<table style='%1'>\n").arg( mTabStyle );
mReport += QString( "<table style='%1'>\n" ).arg( mTabStyle );
mReport += compareHead();

// Data types may differ (?)
Expand Down Expand Up @@ -132,9 +132,9 @@ bool QgsRasterChecker::runTest( QString theVerifiedKey, QString theVerifiedUri,

mReport += "<table><tr>";
mReport += "<td>Data comparison</td>";
mReport += QString( "<td style='%1 %2 border: 1px solid'>correct&nbsp;value</td>" ).arg( mCellStyle).arg( mOkStyle );
mReport += QString( "<td style='%1 %2 border: 1px solid'>correct&nbsp;value</td>" ).arg( mCellStyle ).arg( mOkStyle );
mReport += "<td></td>";
mReport += QString( "<td style='%1 %2 border: 1px solid'>wrong&nbsp;value<br>expected value</td></tr>").arg( mCellStyle).arg( mErrStyle );
mReport += QString( "<td style='%1 %2 border: 1px solid'>wrong&nbsp;value<br>expected value</td></tr>" ).arg( mCellStyle ).arg( mErrStyle );
mReport += "</tr></table>";
mReport += "<br>";

Expand All @@ -148,7 +148,7 @@ bool QgsRasterChecker::runTest( QString theVerifiedKey, QString theVerifiedUri,
verifiedProvider->readBlock( band, expectedProvider->extent(), width, height, verifiedData );

// compare data values
QString htmlTable = QString("<table style='%1'>").arg( mTabStyle );
QString htmlTable = QString( "<table style='%1'>" ).arg( mTabStyle );
for ( int row = 0; row < height; row ++ )
{
htmlTable += "<tr>";
Expand All @@ -169,7 +169,7 @@ bool QgsRasterChecker::runTest( QString theVerifiedKey, QString theVerifiedUri,
allOk = false;
valStr = QString( "%1<br>%2" ).arg( verifiedVal ).arg( expectedVal );
}
htmlTable += QString( "<td style='%1 %2'>%3</td>" ).arg( mCellStyle).arg( cellOk ? mOkStyle : mErrStyle ).arg( valStr );
htmlTable += QString( "<td style='%1 %2'>%3</td>" ).arg( mCellStyle ).arg( cellOk ? mOkStyle : mErrStyle ).arg( valStr );
}
htmlTable += "</tr>";
}
Expand All @@ -187,7 +187,7 @@ bool QgsRasterChecker::runTest( QString theVerifiedKey, QString theVerifiedUri,

void QgsRasterChecker::error( QString theMessage, QString &theReport )
{
theReport += QString( "<font style='%1'>Error: ").arg(mErrMsgStyle);
theReport += QString( "<font style='%1'>Error: " ).arg( mErrMsgStyle );
theReport += theMessage;
theReport += "</font>";
}
Expand All @@ -202,7 +202,7 @@ double QgsRasterChecker::tolerance( double val, int places )
QString QgsRasterChecker::compareHead()
{
QString html;
html += QString( "<tr><th style='%1'>Param name</th><th style='%1'>Verified value</th><th style='%1'>Eexpected value</th><th style='%1'>Difference</th><th style='%1'>Tolerance</th></tr>").arg( mCellStyle );
html += QString( "<tr><th style='%1'>Param name</th><th style='%1'>Verified value</th><th style='%1'>Eexpected value</th><th style='%1'>Difference</th><th style='%1'>Tolerance</th></tr>" ).arg( mCellStyle );
return html;
}

Expand All @@ -229,8 +229,8 @@ void QgsRasterChecker::compare( QString theParamName, double verifiedVal, double
void QgsRasterChecker::compareRow( QString theParamName, QString verifiedVal, QString expectedVal, QString &theReport, bool theOk, QString theDifference, QString theTolerance )
{
theReport += "<tr>\n";
theReport += QString( "<td style='%1'>%2</td><td style='%1 %3'>%4</td><td style='%1'>%5</td>\n" ).arg(mCellStyle).arg( theParamName ).arg( theOk ? mOkStyle : mErrStyle ).arg( verifiedVal ).arg( expectedVal );
theReport += QString( "<td style='%1'>%2</td>\n" ).arg(mCellStyle).arg( theDifference );
theReport += QString( "<td style='%1'>%2</td>\n" ).arg(mCellStyle).arg( theTolerance );
theReport += QString( "<td style='%1'>%2</td><td style='%1 %3'>%4</td><td style='%1'>%5</td>\n" ).arg( mCellStyle ).arg( theParamName ).arg( theOk ? mOkStyle : mErrStyle ).arg( verifiedVal ).arg( expectedVal );
theReport += QString( "<td style='%1'>%2</td>\n" ).arg( mCellStyle ).arg( theDifference );
theReport += QString( "<td style='%1'>%2</td>\n" ).arg( mCellStyle ).arg( theTolerance );
theReport += "</tr>";
}
4 changes: 4 additions & 0 deletions src/core/raster/qgsrasterpipe.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@
#include "qgsrasterrenderer.h"
#include "qgsrasterprojector.h"

#ifdef _MSC_VER
#undef interface
#endif

/** \ingroup core
* Base class for processing modules.
*/
Expand Down
2 changes: 2 additions & 0 deletions src/core/symbology-ng/qgsmarkersymbollayerv2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,8 @@ void QgsSimpleMarkerSymbolLayerV2::renderPoint( const QPointF& point, QgsSymbolV
case QgsSymbolV2::ScaleArea:
scaledSize = sqrt( scaledSize );
break;
case QgsSymbolV2::ScaleDiameter:
break;
}

double half = scaledSize / 2.0;
Expand Down
2 changes: 1 addition & 1 deletion src/gui/attributetable/qgsattributetableidcolumnpair.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class QgsAttributeTableIdColumnPair
public:
QgsAttributeTableIdColumnPair( QgsFeatureId anId, QVariant anItem ) : mId( anId ), mItem( anItem ) {}
/**
* Returns true if this id-column pair is less the the tested one
* Returns true if this id-column pair is less than the tested one
* @param b the tested id-column pair
*/
bool operator<( const QgsAttributeTableIdColumnPair &b ) const;
Expand Down
2 changes: 1 addition & 1 deletion src/gui/qgisgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ namespace QgisGui
settings.setValue( "/UI/lastSaveAsImageDir", QFileInfo( outputFileName ).absolutePath() );
}
#else
//create a file dialog using the the filter list generated above
//create a file dialog using the filter list generated above
std::auto_ptr<QFileDialog> fileDialog( new QFileDialog( theParent, theMessage, lastUsedDir, QStringList( filterMap.keys() ).join( ";;" ) ) );

// allow for selection of more than one file
Expand Down
2 changes: 1 addition & 1 deletion src/gui/qgsmapcanvas.h
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ class GUI_EXPORT QgsMapCanvas : public QGraphicsView
void renderComplete( QPainter * );

/** Emitted when canvas finished a refresh request.
\note Added in 2.0 */
\note Added in 2.0 */
void mapCanvasRefreshed();

/** Emitted when the canvas is about to be rendered.
Expand Down
36 changes: 18 additions & 18 deletions src/gui/qgsmessagebar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@


QgsMessageBar::QgsMessageBar( QWidget *parent )
: QFrame( parent ), mCurrentItem ( NULL )
: QFrame( parent ), mCurrentItem( NULL )
{
QPalette pal = palette();
pal.setBrush( backgroundRole(), pal.window() );
Expand Down Expand Up @@ -66,22 +66,22 @@ void QgsMessageBar::popItem( QgsMessageBarItem *item )
return;

if ( item == mCurrentItem )
{
if ( mCurrentItem )
{
mLayout->removeWidget( mCurrentItem->widget() );
mCurrentItem->widget()->hide();
mCurrentItem = 0;
}

if ( !mList.isEmpty() )
{
pushItem( mList.first() );
}
else
{
hide();
}
{
if ( mCurrentItem )
{
mLayout->removeWidget( mCurrentItem->widget() );
mCurrentItem->widget()->hide();
mCurrentItem = 0;
}

if ( !mList.isEmpty() )
{
pushItem( mList.first() );
}
else
{
hide();
}
}
else
{
Expand All @@ -102,7 +102,7 @@ bool QgsMessageBar::popWidget( QWidget *widget )
return true;
}

foreach( QgsMessageBarItem *item, mList )
foreach ( QgsMessageBarItem *item, mList )
{
if ( item->widget() == widget )
{
Expand Down
2 changes: 1 addition & 1 deletion src/gui/raster/qgssinglebandpseudocolorrendererwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ QgsSingleBandPseudoColorRendererWidget::QgsSingleBandPseudoColorRendererWidget(
mColorInterpolationComboBox->addItem( tr( "Discrete" ), 0 );
mColorInterpolationComboBox->addItem( tr( "Linear" ), 1 );
mColorInterpolationComboBox->addItem( tr( "Exact" ), 2 );

mColorInterpolationComboBox->setCurrentIndex(1);
mClassificationModeComboBox->addItem( tr( "Equal interval" ) );
//quantile would be nice as well

Expand Down
2 changes: 1 addition & 1 deletion src/gui/symbology-ng/qgscptcitycolorrampv2dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ void QgsCptCityColorRampV2Dialog::showEvent( QShowEvent * e )
tabBar->setCurrentIndex( 1 );
mModel = mAuthorsModel;
mBrowserView->setModel( mModel );
}
}
}
if ( modelIndex != QModelIndex() )
{
Expand Down
3 changes: 2 additions & 1 deletion src/gui/symbology-ng/qgsrendererv2widget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ QgsRendererV2DataDefinedMenus::~QgsRendererV2DataDefinedMenus()

void QgsRendererV2DataDefinedMenus::populateMenu( QMenu* menu, const char* slot, QString fieldName, QActionGroup *actionGroup )
{
Q_UNUSED( slot );
QAction* aNo = new QAction( tr( "- no field -" ), actionGroup );
aNo->setCheckable( true );
menu->addAction( aNo );
Expand Down Expand Up @@ -305,4 +306,4 @@ void QgsRendererV2DataDefinedMenus::updateMenu( QActionGroup* actionGroup, QStri
a->setChecked( a->text() == fieldName );
}
}
#endif
#endif
2 changes: 1 addition & 1 deletion src/plugins/dxf2shp_converter/dxflib/src/dl_dxf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ bool DL_Dxf::in( std::stringstream& stream,
* the type of data. The value is on the next line.\n
*
* This function reads a couplet, determines the type of data, and
* passes the value to the the appropriate handler function of
* passes the value to the appropriate handler function of
* \p creationInterface.\n
*
* \p fp is advanced so that the next call to \p readDXFGroups() reads
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/evis/README.TXT
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ eVis was started in 2007 with QGIS v0.7.0. It was our first experience with QGIS
A special "thank you" is extended to the following people who have contributed translations, comments, bug reports, and patches which have helped to make eVis a better tool:
Tim Sutton, Magnus Homann, John Tull, Agustin Lobo, Donald Schrupp, Muslim Bandishoev, Anousak Souphavanh, Ha Quy Quynh, Roberto GarcĂ­a-Yunta, Tom Gottfried

This work was made possible through a grant by the the John D. and Catherine T. MacArthur Foundation. Additionally, these products were prepared by the American Museum of Natural History under award No. NA05SEC46391002 from the National Oceanic and Atmospheric Administration, U.S. Department of Commerce. The statements, findings, conclusions, and recommendations are those of the author(s) and do not necessarily reflect the views of the National Oceanic and Atmospheric Administration or the Department of Commerce.
This work was made possible through a grant by the John D. and Catherine T. MacArthur Foundation. Additionally, these products were prepared by the American Museum of Natural History under award No. NA05SEC46391002 from the National Oceanic and Atmospheric Administration, U.S. Department of Commerce. The statements, findings, conclusions, and recommendations are those of the author(s) and do not necessarily reflect the views of the National Oceanic and Atmospheric Administration or the Department of Commerce.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
** Library General Public License for more details.
**
** This work was made possible through a grant by the the John D. and
** This work was made possible through a grant by the John D. and
** Catherine T. MacArthur Foundation. Additionally, this program was prepared by
** the American Museum of Natural History under award No. NA05SEC46391002
** from the National Oceanic and Atmospheric Administration, U.S. Department
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
** Library General Public License for more details.
**
** This work was made possible through a grant by the the John D. and
** This work was made possible through a grant by the John D. and
** Catherine T. MacArthur Foundation. Additionally, this program was prepared by
** the American Museum of Natural History under award No. NA05SEC46391002
** from the National Oceanic and Atmospheric Administration, U.S. Department
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
** Library General Public License for more details.
**
** This work was made possible through a grant by the the John D. and
** This work was made possible through a grant by the John D. and
** Catherine T. MacArthur Foundation. Additionally, this program was prepared by
** the American Museum of Natural History under award No. NA05SEC46391002
** from the National Oceanic and Atmospheric Administration, U.S. Department
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
** Library General Public License for more details.
**
** This work was made possible through a grant by the the John D. and
** This work was made possible through a grant by the John D. and
** Catherine T. MacArthur Foundation. Additionally, this program was prepared by
** the American Museum of Natural History under award No. NA05SEC46391002
** from the National Oceanic and Atmospheric Administration, U.S. Department
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
** Library General Public License for more details.
**
** This work was made possible through a grant by the the John D. and
** This work was made possible through a grant by the John D. and
** Catherine T. MacArthur Foundation. Additionally, this program was prepared by
** the American Museum of Natural History under award No. NA05SEC46391002
** from the National Oceanic and Atmospheric Administration, U.S. Department
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
** Library General Public License for more details.
**
** This work was made possible through a grant by the the John D. and
** This work was made possible through a grant by the John D. and
** Catherine T. MacArthur Foundation. Additionally, this program was prepared by
** the American Museum of Natural History under award No. NA05SEC46391002
** from the National Oceanic and Atmospheric Administration, U.S. Department
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
** Library General Public License for more details.
**
** This work was made possible through a grant by the the John D. and
** This work was made possible through a grant by the John D. and
** Catherine T. MacArthur Foundation. Additionally, this program was prepared by
** the American Museum of Natural History under award No. NA05SEC46391002
** from the National Oceanic and Atmospheric Administration, U.S. Department
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/evis/databaseconnection/evisquerydefinition.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
** Library General Public License for more details.
**
** This work was made possible through a grant by the the John D. and
** This work was made possible through a grant by the John D. and
** Catherine T. MacArthur Foundation. Additionally, this program was prepared by
** the American Museum of Natural History under award No. NA05SEC46391002
** from the National Oceanic and Atmospheric Administration, U.S. Department
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/evis/eventbrowser/evisconfiguration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
** Library General Public License for more details.
**
** This work was made possible through a grant by the the John D. and
** This work was made possible through a grant by the John D. and
** Catherine T. MacArthur Foundation. Additionally, this program was prepared by
** the American Museum of Natural History under award No. NA05SEC46391002
** from the National Oceanic and Atmospheric Administration, U.S. Department
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/evis/eventbrowser/evisconfiguration.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
** Library General Public License for more details.
**
** This work was made possible through a grant by the the John D. and
** This work was made possible through a grant by the John D. and
** Catherine T. MacArthur Foundation. Additionally, this program was prepared by
** the American Museum of Natural History under award No. NA05SEC46391002
** from the National Oceanic and Atmospheric Administration, U.S. Department
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/evis/eventbrowser/evisgenericeventbrowsergui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
** Library General Public License for more details.
**
** This work was made possible through a grant by the the John D. and
** This work was made possible through a grant by the John D. and
** Catherine T. MacArthur Foundation. Additionally, this program was prepared by
** the American Museum of Natural History under award No. NA05SEC46391002
** from the National Oceanic and Atmospheric Administration, U.S. Department
Expand Down Expand Up @@ -47,7 +47,7 @@
/**
* Constructor called when browser is launched from the application plugin tool bar
* @param parent - Pointer the to parent QWidget for modality
* @param interface - Pointer the the application interface
* @param interface - Pointer to the application interface
* @param fl - Window flags
*/
eVisGenericEventBrowserGui::eVisGenericEventBrowserGui( QWidget* parent, QgisInterface* interface, Qt::WFlags fl )
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/evis/eventbrowser/evisgenericeventbrowsergui.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
** Library General Public License for more details.
**
** This work was made possible through a grant by the the John D. and
** This work was made possible through a grant by the John D. and
** Catherine T. MacArthur Foundation. Additionally, this program was prepared by
** the American Museum of Natural History under award No. NA05SEC46391002
** from the National Oceanic and Atmospheric Administration, U.S. Department
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/evis/eventbrowser/evisimagedisplaywidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
** Library General Public License for more details.
**
** This work was made possible through a grant by the the John D. and
** This work was made possible through a grant by the John D. and
** Catherine T. MacArthur Foundation. Additionally, this program was prepared by
** the American Museum of Natural History under award No. NA05SEC46391002
** from the National Oceanic and Atmospheric Administration, U.S. Department
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/evis/eventbrowser/evisimagedisplaywidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
** Library General Public License for more details.
**
** This work was made possible through a grant by the the John D. and
** This work was made possible through a grant by the John D. and
** Catherine T. MacArthur Foundation. Additionally, this program was prepared by
** the American Museum of Natural History under award No. NA05SEC46391002
** from the National Oceanic and Atmospheric Administration, U.S. Department
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/evis/evis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
** Library General Public License for more details.
**
** This work was made possible through a grant by the the John D. and
** This work was made possible through a grant by the John D. and
** Catherine T. MacArthur Foundation. Additionally, this program was prepared by
** the American Museum of Natural History under award No. NA05SEC46391002
** from the National Oceanic and Atmospheric Administration, U.S. Department
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/evis/evis.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
** Library General Public License for more details.
**
** This work was made possible through a grant by the the John D. and
** This work was made possible through a grant by the John D. and
** Catherine T. MacArthur Foundation. Additionally, this program was prepared by
** the American Museum of Natural History under award No. NA05SEC46391002
** from the National Oceanic and Atmospheric Administration, U.S. Department
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/evis/idtool/eviseventidtool.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
** Library General Public License for more details.
**
** This work was made possible through a grant by the the John D. and
** This work was made possible through a grant by the John D. and
** Catherine T. MacArthur Foundation. Additionally, this program was prepared by
** the American Museum of Natural History under award No. NA05SEC46391002
** from the National Oceanic and Atmospheric Administration, U.S. Department
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/spit/qgsshapefile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ bool QgsShapeFile::insertLayer( QString dbname, QString schema, QString primary_
OGR_F_Destroy( feat );
}
}
// create the GIST index if the the load was successful
// create the GIST index if the load was successful
if ( result )
{
// prompt user to see if they want to build the index and warn
Expand Down
2 changes: 1 addition & 1 deletion src/providers/delimitedtext/qgsdelimitedtextprovider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ QgsDelimitedTextProvider::QgsDelimitedTextProvider( QString uri )

// Open the file and get number of rows, etc. We assume that the
// file has a header row and process accordingly. Caller should make
// sure the the delimited file is properly formed.
// sure that the delimited file is properly formed.
mFile = new QFile( mFileName );
if ( !mFile->open( QIODevice::ReadOnly ) )
{
Expand Down
3 changes: 3 additions & 0 deletions src/providers/grass/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ TARGET_LINK_LIBRARIES(qgis.g.info
${GRASS_LIBRARY_gproj}
${GDAL_LIBRARY}
)
IF (UNIX)
TARGET_LINK_LIBRARIES(qgis.g.info m)
ENDIF (UNIX)

########################################################
# Install
Expand Down
2 changes: 1 addition & 1 deletion src/providers/wfs/qgswfsprovider.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ class QgsWFSProvider: public QgsVectorDataProvider
*/
virtual bool changeAttributeValues( const QgsChangedAttributesMap &attr_map );

/**Reloads the data from the the source. Needs to be implemented by providers with data caches to
/**Reloads the data from the source. Needs to be implemented by providers with data caches to
synchronize with changes in the data source*/
virtual void reloadData();

Expand Down
2 changes: 1 addition & 1 deletion src/providers/wms/qgswmsprovider.h
Original file line number Diff line number Diff line change
Expand Up @@ -739,7 +739,7 @@ class QgsWmsProvider : public QgsRasterDataProvider
*/
QString description() const;

/**Reloads the data from the the source. Needs to be implemented by providers with data caches to
/**Reloads the data from the source. Needs to be implemented by providers with data caches to
synchronize with changes in the data source*/
virtual void reloadData();

Expand Down
114 changes: 57 additions & 57 deletions tests/src/core/testqgscomposerscalebar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,51 +50,51 @@ class TestQgsComposerScaleBar: public QObject

void TestQgsComposerScaleBar::initTestCase()
{
QgsApplication::init();
QgsApplication::initQgis();

//create maplayers from testdata and add to layer registry
QFileInfo rasterFileInfo( QString( TEST_DATA_DIR ) + QDir::separator() + "landsat.tif" );
mRasterLayer = new QgsRasterLayer( rasterFileInfo.filePath(),
rasterFileInfo.completeBaseName() );
QgsMultiBandColorRenderer* rasterRenderer = new QgsMultiBandColorRenderer( mRasterLayer->dataProvider(), 2, 3, 4 );
mRasterLayer->setRenderer( rasterRenderer );

QgsMapLayerRegistry::instance()->addMapLayers( QList<QgsMapLayer*>() << mRasterLayer );

//create composition with composer map
mMapRenderer = new QgsMapRenderer();
mMapRenderer->setLayerSet( QStringList() << mRasterLayer->id() );

//reproject to WGS84
QgsCoordinateReferenceSystem destCRS;
destCRS.createFromId( 4326, QgsCoordinateReferenceSystem::EpsgCrsId );
mMapRenderer->setDestinationCrs( destCRS );
mMapRenderer->setProjectionsEnabled( true );

mComposition = new QgsComposition( mMapRenderer );
mComposition->setPaperSize( 297, 210 ); //A4 landscape
mComposerMap = new QgsComposerMap( mComposition, 20, 20, 150, 150 );
mComposerMap->setFrameEnabled( true );
mComposition->addComposerMap( mComposerMap );
mComposerMap->setNewExtent( QgsRectangle( 17.923, 30.160, 18.023, 30.260 ) );

mComposerScaleBar = new QgsComposerScaleBar( mComposition );
mComposerScaleBar->setSceneRect( QRectF( 20, 180, 20, 20 ) );
mComposition->addComposerScaleBar( mComposerScaleBar );
mComposerScaleBar->setComposerMap( mComposerMap );
mComposerScaleBar->setUnits( QgsComposerScaleBar::Meters );
mComposerScaleBar->setNumUnitsPerSegment( 2000 );
mComposerScaleBar->setNumSegmentsLeft( 0 );
mComposerScaleBar->setNumSegments( 2 );
mComposerScaleBar->setHeight( 5 );
QgsApplication::init();
QgsApplication::initQgis();

//create maplayers from testdata and add to layer registry
QFileInfo rasterFileInfo( QString( TEST_DATA_DIR ) + QDir::separator() + "landsat.tif" );
mRasterLayer = new QgsRasterLayer( rasterFileInfo.filePath(),
rasterFileInfo.completeBaseName() );
QgsMultiBandColorRenderer* rasterRenderer = new QgsMultiBandColorRenderer( mRasterLayer->dataProvider(), 2, 3, 4 );
mRasterLayer->setRenderer( rasterRenderer );

QgsMapLayerRegistry::instance()->addMapLayers( QList<QgsMapLayer*>() << mRasterLayer );

//create composition with composer map
mMapRenderer = new QgsMapRenderer();
mMapRenderer->setLayerSet( QStringList() << mRasterLayer->id() );

//reproject to WGS84
QgsCoordinateReferenceSystem destCRS;
destCRS.createFromId( 4326, QgsCoordinateReferenceSystem::EpsgCrsId );
mMapRenderer->setDestinationCrs( destCRS );
mMapRenderer->setProjectionsEnabled( true );

mComposition = new QgsComposition( mMapRenderer );
mComposition->setPaperSize( 297, 210 ); //A4 landscape
mComposerMap = new QgsComposerMap( mComposition, 20, 20, 150, 150 );
mComposerMap->setFrameEnabled( true );
mComposition->addComposerMap( mComposerMap );
mComposerMap->setNewExtent( QgsRectangle( 17.923, 30.160, 18.023, 30.260 ) );

mComposerScaleBar = new QgsComposerScaleBar( mComposition );
mComposerScaleBar->setSceneRect( QRectF( 20, 180, 20, 20 ) );
mComposition->addComposerScaleBar( mComposerScaleBar );
mComposerScaleBar->setComposerMap( mComposerMap );
mComposerScaleBar->setUnits( QgsComposerScaleBar::Meters );
mComposerScaleBar->setNumUnitsPerSegment( 2000 );
mComposerScaleBar->setNumSegmentsLeft( 0 );
mComposerScaleBar->setNumSegments( 2 );
mComposerScaleBar->setHeight( 5 );
};

void TestQgsComposerScaleBar::cleanupTestCase()
{
delete mComposition;
delete mMapRenderer;
delete mRasterLayer;
delete mComposition;
delete mMapRenderer;
delete mRasterLayer;
};

void TestQgsComposerScaleBar::init()
Expand All @@ -109,34 +109,34 @@ void TestQgsComposerScaleBar::cleanup()

void TestQgsComposerScaleBar::singleBox()
{
mComposerScaleBar->setStyle( "Single Box" );
QgsCompositionChecker checker( "Composer scalebar singleBox", mComposition, QString( QString( TEST_DATA_DIR ) + QDir::separator() +
"control_images" + QDir::separator() + "expected_composerscalebar" + QDir::separator() + "composerscalebar_singlebox.png" ) );
QVERIFY( checker.testComposition() );
mComposerScaleBar->setStyle( "Single Box" );
QgsCompositionChecker checker( "Composer scalebar singleBox", mComposition, QString( QString( TEST_DATA_DIR ) + QDir::separator() +
"control_images" + QDir::separator() + "expected_composerscalebar" + QDir::separator() + "composerscalebar_singlebox.png" ) );
QVERIFY( checker.testComposition() );
};

void TestQgsComposerScaleBar::doubleBox()
{
mComposerScaleBar->setStyle( "Double Box" );
QgsCompositionChecker checker( "Composer scalebar doubleBox", mComposition, QString( QString( TEST_DATA_DIR ) + QDir::separator() +
"control_images" + QDir::separator() + "expected_composerscalebar" + QDir::separator() + "composerscalebar_doublebox.png" ) );
QVERIFY( checker.testComposition() );
mComposerScaleBar->setStyle( "Double Box" );
QgsCompositionChecker checker( "Composer scalebar doubleBox", mComposition, QString( QString( TEST_DATA_DIR ) + QDir::separator() +
"control_images" + QDir::separator() + "expected_composerscalebar" + QDir::separator() + "composerscalebar_doublebox.png" ) );
QVERIFY( checker.testComposition() );
};

void TestQgsComposerScaleBar::numeric()
{
mComposerScaleBar->setStyle( "Numeric" );
QgsCompositionChecker checker( "Composer scalebar numeric", mComposition, QString( QString( TEST_DATA_DIR ) + QDir::separator() +
"control_images" + QDir::separator() + "expected_composerscalebar" + QDir::separator() + "composerscalebar_numeric.png" ) );
QVERIFY( checker.testComposition() );
mComposerScaleBar->setStyle( "Numeric" );
QgsCompositionChecker checker( "Composer scalebar numeric", mComposition, QString( QString( TEST_DATA_DIR ) + QDir::separator() +
"control_images" + QDir::separator() + "expected_composerscalebar" + QDir::separator() + "composerscalebar_numeric.png" ) );
QVERIFY( checker.testComposition() );
};

void TestQgsComposerScaleBar::tick()
{
mComposerScaleBar->setStyle( "Line Ticks Up" );
QgsCompositionChecker checker( "Composer scalebar numeric", mComposition, QString( QString( TEST_DATA_DIR ) + QDir::separator() +
"control_images" + QDir::separator() + "expected_composerscalebar" + QDir::separator() + "composerscalebar_numeric.png" ) );
QVERIFY( checker.testComposition() );
mComposerScaleBar->setStyle( "Line Ticks Up" );
QgsCompositionChecker checker( "Composer scalebar numeric", mComposition, QString( QString( TEST_DATA_DIR ) + QDir::separator() +
"control_images" + QDir::separator() + "expected_composerscalebar" + QDir::separator() + "composerscalebar_numeric.png" ) );
QVERIFY( checker.testComposition() );
};

QTEST_MAIN( TestQgsComposerScaleBar )
Expand Down
3 changes: 3 additions & 0 deletions tests/src/core/testqgsexpression.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,9 @@ class TestQgsExpression: public QObject
QTest::newRow( "condition else" ) << "case when 1=0 then 'bad' else 678 end" << false << QVariant( 678 );
QTest::newRow( "condition null" ) << "case when length(123)=0 then 111 end" << false << QVariant();
QTest::newRow( "condition 2 when" ) << "case when 2>3 then 23 when 3>2 then 32 else 0 end" << false << QVariant( 32 );
QTest::newRow( "coalesce null" ) << "coalesce(NULL)" << false << QVariant( );
QTest::newRow( "coalesce mid-null" ) << "coalesce(1, NULL, 3)" << false << QVariant( 1 );
QTest::newRow( "coalesce exp" ) << "coalesce(NULL, 1+1)" << false << QVariant( 2 );

// Datetime functions
QTest::newRow( "to date" ) << "todate('2012-06-28')" << false << QVariant( QDate( 2012, 6, 28 ) );
Expand Down
2 changes: 2 additions & 0 deletions tests/src/python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ ADD_PYTHON_TEST(PyQgsRasterFileWriter test_qgsrasterfilewriter.py)
ADD_PYTHON_TEST(PyQgsMemoryProvider test_qgsmemoryprovider.py)
ADD_PYTHON_TEST(PyQgsLogger test_qgslogger.py)
ADD_PYTHON_TEST(PyQgsCoordinateTransform test_qgscoordinatetransform.py)
ADD_PYTHON_TEST(PyQgsRectangle test_qgsrectangle.py)
ADD_PYTHON_TEST(PyQgsSpatialIndex test_qgsspatialindex.py)
147 changes: 147 additions & 0 deletions tests/src/python/test_qgsrectangle.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
import unittest

from qgis.core import (QGis,
QgsRectangle,
QgsPoint)

from utilities import getQgisTestApp
QGISAPP, CANVAS, IFACE, PARENT = getQgisTestApp()

class TestQgsRectangle(unittest.TestCase):

def testCtor(self):
rect = QgsRectangle( 5.0, 5.0, 10.0, 10.0)

assert rect.isEmpty(), "Empty rectangle constructed"

myMessage = ('Expected: %s\nGot: %s\n' %
(5.0, rect.xMinimum()))
assert rect.xMinimum() == 5.0, myMessage

myMessage = ('Expected: %s\nGot: %s\n' %
(5.0, rect.yMinimum()))
assert rect.yMinimum() == 5.0, myMessage

myMessage = ('Expected: %s\nGot: %s\n' %
(10.0, rect.xMaximum()))
assert rect.xMaximum() == 10.0, myMessage

myMessage = ('Expected: %s\nGot: %s\n' %
(10.0, rect.yMaximum()))
assert rect.yMaximum() == 10.0, myMessage


def testDimensions(self):
rect = QgsRectangle( 0.0, 0.0, 10.0, 10.0)

myMessage = ('Expected: %s\nGot: %s\n' %
(10.0, rect.width()))
assert rect.width() == 10.0, myMessage

myMessage = ('Expected: %s\nGot: %s\n' %
(10.0, rect.height()))
assert rect.height() == 10.0, myMessage

myMessage = ('Expected: %s\nGot: %s\n' %
("5.0, 5.0", rect.center().toString()))
assert rect.center() == QgsPoint(5.0, 5.0), myMessage

rect.scale(2.0)

myMessage = ('Expected: %s\nGot: %s\n' %
(20.0, rect.width()))
assert rect.width() == 20.0, myMessage

myMessage = ('Expected: %s\nGot: %s\n' %
(20.0, rect.height()))
assert rect.height() == 20.0, myMessage

def testIntersection(self):
rect1 = QgsRectangle( 0.0, 0.0, 5.0, 5.0)
rect2 = QgsRectangle( 2.0, 2.0, 7.0, 7.0)

myMessage = ('Expected: %s\nGot: %s\n' %
(True, rect1.intersects(rect2)))
assert rect1.intersects(rect2), myMessage

rect3 = rect1.intersect(rect2)
assert rect3.isEmpty(), "Empty rectangle returned"

myMessage = ('Expected: %s\nGot: %s\n' %
(3.0, rect.width()))
assert rect.width() == 3.0, myMessage

myMessage = ('Expected: %s\nGot: %s\n' %
(3.0, rect.height()))
assert rect.height() == 3.0, myMessage

def testContains(self):
rect1 = QgsRectangle( 0.0, 0.0, 5.0, 5.0)
rect2 = QgsRectangle( 2.0, 2.0, 7.0, 7.0)
pnt1 = QgsPoint(4.0, 4.0)
pnt2 = QgsPoint(6.0, 2.0)

rect3 = rect1.intersect(rect2)

myMessage = ('Expected: %s\nGot: %s\n' %
(True, rect1.contains(rect3)))
assert rect1.contains(rect3), myMessage

myMessage = ('Expected: %s\nGot: %s\n' %
(True, rect2.contains(rect3)))
assert rect2.contains(rect3), myMessage

# test for point
myMessage = ('Expected: %s\nGot: %s\n' %
(True, rect1.contains(pnt1)))
assert rect1.contains(pnt1), myMessage

myMessage = ('Expected: %s\nGot: %s\n' %
(True, rect2.contains(pnt1)))
assert rect2.contains(pnt1), myMessage

myMessage = ('Expected: %s\nGot: %s\n' %
(True, rect3.contains(pnt1)))
assert rect3.contains(pnt1), myMessage

myMessage = ('Expected: %s\nGot: %s\n' %
(False, rect1.contains(pnt2)))
assert rect1.contains(pnt2), myMessage

myMessage = ('Expected: %s\nGot: %s\n' %
(True, rect2.contains(pnt2)))
assert rect2.contains(pnt2), myMessage

myMessage = ('Expected: %s\nGot: %s\n' %
(True, rect3.contains(pnt2)))
assert rect3.contains(pnt2), myMessage

def testUnion(self):
rect1 = QgsRectangle( 0.0, 0.0, 5.0, 5.0)
rect2 = QgsRectangle( 2.0, 2.0, 7.0, 7.0)
pnt1 = QgsPoint(6.0, 2.0)

rect1.combineExtentWith(rect2)
myMessage = ('Expected: %s\nGot: %s\n' %
(True, rect1.contains(rect2)))
assert rect1.contains(rect2), myMessage

print rect1.toString()
assert rect1 == QgsRectangle(0.0, 0.0, 7.0, 7.0), "Wrong combine with rectangle result"

rect1 = QgsRectangle( 0.0, 0.0, 5.0, 5.0)
rect1.combineExtentWith(6.0, 2.0)
myMessage = ('Expected: %s\nGot: %s\n' %
(True, rect1.contains(pnt1)))
assert rect1.contains(pnt1), myMessage

print rect1.toString()
assert rect1 == QgsRectangle(0.0, 0.0, 6.0, 6.0), "Wrong combine with point result"

rect1 = QgsRectangle( 0.0, 0.0, 5.0, 5.0)
rect1.unionRect(rect2)
myMessage = ('Expected: %s\nGot: %s\n' %
(True, rect1.contains(rect2)))
assert rect1.contains(rect2), myMessage

assert rect1 == QgsRectangle(0.0, 0.0, 7.0, 7.0), "Wrong union result"
41 changes: 41 additions & 0 deletions tests/src/python/test_qgsspatialindex.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import unittest

from qgis.core import (QGis,
QgsRectangle,
QgsPoint)

from utilities import getQgisTestApp
QGISAPP, CANVAS, IFACE, PARENT = getQgisTestApp()

class TestQgsSpatialIndex(unittest.TestCase):

def testIndex(self):
idx = QgsSpatialIndex()
fid = 0
for y in range(5, 15, 5):
for x in range(5, 25, 5):
ft = QgsFeature()
ft.setFeatureId(fid)
ft.setGeometry(QgsGeometry.fromPoint(QgsPoint(x, y)))
idx.insertFeature(ft)
fid += 1

# intersection test
rect = QgsRectangle(7.0, 3.0, 17.0, 13.0)
fids = idx.intersects(rect)

assert len(fids) == 0, "No intersections"

fids.sort()
myMessage = ('Expected: %s\nGot: %s\n' %
([1, 2, 5, 6], fids))
assert fids == [1, 2, 5, 6], myMessage

# nearest neighbor test
fids = idx.nearestNeighbor(QgsPoint(8.75, 6.25), 3)
assert len(fids) == 0, "No intersections"

fids.sort()
myMessage = ('Expected: %s\nGot: %s\n' %
([0, 1, 5], fids))
assert fids == [0, 1, 5], myMessage