Skip to content
Permalink
Browse files

issue warning to message log when active iterator is closed when repl…

…aced
  • Loading branch information
jef-n committed Mar 23, 2013
1 parent e988b35 commit ec07a0c2583a6503a910c38f15d4e6c537b3d31f
@@ -17,6 +17,7 @@
#include "qgsdelimitedtextprovider.h"

#include "qgsgeometry.h"
#include "qgsmessagelog.h"

#include <QTextStream>

@@ -25,7 +26,10 @@ QgsDelimitedTextFeatureIterator::QgsDelimitedTextFeatureIterator( QgsDelimitedTe
{
// make sure that only one iterator is active
if ( P->mActiveIterator )
{
QgsMessageLog::logMessage( QObject::tr( "Already active iterator on this provider was closed." ), QObject::tr( "Delimited text" ) );
P->mActiveIterator->close();
}
P->mActiveIterator = this;

rewind();
@@ -19,6 +19,7 @@
#include "qgsapplication.h"
#include "qgsgeometry.h"
#include "qgslogger.h"
#include "qgsmessagelog.h"

#include <limits>
#include <cstring>
@@ -29,7 +30,10 @@ QgsGPXFeatureIterator::QgsGPXFeatureIterator( QgsGPXProvider* p, const QgsFeatur
{
// make sure that only one iterator is active
if ( P->mActiveIterator )
{
QgsMessageLog::logMessage( QObject::tr( "Already active iterator on this provider was closed." ), QObject::tr( "GPX" ) );
P->mActiveIterator->close();
}
P->mActiveIterator = this;

rewind();
@@ -37,7 +37,10 @@ QgsGrassFeatureIterator::QgsGrassFeatureIterator( QgsGrassProvider* p, const Qgs
{
// make sure that only one iterator is active
if ( P->mActiveIterator )
{
QgsMessageLog::logMessage( tr( "Already active iterator on this provider was closed." ), tr( "GRASS" ) );
P->mActiveIterator->close();
}
P->mActiveIterator = this;

// check if outdated and update if necessary
@@ -18,14 +18,18 @@
#include "qgsgeometry.h"
#include "qgslogger.h"
#include "qgsspatialindex.h"
#include "qgsmessagelog.h"


QgsMemoryFeatureIterator::QgsMemoryFeatureIterator( QgsMemoryProvider* p, const QgsFeatureRequest& request )
: QgsAbstractFeatureIterator( request ), P( p ), mSelectRectGeom( NULL )
{
// make sure that only one iterator is active
if ( P->mActiveIterator )
{
QgsMessageLog::logMessage( QObject::tr( "Already active iterator on this provider was closed." ), QObject::tr( "Memory provider" ) );
P->mActiveIterator->close();
}
P->mActiveIterator = this;

if ( mRequest.filterType() == QgsFeatureRequest::FilterRect && mRequest.flags() & QgsFeatureRequest::ExactIntersect )
@@ -17,8 +17,9 @@
#include "qgsogrprovider.h"

#include "qgsapplication.h"
#include "qgslogger.h"
#include "qgsgeometry.h"
#include "qgslogger.h"
#include "qgsmessagelog.h"

#include <QTextCodec>

@@ -35,7 +36,10 @@ QgsOgrFeatureIterator::QgsOgrFeatureIterator( QgsOgrProvider* p, const QgsFeatur
{
// make sure that only one iterator is active
if ( P->mActiveIterator )
{
QgsMessageLog::logMessage( QObject::tr( "Already active iterator on this provider was closed." ), QObject::tr( "OGR" ) );
P->mActiveIterator->close();
}
P->mActiveIterator = this;

mFeatureFetched = false;
@@ -49,7 +49,10 @@ QgsPostgresFeatureIterator::QgsPostgresFeatureIterator( QgsPostgresProvider* p,
{
// make sure that only one iterator is active
if ( P->mActiveIterator )
{
QgsMessageLog::logMessage( QObject::tr( "Already active iterator on this provider was closed." ), QObject::tr( "PostgreSQL" ) );
P->mActiveIterator->close();
}

mCursorName = QString( "qgisf%1" ).arg( P->mProviderId );

@@ -44,7 +44,10 @@ QgsSpatiaLiteFeatureIterator::QgsSpatiaLiteFeatureIterator( QgsSpatiaLiteProvide
{
// make sure that only one iterator is active
if ( P->mActiveIterator )
{
QgsMessageLog::logMessage( QObject::tr( "Already active iterator on this provider was closed." ), QObject::tr( "SpatiaLite" ) );
P->mActiveIterator->close();
}
P->mActiveIterator = this;

QString whereClause;
@@ -15,6 +15,7 @@
#include "qgswfsfeatureiterator.h"
#include "qgsspatialindex.h"
#include "qgswfsprovider.h"
#include "qgsmessagelog.h"

QgsWFSFeatureIterator::QgsWFSFeatureIterator( QgsWFSProvider* provider, const QgsFeatureRequest& request ):
QgsAbstractFeatureIterator( request ), mProvider( provider )
@@ -28,6 +29,7 @@ QgsWFSFeatureIterator::QgsWFSFeatureIterator( QgsWFSProvider* provider, const Qg

if ( mProvider->mActiveIterator )
{
QgsMessageLog::logMessage( QObject::tr( "Already active iterator on this provider was closed." ), QObject::tr( "WFS" ) );
mProvider->mActiveIterator->close();
}
mProvider->mActiveIterator = this;

0 comments on commit ec07a0c

Please sign in to comment.
You can’t perform that action at this time.